From 673718f1db54519b7a2d95af5daebbc6b21d36d4 Mon Sep 17 00:00:00 2001 From: Giga Chubinidze Date: Tue, 13 Jun 2023 11:25:14 +0400 Subject: [PATCH] Breadcrumbs on label/protocol template page [SCI-8476] --- app/controllers/label_templates_controller.rb | 6 +++++- app/controllers/protocols_controller.rb | 6 ++++++ config/locales/en.yml | 3 ++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/controllers/label_templates_controller.rb b/app/controllers/label_templates_controller.rb index 7f38ab1ce..27dcf7e79 100644 --- a/app/controllers/label_templates_controller.rb +++ b/app/controllers/label_templates_controller.rb @@ -206,10 +206,14 @@ class LabelTemplatesController < ApplicationController @breadcrumbs_items = [] @breadcrumbs_items.push({ - label: t('breadcrumbs.labels'), + label: t('breadcrumbs.templates'), url: label_templates_path }) + @breadcrumbs_items.push({ + label: t('breadcrumbs.labels'), + url: label_templates_path + }) if @label_template @breadcrumbs_items.push({ label: @label_template.name, diff --git a/app/controllers/protocols_controller.rb b/app/controllers/protocols_controller.rb index 0a786e43a..d805a1a40 100644 --- a/app/controllers/protocols_controller.rb +++ b/app/controllers/protocols_controller.rb @@ -1162,6 +1162,12 @@ class ProtocolsController < ApplicationController @breadcrumbs_items = [] archived_branch = params[:type] == 'archived' || @protocol&.archived? + @breadcrumbs_items.push({ + label: t('breadcrumbs.templates'), + url: archived_branch ? protocols_path(type: :archived) : protocols_path, + archived: archived_branch + }) + @breadcrumbs_items.push({ label: t('breadcrumbs.protocols'), url: archived_branch ? protocols_path(type: :archived) : protocols_path, diff --git a/config/locales/en.yml b/config/locales/en.yml index fd4ec1ff3..0cddd41fb 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3588,10 +3588,11 @@ en: not_valid: "Not valid URL" breadcrumbs: + templates: "Templates" projects: "Projects" inventories: "Inventories" protocols: "Protocol templates" - labels: "Label templates" + labels: "Label" Add: "Add" Asset: "File"