diff options
| -rw-r--r-- | app/helpers/sync_message_helper.rb | 5 | ||||
| -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 | 2 | ||||
| -rw-r--r-- | app/views/stop_area_referentials/show.html.slim | 2 |
5 files changed, 9 insertions, 4 deletions
diff --git a/app/helpers/sync_message_helper.rb b/app/helpers/sync_message_helper.rb new file mode 100644 index 000000000..d4f11c0f5 --- /dev/null +++ b/app/helpers/sync_message_helper.rb @@ -0,0 +1,5 @@ +module SyncMessageHelper + def criticity_class criticity + return criticity == 'error' ? 'danger' : criticity + end +end diff --git a/app/models/line_referential_sync_message.rb b/app/models/line_referential_sync_message.rb index da9db4095..3b6cf3367 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, :warning, :danger] + enum criticity: [:info, :warning, :error] 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 d75c25ebb..cd2e62405 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, :warning, :danger] + enum criticity: [:info, :warning, :error] validates :criticity, presence: true end diff --git a/app/views/line_referentials/show.html.slim b/app/views/line_referentials/show.html.slim index 95f097fc8..3e9cab269 100644 --- a/app/views/line_referentials/show.html.slim +++ b/app/views/line_referentials/show.html.slim @@ -31,7 +31,7 @@ - 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}" + li.alert class="alert-#{criticity_class(log.criticity)}" strong = l(log.created_at, format: :short) + " : " / [:processing_time] unit conversion - data = log.message_attributs.symbolize_keys! diff --git a/app/views/stop_area_referentials/show.html.slim b/app/views/stop_area_referentials/show.html.slim index 907cdb168..9080d1bec 100644 --- a/app/views/stop_area_referentials/show.html.slim +++ b/app/views/stop_area_referentials/show.html.slim @@ -19,7 +19,7 @@ - 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}" + li.alert class="alert-#{criticity_class(log.criticity)}" strong = l(log.created_at, format: :short) + " : " / [:processing_time] unit conversion - data = log.message_attributs.symbolize_keys! |
