aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorjpl2017-02-09 14:08:31 +0100
committerjpl2017-02-09 14:08:31 +0100
commitaac370c4966ff6587ce108cb507c12891e8bd59e (patch)
tree4d350a5dd77c6df032dfa23af3dae0fe6a0ff693 /app
parenta12940258e720661eb0168154b673d7b4086956e (diff)
downloadchouette-core-aac370c4966ff6587ce108cb507c12891e8bd59e.tar.bz2
Refs #2482: updating referentials#show, according to new layout
Diffstat (limited to 'app')
-rw-r--r--app/helpers/newapplication_helper.rb17
-rw-r--r--app/views/referentials/_clean.html.slim7
-rw-r--r--app/views/referentials/show.html.slim54
3 files changed, 34 insertions, 44 deletions
diff --git a/app/helpers/newapplication_helper.rb b/app/helpers/newapplication_helper.rb
index 97d98799f..e4e0c31a3 100644
--- a/app/helpers/newapplication_helper.rb
+++ b/app/helpers/newapplication_helper.rb
@@ -201,7 +201,7 @@ module NewapplicationHelper
firstRow = content_tag :div, '', class: 'row' do
# Left part with pageicon & pagetitle & desc
- left = content_tag :div, '', class: 'col-lg-9 col-md-8 col-sm-8 col-xs-7' do
+ left = content_tag :div, '', class: 'col-lg-9 col-md-8 col-sm-7 col-xs-7' do
picon = content_tag :div, '', class: 'page-icon' do
content_tag :span, '', class: "fa fa-lg fa-#{pageicon}"
end
@@ -214,7 +214,7 @@ module NewapplicationHelper
picon + ptitle
end
# Right part with meta & mainaction
- right = content_tag :div, '', class: 'col-lg-3 col-md-4 col-sm-4 col-xs-5 text-right' do
+ right = content_tag :div, '', class: 'col-lg-3 col-md-4 col-sm-5 col-xs-5 text-right' do
content_tag :div, '', class: 'page-action' do
a = content_tag :div, meta.html_safe, class: 'small'
b = mainaction.try(:html_safe)
@@ -233,4 +233,17 @@ module NewapplicationHelper
end
end
+ # ModalBox Builder
+ def modalbox id, &block
+ content_tag(:div, '', class: 'modal fade', id: id, tabindex: 1, role: 'dialog') do
+ content_tag(:div, '', class: 'modal-container') do
+ content_tag(:div, '', class: 'modal-dialog') do
+ content_tag(:div, '', class: 'modal-content') do
+ yield
+ end
+ end
+ end
+ end
+ end
+
end
diff --git a/app/views/referentials/_clean.html.slim b/app/views/referentials/_clean.html.slim
deleted file mode 100644
index 4064d77ae..000000000
--- a/app/views/referentials/_clean.html.slim
+++ /dev/null
@@ -1,7 +0,0 @@
-#clean_up
- = semantic_form_for [@referential, CleanUp.new] do |form|
- = form.inputs do
- = form.input :begin_date, as: :date_picker, label: t('titles.clean_up.begin_date'),:wrapper_html => { class: 'date', title: t('titles.clean_up.begin_date') }
- = form.input :end_date, as: :date_picker, label: t('titles.clean_up.end_date'), :wrapper_html => { class: 'date', title: t('titles.clean_up.end_date') }
- = form.actions do
- = form.action :submit, as: :button, label: t('clean_ups.actions.clean_up') , :button_html => { data: { confirm: t('clean_ups.actions.confirm') } }
diff --git a/app/views/referentials/show.html.slim b/app/views/referentials/show.html.slim
index 91dc6103b..8d645e511 100644
--- a/app/views/referentials/show.html.slim
+++ b/app/views/referentials/show.html.slim
@@ -11,6 +11,8 @@
/ Actions are: controler, rapport de controle, dupliquer, purger, conserver, supprimer
= link_to t('actions.clone'), new_referential_path(from: @referential.id), class: 'btn btn-primary'
+ button.btn.btn-primary type='button' data-toggle='modal' data-target='#purgeModal' Purger
+
- if @referential.archived?
= link_to t('actions.unarchive'), unarchive_referential_path(@referential.id), class: 'btn btn-primary'
- else
@@ -62,10 +64,13 @@
- if @reflines.any?
= new_pagination @reflines, 'pull-right'
+ / ID Codif, nom court, nom de la ligne, réseau, mode, transporteur principal, actions = [show, edit_notes]
= table_builder @reflines,
- { 'Oid' => Proc.new { |n| n.objectid.local_id }, @reflines.human_attribute_name(:id) => 'id',
- @reflines.human_attribute_name(:number) => 'number', @reflines.human_attribute_name(:name) => 'name', @reflines.human_attribute_name(:network) => Proc.new { |n| n.try(:network).try(:name) }, @reflines.human_attribute_name(:company) => Proc.new { |n| n.try(:company).try(:name) } },
- [],
+ { 'ID Codif' => Proc.new { |n| n.objectid.local_id }, @reflines.human_attribute_name(:id) => 'id',
+ @reflines.human_attribute_name(:name) => 'name', @reflines.human_attribute_name(:network) => Proc.new { |n| n.try(:network).try(:name) },
+ @reflines.human_attribute_name(:transport_mode) => 'transport_mode',
+ @reflines.human_attribute_name(:company) => Proc.new { |n| n.try(:company).try(:name) } },
+ [:show],
[],
'table'
@@ -74,35 +79,14 @@
- else
= replacement_msg t('referential_lines.search_no_results')
- / - if @referential.created_from
- / p
- / label = "#{Referential.human_attribute_name('created_from')} : "
- / = " #{@referential.created_from.name}"
- /
- / p
- / label = "#{Referential.human_attribute_name('slug')} : "
- / = " #{@referential.slug}"
- /
- / p
- / label = "#{Referential.human_attribute_name('prefix')} : "
- / = " #{@referential.prefix}"
- /
- / p
- / label = "#{Referential.human_attribute_name('projection_type')} : "
- / - if !@referential.projection_type_label.empty?
- / = " #{@referential.projection_type_label} (epsg:#{@referential.projection_type})"
- /
- / p
- / label = "#{Referential.human_attribute_name('time_zone').capitalize} : "
- / = " #{@referential.time_zone}"
-
- / - if @referential.api_keys.present?
- / h3.api_keys = t('.api_keys')
- /
- / .api_keys.paginated_content
- / = paginated_content(@referential.api_keys, "api_keys/api_key")
-
- - content_for :sidebar do
- - if policy(@referential).update?
- h4 = t('.clean_up')
- == render 'clean'
+/ Modal(s)
+= modalbox 'purgeModal' do
+ = simple_form_for [@referential, CleanUp.new] do |f|
+ .modal-header
+ h4.modal-title Purger le JDD
+ .modal-body
+ = f.input :begin_date, as: :date, label: t('titles.clean_up.begin_date'),:wrapper_html => { class: 'date', title: t('titles.clean_up.begin_date') }
+ = f.input :end_date, as: :date, label: t('titles.clean_up.end_date'), :wrapper_html => { class: 'date', title: t('titles.clean_up.end_date') }
+ .modal-footer
+ button.btn.btn-link type='button' data-dismiss='modal' Annuler
+ = f.button :submit, t('actions.clean_up') , class: 'btn btn-primary'