diff options
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/breadcrumb_helper.rb | 10 | ||||
| -rw-r--r-- | app/helpers/compliance_control_blocks_helper.rb | 10 | ||||
| -rw-r--r-- | app/helpers/lines_helper.rb | 8 | ||||
| -rw-r--r-- | app/helpers/referentials_helper.rb | 10 |
4 files changed, 25 insertions, 13 deletions
diff --git a/app/helpers/breadcrumb_helper.rb b/app/helpers/breadcrumb_helper.rb index a3ee9de72..da1f270ab 100644 --- a/app/helpers/breadcrumb_helper.rb +++ b/app/helpers/breadcrumb_helper.rb @@ -75,13 +75,13 @@ module BreadcrumbHelper end def calendar_breadcrumb(action) - add_breadcrumb I18n.t('breadcrumbs.referentials'), workbenches_path + add_breadcrumb I18n.t('breadcrumbs.root'), root_path add_breadcrumb I18n.t('calendars.index.title'), calendars_path add_breadcrumb @calendar.name if %i(show edit).include? action end def workbench_breadcrumb(action) - add_breadcrumb I18n.t("breadcrumbs.referentials"), workbenches_path + add_breadcrumb I18n.t("breadcrumbs.root"), root_path add_breadcrumb breadcrumb_label(@workbench), workbench_path(@workbench), :title => breadcrumb_tooltip(@workbench) end @@ -217,7 +217,7 @@ module BreadcrumbHelper end def import_breadcrumb (action) - add_breadcrumb I18n.t("breadcrumbs.referentials"), workbenches_path + add_breadcrumb I18n.t("breadcrumbs.root"), root_path add_breadcrumb breadcrumb_label(@workbench), workbench_path(@workbench), :title => breadcrumb_tooltip(@workbench) add_breadcrumb I18n.t("breadcrumbs.imports"), workbench_imports_path(@workbench) @@ -242,7 +242,7 @@ module BreadcrumbHelper end def compliance_control_sets_breadcrumb (action) - add_breadcrumb I18n.t("breadcrumbs.referentials"), workbenches_path + add_breadcrumb I18n.t("breadcrumbs.root"), root_path #add_breadcrumb breadcrumb_label(@workbench), workbench_path(@workbench), :title => breadcrumb_tooltip(@workbench) end @@ -264,7 +264,7 @@ module BreadcrumbHelper end def organisation_breadcrumb (action = :index) - add_breadcrumb I18n.t("breadcrumbs.referentials"), workbenches_path + add_breadcrumb I18n.t("breadcrumbs.root"), root_path add_breadcrumb breadcrumb_label(@organisation), organisation_path,:title => breadcrumb_tooltip(@organisation) unless action == :index end diff --git a/app/helpers/compliance_control_blocks_helper.rb b/app/helpers/compliance_control_blocks_helper.rb new file mode 100644 index 000000000..09e22d6e9 --- /dev/null +++ b/app/helpers/compliance_control_blocks_helper.rb @@ -0,0 +1,10 @@ +module ComplianceControlBlocksHelper + def transport_mode(transport_mode, transport_submode) + if (transport_mode) && (transport_submode) != "" + transportMode = "[" + t("enumerize.transport_mode.#{transport_mode}") + "]" + "[" + t("enumerize.transport_submode.#{transport_submode}") + "]" + else + transportMode = "[Tous les modes de transport]" + end + transportMode + end +end
\ No newline at end of file diff --git a/app/helpers/lines_helper.rb b/app/helpers/lines_helper.rb index ccf3a12a2..e9a4bd3c5 100644 --- a/app/helpers/lines_helper.rb +++ b/app/helpers/lines_helper.rb @@ -5,14 +5,6 @@ module LinesHelper line.number end - def sorted_transport_submode - Chouette::Line.transport_submode.values.sort_by{|m| t("enumerize.line.transport_submode.#{m}").parameterize } - end - - def sorted_transport_mode - Chouette::Line.transport_mode.values.sort_by{|m| t("enumerize.line.transport_mode.#{m}").parameterize } - end - def colors?(line) line.text_color.present? || line.color.present? end diff --git a/app/helpers/referentials_helper.rb b/app/helpers/referentials_helper.rb index 73384bef6..f3c18d9f8 100644 --- a/app/helpers/referentials_helper.rb +++ b/app/helpers/referentials_helper.rb @@ -1,2 +1,12 @@ module ReferentialsHelper + # Line statuses helper + def line_status(status) + if status + cls = 'danger' + content_tag :span, status ? " #{t('false')} " : " #{t('true')}", class: "fa fa-exclamation-circle fa-lg text-#{cls}" + else + cls = 'success' + content_tag :span, status ? " #{t('false')} " : " #{t('true')}", class: "fa fa-check-circle fa-lg text-#{cls}" + end + end end |
