diff options
| -rw-r--r-- | app/models/line_referential.rb | 2 | ||||
| -rw-r--r-- | app/models/stop_area_referential.rb | 2 | ||||
| -rw-r--r-- | app/views/line_referentials/show.html.slim | 22 | ||||
| -rw-r--r-- | app/views/stop_area_referentials/show.html.slim | 22 | ||||
| -rw-r--r-- | config/locales/line_referentials.fr.yml | 4 | ||||
| -rw-r--r-- | config/locales/stop_area_referentials.fr.yml | 5 |
6 files changed, 24 insertions, 33 deletions
diff --git a/app/models/line_referential.rb b/app/models/line_referential.rb index fcee9c5c9..e4801a61e 100644 --- a/app/models/line_referential.rb +++ b/app/models/line_referential.rb @@ -7,7 +7,7 @@ class LineReferential < ActiveRecord::Base has_many :companies, class_name: 'Chouette::Company' has_many :networks, class_name: 'Chouette::Network' - has_many :line_referential_syncs + has_many :line_referential_syncs, -> { order created_at: :desc} def add_member(organisation, options = {}) attributes = options.merge organisation: organisation diff --git a/app/models/stop_area_referential.rb b/app/models/stop_area_referential.rb index 44ef94277..5b84e6178 100644 --- a/app/models/stop_area_referential.rb +++ b/app/models/stop_area_referential.rb @@ -3,7 +3,7 @@ class StopAreaReferential < ActiveRecord::Base has_many :organisations, through: :stop_area_referential_memberships has_many :stop_areas, class_name: 'Chouette::StopArea' - has_many :stop_area_referential_syncs + has_many :stop_area_referential_syncs, -> {order created_at: :desc} def add_member(organisation, options = {}) attributes = options.merge organisation: organisation diff --git a/app/views/line_referentials/show.html.slim b/app/views/line_referentials/show.html.slim index 152c919a8..ec1ff02d8 100644 --- a/app/views/line_referentials/show.html.slim +++ b/app/views/line_referentials/show.html.slim @@ -25,21 +25,17 @@ h3 Historique des synchronisations ul.list-group width="75%" - - unless @line_referential.last_sync.line_referential_sync_messages.empty? - - @line_referential.last_sync.line_referential_sync_messages.last.tap do |log| - li - = log.criticity - br - = log.created_at - br - = t("line_referential_sync.message.#{log.message_key}", log.message_attributs.symbolize_keys!) - hr - end - end + - @line_referential.line_referential_syncs.each do |sync| + - unless sync.line_referential_sync_messages.empty? + - sync.line_referential_sync_messages.last.tap do |log| + - if log.criticity = log.criticity + li.alert class="alert-#{log.criticity}" + strong = l(log.created_at, format: :short) + " : " + = t("line_referential_sync.message.#{log.message_key}", log.message_attributs.symbolize_keys!) - content_for :sidebar do ul.actions li = link_to t('line_referentials.actions.edit'), edit_line_referential_path(@line_referential), class: 'edit' li = link_to t('line_referentials.actions.sync'), sync_line_referential_path(@line_referential), class: 'sync', method: :post - - if @line_referential.last_sync && @line_referential.last_sync.can_be_canceled? - li = link_to t('line_referentials.actions.cancel_sync'), cancel_sync_line_referential_path(@line_referential), class: 'cancel_sync', method: :post + - if @line_referential.last_sync && @line_referential.last_sync.can_be_canceled? + li = link_to t('line_referentials.actions.cancel_sync'), cancel_sync_line_referential_path(@line_referential), class: 'cancel_sync', method: :post diff --git a/app/views/stop_area_referentials/show.html.slim b/app/views/stop_area_referentials/show.html.slim index 30c7ddd62..625dcada9 100644 --- a/app/views/stop_area_referentials/show.html.slim +++ b/app/views/stop_area_referentials/show.html.slim @@ -13,20 +13,16 @@ h3 Historique des synchronisations ul.list-group width="75%" - - unless @stop_area_referential.last_sync.stop_area_referential_sync_messages.empty? - - @stop_area_referential.last_sync.stop_area_referential_sync_messages.last.tap do |log| - li - = log.criticity - br - = log.created_at - br - = t("stop_area_referential_sync.message.#{log.message_key}", log.message_attributs.symbolize_keys!) - hr - end - end + - @stop_area_referential.stop_area_referential_syncs.each do |sync| + - unless sync.stop_area_referential_sync_messages.empty? + - sync.stop_area_referential_sync_messages.last.tap do |log| + - if log.criticity = log.criticity + li.alert class="alert-#{log.criticity}" + strong = l(log.created_at, format: :short) + " : " + = t("stop_area_referential_sync.message.#{log.message_key}", log.message_attributs.symbolize_keys!) - content_for :sidebar do ul.actions li = link_to t('stop_area_referentials.actions.sync'), sync_stop_area_referential_path(@stop_area_referential), class: 'sync', method: :post - - if @stop_area_referential.last_sync - li = link_to t('stop_area_referentials.actions.cancel_sync'), cancel_sync_stop_area_referential_path(@stop_area_referential), class: 'cancel_sync', method: :post + - if @stop_area_referential.last_sync + li = link_to t('stop_area_referentials.actions.cancel_sync'), cancel_sync_stop_area_referential_path(@stop_area_referential), class: 'cancel_sync', method: :post diff --git a/config/locales/line_referentials.fr.yml b/config/locales/line_referentials.fr.yml index 9e885aa52..5a9e2caca 100644 --- a/config/locales/line_referentials.fr.yml +++ b/config/locales/line_referentials.fr.yml @@ -2,8 +2,8 @@ fr: line_referentials: actions: edit: "Modifier ce référentiel" - sync: "Lancer une synchronisation codifligne" - cancel_sync: "Annuler la synchronisation codifligne" + sync: "Lancer une synchronisation Codifligne" + cancel_sync: "Annuler la synchronisation Codifligne" edit: title: "Modifier le référentiel %{line_referential}" activerecord: diff --git a/config/locales/stop_area_referentials.fr.yml b/config/locales/stop_area_referentials.fr.yml index b56e77f60..c825acd00 100644 --- a/config/locales/stop_area_referentials.fr.yml +++ b/config/locales/stop_area_referentials.fr.yml @@ -1,6 +1,5 @@ fr: stop_area_referentials: actions: - sync: "Lancer une synchronisation reflex" - cancel_sync: "Anuller la synchronization reflex" - + sync: "Lancer une synchronisation Reflex" + cancel_sync: "Annuler la synchronisation Reflex" |
