diff options
| author | jpl | 2017-04-24 14:53:00 +0200 | 
|---|---|---|
| committer | jpl | 2017-04-24 14:53:08 +0200 | 
| commit | a6b5d381f5160a7636b076d94886545af55c9fc5 (patch) | |
| tree | 89312a218b50f0900c60a6316d0b79b0439707c3 /app/views/calendars | |
| parent | c96e59ad35eff48cec7c077d4ecf3a6d2d161556 (diff) | |
| download | chouette-core-a6b5d381f5160a7636b076d94886545af55c9fc5.tar.bz2 | |
Refs #3149: updating layout
Diffstat (limited to 'app/views/calendars')
| -rw-r--r-- | app/views/calendars/_calendars.html.slim | 12 | ||||
| -rw-r--r-- | app/views/calendars/_filters.html.slim | 20 | ||||
| -rw-r--r-- | app/views/calendars/index.html.slim | 59 | ||||
| -rw-r--r-- | app/views/calendars/index.js.slim | 1 | 
4 files changed, 52 insertions, 40 deletions
| diff --git a/app/views/calendars/_calendars.html.slim b/app/views/calendars/_calendars.html.slim deleted file mode 100644 index d579c8f7a..000000000 --- a/app/views/calendars/_calendars.html.slim +++ /dev/null @@ -1,12 +0,0 @@ -- if @calendars.any? -  = table_builder @calendars, -    { :name => 'name', :short_name => 'short_name', :shared => 'shared' }, -    [:show, :edit, :delete], -    [], -    'table table-bordered' - -  .text-center -    = will_paginate @calendars, container: false, renderer: RemoteBootstrapPaginationLinkRenderer - -- else -  = replacement_msg t('.search_no_results') diff --git a/app/views/calendars/_filters.html.slim b/app/views/calendars/_filters.html.slim new file mode 100644 index 000000000..8abbd28cd --- /dev/null +++ b/app/views/calendars/_filters.html.slim @@ -0,0 +1,20 @@ += search_form_for @q, url: calendars_path, builder: SimpleForm::FormBuilder, html: { method: :get, class: 'form form-filter' } do |f| +  .ffg-row +    .input-group.search_bar +      = f.search_field :short_name_cont, class: 'form-control', placeholder: 'Indiquez un nom de calendrier...' +      span.input-group-btn +        button.btn.btn-default type='submit' +          span.fa.fa-search + +  .ffg-row +    .form-group.has_switch style='width: 260px' +      = f.label Calendar.human_attribute_name(:shared), class: 'col-sm-4 control-label' +      = f.input :shared, as: :boolean, checked_value: true, unchecked_value: false, label: content_tag(:span, '', class: 'switch-label', data: {checkedValue: t('true'), uncheckedValue: t('false')}), wrapper_html: { class: 'col-sm-8' } + +    .form-group +      = f.label Calendar.human_attribute_name(:date), class: 'control-label' +      = f.input :contains_date, as: :date, label: false, wrapper_html: { class: 'date' }, class: 'form-control' + +  .actions +    = link_to 'Effacer', calendars_path, class: 'btn btn-link' +    = f.submit 'Filtrer', class: 'btn btn-default' diff --git a/app/views/calendars/index.html.slim b/app/views/calendars/index.html.slim index 41cd3d70c..864d1e197 100644 --- a/app/views/calendars/index.html.slim +++ b/app/views/calendars/index.html.slim @@ -1,29 +1,34 @@ -= title_tag t('.title') +/ PageHeader += pageheader 'map-marker', +             t('.title'), +             '', +             '' do -#calendar_search_form -  = search_form_for @q, url: calendars_path, remote: true, html: { method: :get, class: 'form', id: 'search', role: 'form' } do |f| -    .panel.panel-default -      .panel-heading -        .row -          .col-md-3 -            = f.label Calendar.human_attribute_name(:short_name) -            = f.search_field :short_name_cont, class: 'form-control' -          .col-md-3 -            = f.label Calendar.human_attribute_name(:shared) -            = f.select :shared_eq, [[t('.shared'), true], [t('.not_shared'), false]], { include_blank: '' }, { class: 'form-control', style: 'width: 100%', 'data-select2ed': 'true', 'data-select2ed-placeholder': t('.all') } -          .col-md-3 -            = f.label Calendar.human_attribute_name(:date) -            = f.date_field :contains_date, class: 'form-control' +  / Below is secundary actions & optional contents (filters, ...) +  .row.mb-sm +    .col-lg-12.text-right +      = link_to t('actions.add'), new_calendar_path, class: 'btn btn-primary' -          .col-md-3 -            button.btn.btn-primary#search-btn type='submit' -              span.fa.fa-search - -#calendars -  = render 'calendars' - -- content_for :sidebar do -  ul.actions -    li -      = link_to t('calendars.actions.new'), new_calendar_path, class: 'add' -    br +/ PageContent +.page_content +  .container-fluid +    - if params[:q].present? or @calendars.any? +      .row +        .col-lg-12 +          = render 'filters' +           +    - if @calendars.any? +      .row +        .col-lg-12 +          = table_builder @calendars, +            { :name => 'name', :short_name => 'short_name', :shared => 'shared' }, +            [:show, :edit, :delete], +            [], +            'table has-filter' +             +          = new_pagination @calendars, 'pull-right' +           +    - unless @calendars.any? +      .row.mt-xs +        .col-lg-12 +          = replacement_msg t('calendars.search_no_results') diff --git a/app/views/calendars/index.js.slim b/app/views/calendars/index.js.slim deleted file mode 100644 index 936f93e5e..000000000 --- a/app/views/calendars/index.js.slim +++ /dev/null @@ -1 +0,0 @@ -| $('#calendars').html("#{escape_javascript(render('calendars'))}"); | 
