diff options
| author | jpl | 2017-02-14 19:11:53 +0100 |
|---|---|---|
| committer | jpl | 2017-02-14 19:11:53 +0100 |
| commit | c659eb2c2add37b9bbdb1d6789ffe59ecde9dac8 (patch) | |
| tree | e206b888e89bc9c24e4f01230c2dd4d05cf060b5 | |
| parent | 69d29809e998fa319330d435aacdd87c4ffd6c79 (diff) | |
| download | chouette-core-c659eb2c2add37b9bbdb1d6789ffe59ecde9dac8.tar.bz2 | |
Refs #2606: updating referential_companies#index
| -rw-r--r-- | app/views/referential_companies/_companies.html.slim | 12 | ||||
| -rw-r--r-- | app/views/referential_companies/index.html.slim | 52 | ||||
| -rw-r--r-- | app/views/referential_companies/index.js.slim | 1 |
3 files changed, 35 insertions, 30 deletions
diff --git a/app/views/referential_companies/_companies.html.slim b/app/views/referential_companies/_companies.html.slim deleted file mode 100644 index d6fc33669..000000000 --- a/app/views/referential_companies/_companies.html.slim +++ /dev/null @@ -1,12 +0,0 @@ -- if @companies.any? - = table_builder @companies, - { 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) }, Chouette::Company.human_attribute_name(:name) => 'name', Chouette::Company.human_attribute_name(:code) => 'code' }, - [:show, :edit, :delete], - [], - 'table table-bordered' - - .text-center - = will_paginate @companies, container: false, renderer: RemoteBootstrapPaginationLinkRenderer - -- else - = replacement_msg t('companies.search_no_results') diff --git a/app/views/referential_companies/index.html.slim b/app/views/referential_companies/index.html.slim index d5d02fef2..8cc74c605 100644 --- a/app/views/referential_companies/index.html.slim +++ b/app/views/referential_companies/index.html.slim @@ -1,22 +1,40 @@ -= title_tag t('companies.index.title') +/ PageHeader += pageheader 'map-marker', + t('companies.index.title'), + 'Lorem ipsum dolor sit amet', + '', + (policy(Chouette::Company).create? ? link_to(t('companies.actions.new'), new_referential_company_path(@referential), class: 'btn btn-default') : '') -= search_form_for @q, :url => referential_companies_path(@referential), remote: true, :html => {:method => :get, class: 'form-inline', id: 'search', role: "form"} do |f| +/ PageContent +.page_content + .container-fluid + - if @companies.any? + .row + .col-lg-5.col-md-6.col-sm-6.col-xs-8 + = search_form_for @q, url: referential_companies_path(@referential), html: {method: :get} do |f| + .input-group.search_bar + = f.text_field :name_or_objectid_cont, placeholder: t('.name_or_objectid'), class: 'form-control' - .panel.panel-default - .panel-heading - .input-group.col-md-12 - = f.text_field :name_or_objectid_cont, placeholder: t('.name_or_objectid'), class: 'form-control' + span.input-group-btn + button.btn.btn-default#search-btn type="submit" + span.fa.fa-search - .input-group-btn - button.btn.btn-primary#search-btn type="submit" - span.fa.fa-search + .col-lg-7.col-md-6.col-sm-6.col-xs-4.text-right + = new_pagination @companies + + .row.mt-sm + .col-lg-12 + = table_builder @companies, + { 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) }, @companies.human_attribute_name(:name) => 'name', @companies.human_attribute_name(:code) => 'code', + @companies.human_attribute_name(:fax) => 'fax', + @companies.human_attribute_name(:email) => 'email' }, + [:show, :edit, :delete], + [], + 'table' -#companies - = render partial: 'companies', object: @companies + = new_pagination @companies, 'pull-right' -- content_for :sidebar do - ul.actions - - if policy(Chouette::Company).create? - li - = link_to t('companies.actions.new'), new_referential_company_path(@referential), class: 'add' - br + - else + .row + .col-lg-12 + = replacement_msg t('companies.search_no_results') diff --git a/app/views/referential_companies/index.js.slim b/app/views/referential_companies/index.js.slim deleted file mode 100644 index 601e2bd08..000000000 --- a/app/views/referential_companies/index.js.slim +++ /dev/null @@ -1 +0,0 @@ -| $('#companies').html("#{escape_javascript(render('companies'))}"); |
