diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/models/line_referential_sync_message.rb | 2 | ||||
| -rw-r--r-- | app/models/stop_area_referential_sync_message.rb | 2 | ||||
| -rw-r--r-- | app/views/line_referentials/show.html.slim | 24 | ||||
| -rw-r--r-- | app/views/stop_area_referentials/show.html.slim | 22 |
4 files changed, 27 insertions, 23 deletions
diff --git a/app/models/line_referential_sync_message.rb b/app/models/line_referential_sync_message.rb index c62b77689..da9db4095 100644 --- a/app/models/line_referential_sync_message.rb +++ b/app/models/line_referential_sync_message.rb @@ -1,6 +1,6 @@ class LineReferentialSyncMessage < ActiveRecord::Base belongs_to :line_referential_sync - enum criticity: [:info, :warn, :error] + enum criticity: [:info, :warning, :danger] validates :criticity, presence: true end diff --git a/app/models/stop_area_referential_sync_message.rb b/app/models/stop_area_referential_sync_message.rb index e965297da..d75c25ebb 100644 --- a/app/models/stop_area_referential_sync_message.rb +++ b/app/models/stop_area_referential_sync_message.rb @@ -1,6 +1,6 @@ class StopAreaReferentialSyncMessage < ActiveRecord::Base belongs_to :stop_area_referential_sync - enum criticity: [:info, :warn, :error] + enum criticity: [:info, :warning, :danger] validates :criticity, presence: true end diff --git a/app/views/line_referentials/show.html.slim b/app/views/line_referentials/show.html.slim index 406da8fee..95f097fc8 100644 --- a/app/views/line_referentials/show.html.slim +++ b/app/views/line_referentials/show.html.slim @@ -25,17 +25,19 @@ h3 Historique des synchronisations ul.list-group width="75%" - - @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) + " : " - / [:processing_time] unit conversion - - data = log.message_attributs.symbolize_keys! - - data[:processing_time] = distance_of_time_in_words(data[:processing_time].to_i) - - = t("line_referential_sync.message.#{log.message_key}", log.message_attributs.symbolize_keys!) + - @line_referential.line_referential_syncs.each_with_index do |sync, i| + / Display only 10 msgs + - if i < 10 + - 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) + " : " + / [:processing_time] unit conversion + - data = log.message_attributs.symbolize_keys! + - data[:processing_time] = distance_of_time_in_words(data[:processing_time].to_i) + + = t("line_referential_sync.message.#{log.message_key}", log.message_attributs.symbolize_keys!) - content_for :sidebar do ul.actions diff --git a/app/views/stop_area_referentials/show.html.slim b/app/views/stop_area_referentials/show.html.slim index 9cceed5e5..907cdb168 100644 --- a/app/views/stop_area_referentials/show.html.slim +++ b/app/views/stop_area_referentials/show.html.slim @@ -13,17 +13,19 @@ h3 Historique des synchronisations ul.list-group width="75%" - - @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) + " : " - / [:processing_time] unit conversion - - data = log.message_attributs.symbolize_keys! - - data[:processing_time] = distance_of_time_in_words(data[:processing_time].to_i) + - @stop_area_referential.stop_area_referential_syncs.each_with_index do |sync, i| + / Display only 10 msgs + - if i < 10 + - 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) + " : " + / [:processing_time] unit conversion + - data = log.message_attributs.symbolize_keys! + - data[:processing_time] = distance_of_time_in_words(data[:processing_time].to_i) - = t("stop_area_referential_sync.message.#{log.message_key}", log.message_attributs.symbolize_keys!) + = t("stop_area_referential_sync.message.#{log.message_key}", log.message_attributs.symbolize_keys!) - content_for :sidebar do ul.actions |
