2021-06-23 18:56:04 +02:00
|
|
|
%ul.revision-changes
|
2021-06-18 11:15:10 +02:00
|
|
|
- changes.each do |change|
|
2021-06-23 18:56:04 +02:00
|
|
|
- postfix = change[:private] ? '_private' : ''
|
2021-06-18 11:15:10 +02:00
|
|
|
- case change[:op]
|
|
|
|
- when :add
|
2021-06-23 18:56:04 +02:00
|
|
|
%li.mb-1= t("add#{postfix}", label: change[:label], scope: [:new_administrateur, :revision_changes])
|
2021-06-18 11:15:10 +02:00
|
|
|
- when :remove
|
2021-06-23 18:56:04 +02:00
|
|
|
%li.mb-1= t("remove#{postfix}", label: change[:label], scope: [:new_administrateur, :revision_changes])
|
2021-06-18 11:15:10 +02:00
|
|
|
- when :update
|
|
|
|
- case change[:attribute]
|
|
|
|
- when :libelle
|
2021-06-23 18:56:04 +02:00
|
|
|
%li.mb-1= t("update_libelle#{postfix}", label: change[:label], to: change[:to], scope: [:new_administrateur, :revision_changes])
|
2021-06-18 11:15:10 +02:00
|
|
|
- when :type_champ
|
2021-06-23 18:56:04 +02:00
|
|
|
%li.mb-1= t("update_type_champ#{postfix}", label: change[:label], to: t("activerecord.attributes.type_de_champ.type_champs.#{change[:to]}"), scope: [:new_administrateur, :revision_changes])
|
2021-06-18 11:15:10 +02:00
|
|
|
- when :description
|
2021-06-23 18:56:04 +02:00
|
|
|
%li.mb-1= t("update_description#{postfix}", label: change[:label], to: change[:to], scope: [:new_administrateur, :revision_changes])
|
2021-06-18 11:15:10 +02:00
|
|
|
- when :mandatory
|
|
|
|
- if change[:from] == false
|
2021-09-15 19:36:38 +02:00
|
|
|
-# i18n-tasks-use t('new_administrateur.revision_changes.update_mandatory.enabled')
|
|
|
|
-# i18n-tasks-use t('new_administrateur.revision_changes.update_mandatory_private.enabled')
|
|
|
|
%li.mb-1= t("new_administrateur.revision_changes.update_mandatory#{postfix}.enabled", label: change[:label])
|
2021-06-18 11:15:10 +02:00
|
|
|
- else
|
2021-09-15 19:36:38 +02:00
|
|
|
-# i18n-tasks-use t('new_administrateur.revision_changes.update_mandatory.disabled')
|
|
|
|
-# i18n-tasks-use t('new_administrateur.revision_changes.update_mandatory_private.disabled')
|
|
|
|
%li.mb-1= t("new_administrateur.revision_changes.update_mandatory#{postfix}.disabled", label: change[:label])
|
2021-06-18 11:15:10 +02:00
|
|
|
- when :piece_justificative_template
|
2021-09-15 19:36:38 +02:00
|
|
|
-# i18n-tasks-use t('new_administrateur.revision_changes.update_piece_justificative_template')
|
|
|
|
-# i18n-tasks-use t('new_administrateur.revision_changes.update_piece_justificative_template_private')
|
|
|
|
%li.mb-1= t("new_administrateur.revision_changes.update_piece_justificative_template#{postfix}", label: change[:label])
|
2021-06-18 11:15:10 +02:00
|
|
|
- when :drop_down_options
|
|
|
|
- added = change[:to].sort - change[:from].sort
|
|
|
|
- removed = change[:from].sort - change[:to].sort
|
|
|
|
%li.mb-1
|
2021-09-15 19:36:38 +02:00
|
|
|
= t("update_drop_down_options#{postfix}", scope: [:new_administrateur, :revision_changes], label: change[:label])
|
2021-06-18 11:15:10 +02:00
|
|
|
%ul
|
|
|
|
- if added.present?
|
2021-09-15 19:37:53 +02:00
|
|
|
%li= t(:add_option, scope: [:new_administrateur, :revision_changes], items: added.map{ |term| "« #{term.strip} »" }.join(", "))
|
2021-06-18 11:15:10 +02:00
|
|
|
- if removed.present?
|
2021-09-15 19:37:53 +02:00
|
|
|
%li= t(:remove_option, scope: [:new_administrateur, :revision_changes], items: removed.map{ |term| "« #{term.strip} »" }.join(", "))
|
2021-06-23 15:54:12 +02:00
|
|
|
- when :carte_layers
|
|
|
|
- added = change[:to].sort - change[:from].sort
|
|
|
|
- removed = change[:from].sort - change[:to].sort
|
|
|
|
%li.mb-1
|
2021-09-15 19:36:38 +02:00
|
|
|
= t("update_carte_layers#{postfix}", scope: [:new_administrateur, :revision_changes], label: change[:label])
|
2021-06-23 15:54:12 +02:00
|
|
|
%ul
|
|
|
|
- if added.present?
|
2021-09-15 19:37:53 +02:00
|
|
|
%li= t(:add_option, scope: [:new_administrateur, :revision_changes], items: added.map{ |term| "« #{t(term, scope: [:new_administrateur, :carte_layers])} »" }.join(", "))
|
2021-06-23 15:54:12 +02:00
|
|
|
- if removed.present?
|
2021-09-15 19:37:53 +02:00
|
|
|
%li= t(:remove_option, scope: [:new_administrateur, :revision_changes], items: removed.map{ |term| "« #{t(term, scope: [:new_administrateur, :carte_layers])} »" }.join(", "))
|
2021-06-23 18:56:04 +02:00
|
|
|
- move_changes, move_private_changes = changes.filter { |change| change[:op] == :move }.partition { |change| !change[:private] }
|
|
|
|
- if move_changes.size != 0
|
2021-09-15 19:37:53 +02:00
|
|
|
%li.mb-1= t(:move, scope: [:new_administrateur, :revision_changes], count: move_changes.size)
|
2021-06-23 18:56:04 +02:00
|
|
|
- if move_private_changes.size != 0
|
2021-09-15 19:37:53 +02:00
|
|
|
%li.mb-1= t(:move_private, scope: [:new_administrateur, :revision_changes], count: move_private_changes.size)
|