aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjpl2017-02-07 15:31:54 +0100
committerjpl2017-02-07 15:32:06 +0100
commit9814d97e64b5b483ceb9d1a2f8fecc8a8da975be (patch)
tree53ea539f825b2d09cb43015720650b401d248e0d
parentc5848ae804d74064290dc4d9804b8766805c5b8b (diff)
downloadchouette-core-9814d97e64b5b483ceb9d1a2f8fecc8a8da975be.tar.bz2
Refs #2535: updating i18n on table builder
-rw-r--r--app/helpers/newapplication_helper.rb12
-rw-r--r--app/views/workbenches/_filters.html.slim54
-rw-r--r--app/views/workbenches/show.html.slim6
-rw-r--r--config/locales/actions.en.yml4
-rw-r--r--config/locales/actions.fr.yml11
5 files changed, 74 insertions, 13 deletions
diff --git a/app/helpers/newapplication_helper.rb b/app/helpers/newapplication_helper.rb
index f8628d000..88aae9432 100644
--- a/app/helpers/newapplication_helper.rb
+++ b/app/helpers/newapplication_helper.rb
@@ -104,7 +104,7 @@ module NewapplicationHelper
if policy(item).destroy?
content_tag :li, '', class: 'delete-action' do
link_to(polymorph_url, method: :delete, data: { confirm: 'Etes-vous sûr(e) de vouloir effectuer cette action ?' }) do
- txt = t("table.#{action}")
+ txt = t("actions.#{action}")
pic = content_tag :span, '', class: 'fa fa-trash'
pic + txt
end
@@ -113,7 +113,7 @@ module NewapplicationHelper
else
content_tag :li, '', class: 'delete-action' do
link_to(polymorph_url, method: :delete, data: { confirm: 'Etes-vous sûr(e) de vouloir effectuer cette action ?' }) do
- txt = t("table.#{action}")
+ txt = t("actions.#{action}")
pic = content_tag :span, '', class: 'fa fa-trash'
pic + txt
end
@@ -123,13 +123,13 @@ module NewapplicationHelper
elsif action == :edit
if policy(item).present?
if policy(item).update?
- content_tag :li, link_to(t("table.#{action}"), polymorph_url)
+ content_tag :li, link_to(t("actions.#{action}"), polymorph_url)
end
else
- content_tag :li, link_to(t("table.#{action}"), polymorph_url)
+ content_tag :li, link_to(t("actions.#{action}"), polymorph_url)
end
else
- content_tag :li, link_to(t("table.#{action}"), polymorph_url)
+ content_tag :li, link_to(t("actions.#{action}"), polymorph_url)
end
end.join.html_safe
end
@@ -155,7 +155,7 @@ module NewapplicationHelper
tools = content_tag :ul do
actions.collect do |action|
- actitem = link_to '#', title: t("table.#{action}") do
+ actitem = link_to '#', title: t("actions.#{action}") do
if action == :edit
content_tag :span, '', class: 'fa fa-pencil'
elsif action == :delete
diff --git a/app/views/workbenches/_filters.html.slim b/app/views/workbenches/_filters.html.slim
new file mode 100644
index 000000000..0cea2ea5e
--- /dev/null
+++ b/app/views/workbenches/_filters.html.slim
@@ -0,0 +1,54 @@
+.form.form-filter
+ .form-group
+ .control-label Etat
+ .checkbox_list
+ .checkbox
+ label
+ input.check_boxes type='checkbox'
+ span
+ |1
+ span.fa.fa-paw
+ .checkbox
+ label
+ input.check_boxes type='checkbox'
+ span
+ |2
+ span.fa.fa-paw
+
+ .form-group
+ .control-label Organisation(s)
+ .checkbox_list
+ .checkbox
+ label
+ input.check_boxes type='checkbox'
+ span
+ |1
+ span.fa.fa-paw
+ .checkbox
+ label
+ input.check_boxes type='checkbox'
+ span
+ |2
+ span.fa.fa-paw
+
+ .form-group
+ .control-label Nombre de lignes
+ .checkbox_list
+ .checkbox
+ label
+ input.check_boxes type='checkbox'
+ span
+ |1
+ span.fa.fa-paw
+ .checkbox
+ label
+ input.check_boxes type='checkbox'
+ span
+ |2
+ span.fa.fa-paw
+
+ .actions
+ .btn.btn-link Effacer
+ .btn.btn-default Filtrer
+
+/ = "filtres par: etat, orga, nb lignes, plage de validité, date publi. btns: clear filter et filtrer"
diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim
index a8cc585f3..8df65f50c 100644
--- a/app/views/workbenches/show.html.slim
+++ b/app/views/workbenches/show.html.slim
@@ -24,8 +24,9 @@
button.btn.btn-default type='submit'
span.fa.fa-search
- / br
- / = "filtres par: etat, orga, nb lignes, plage de validité, date publi. btns: clear filter et filtrer"
+ .row
+ .col-lg-12
+ = render 'filters'
/ PageContent
.page_content
@@ -35,6 +36,7 @@
- if @wbench_refs.any?
= new_pagination @wbench_refs, 'pull-right'
+ / actions for table: controler+integrer, consulter, modifier, controler, dupliquer, conserver, purger, supprimer
= table_builder @wbench_refs,
{ @wbench_refs.human_attribute_name(:name) => 'name', @wbench_refs.human_attribute_name(:status) => Proc.new {|w| w.archived? ? ("<span class='fa fa-archive'></span> Conservé").html_safe : '-'},
'Organisation' => Proc.new {|w| w.organisation.name},
diff --git a/config/locales/actions.en.yml b/config/locales/actions.en.yml
index ba5bc1506..f39d6c586 100644
--- a/config/locales/actions.en.yml
+++ b/config/locales/actions.en.yml
@@ -2,13 +2,15 @@ en:
actions:
edit: "Edit"
destroy: "Destroy"
+ delete: "Delete"
search: "Search"
add: "Add new"
show: "See"
+ archive: "Archive"
+ unarchive: "Unarchive"
or: "or"
cancel: "Cancel"
search_hint: "Type in a search term"
no_result_text: "No Results"
searching_term: "Searching..."
are_you_sure: Are you sure?
-
diff --git a/config/locales/actions.fr.yml b/config/locales/actions.fr.yml
index 16c687458..758c0ab3e 100644
--- a/config/locales/actions.fr.yml
+++ b/config/locales/actions.fr.yml
@@ -1,10 +1,13 @@
fr:
actions:
- edit: "Modifier"
- destroy: "Supprimer"
+ edit: 'Modifier'
+ destroy: 'Supprimer'
+ delete: 'Supprimer'
search: "Chercher"
- add: "Ajouter"
- show: "Voir"
+ add: 'Ajouter'
+ show: 'Consulter'
+ archive: 'Archiver'
+ unarchive: 'Désarchiver'
or: "ou"
cancel: "Annuler"
search_hint: "Entrez un texte à rechercher"