aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/referential_networks
diff options
context:
space:
mode:
authorjpl2017-02-14 18:48:08 +0100
committerjpl2017-02-14 18:48:08 +0100
commit45f250c87b60ae6188229aa7725cc43858cb9b51 (patch)
treebaf58e0f7f9ee6ea1ded9abbc3e048507a973117 /app/views/referential_networks
parente49b165161462716d9afda0cad986456483fe2c8 (diff)
downloadchouette-core-45f250c87b60ae6188229aa7725cc43858cb9b51.tar.bz2
Refs #2606: updating referential_networks#index
Diffstat (limited to 'app/views/referential_networks')
-rw-r--r--app/views/referential_networks/_networks.html.slim12
-rw-r--r--app/views/referential_networks/index.html.slim51
-rw-r--r--app/views/referential_networks/index.js.slim1
3 files changed, 34 insertions, 30 deletions
diff --git a/app/views/referential_networks/_networks.html.slim b/app/views/referential_networks/_networks.html.slim
deleted file mode 100644
index fa77ae62c..000000000
--- a/app/views/referential_networks/_networks.html.slim
+++ /dev/null
@@ -1,12 +0,0 @@
-- if @networks.any?
- = table_builder @networks,
- { 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) }, Chouette::Network.human_attribute_name(:name) => 'name' },
- [:show, :edit, :delete],
- [],
- 'table table-bordered'
-
- .text-center
- = will_paginate @networks, container: false, renderer: RemoteBootstrapPaginationLinkRenderer
-
-- else
- = replacement_msg t('networks.search_no_results')
diff --git a/app/views/referential_networks/index.html.slim b/app/views/referential_networks/index.html.slim
index 781df4903..b9f35f165 100644
--- a/app/views/referential_networks/index.html.slim
+++ b/app/views/referential_networks/index.html.slim
@@ -1,21 +1,38 @@
-= title_tag t('networks.index.title')
+/ PageHeader
+= pageheader 'map-marker',
+ t('networks.index.title'),
+ 'Lorem ipsum dolor sit amet',
+ '',
+ (policy(Chouette::Network).create? ? link_to(t('networks.actions.new'), new_referential_network_path(@referential), class: 'btn btn-default') : '')
-= search_form_for @q, :url => referential_networks_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f|
- .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'
+/PageContent
+.page_content
+ .container-fluid
+ - if @networks.any?
+ .row
+ .col-lg-5.col-md-6.col-sm-6.col-xs-8
+ = search_form_for @q, url: referential_networks_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'
- .input-group-btn
- button.btn.btn-primary#search-btn type="submit"
- span.fa.fa-search
+ span.input-group-btn
+ button.btn.btn-default type="submit"
+ span.fa.fa-search
-#networks
- = render partial: 'networks', object: @networks
+ .col-lg-7.col-md-6.col-sm-6.col-xs-4.text-right
+ = new_pagination @networks
-- content_for :sidebar do
- ul.actions
- li
- - if policy(Chouette::Network).create?
- = link_to t('networks.actions.new'), new_referential_network_path(@referential), class: 'add'
- br
+ .row.mt-sm
+ .col-lg-12
+ = table_builder @networks,
+ { 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) }, @networks.human_attribute_name(:name) => 'name', @networks.human_attribute_name(:description) => 'description', @networks.human_attribute_name(:comment) => 'comment' },
+ [:show, :edit, :delete],
+ [],
+ 'table'
+
+ = new_pagination @networks, 'pull-right'
+
+ - else
+ .row
+ .col-lg-12
+ = replacement_msg t('networks.search_no_results')
diff --git a/app/views/referential_networks/index.js.slim b/app/views/referential_networks/index.js.slim
deleted file mode 100644
index 3302a0f2e..000000000
--- a/app/views/referential_networks/index.js.slim
+++ /dev/null
@@ -1 +0,0 @@
-| $('#networks').html("#{escape_javascript(render('networks'))}");