From 0ae7bac5d56d5551890e569272f2d26bbb8ccc0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Sun, 12 Feb 2017 22:33:54 +0100 Subject: [PATCH] makes main link in namespaces point to correct root_path --- app/helpers/admin_helper.rb | 8 ++++++++ app/views/layouts/_admin_header.html.erb | 6 +++--- config/locales/admin.en.yml | 2 ++ config/locales/admin.es.yml | 2 ++ config/locales/moderation.en.yml | 2 ++ config/locales/moderation.es.yml | 2 ++ config/locales/officing.en.yml | 2 ++ config/locales/officing.es.yml | 2 ++ config/locales/valuation.en.yml | 2 ++ config/locales/valuation.es.yml | 2 ++ 10 files changed, 27 insertions(+), 3 deletions(-) diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index 75f73f80b..dc0edf7f0 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -4,6 +4,14 @@ module AdminHelper render "/#{namespace}/menu" end + def namespaced_root_path + "/#{namespace}" + end + + def namespaced_header_title + t("#{namespace}.header.title") + end + def menu_tags? ["tags"].include? controller_name end diff --git a/app/views/layouts/_admin_header.html.erb b/app/views/layouts/_admin_header.html.erb index 5fa3bc58f..c2f0e47a7 100644 --- a/app/views/layouts/_admin_header.html.erb +++ b/app/views/layouts/_admin_header.html.erb @@ -10,7 +10,7 @@
- <%= link_to setting['org_name'], admin_root_path, class: "logo show-for-small-only" %> + <%= link_to setting['org_name'], namespaced_root_path, class: "logo show-for-small-only" %> @@ -20,10 +20,10 @@

- <%= link_to admin_root_path, class: "hide-for-small-only" do %> + <%= link_to namespaced_root_path, class: "hide-for-small-only" do %> <%= image_tag('logo_header.png', class: 'hide-for-small-only float-left', size: '80x80', alt: t("layouts.header.logo")) %> <%= setting['org_name'] %> -  | <%= t("admin.dashboard.index.title") %> +  | <%= namespaced_header_title %> <% end %>

diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index 4d44a840b..280b46986 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -1,6 +1,8 @@ --- en: admin: + header: + title: Administration actions: actions: Actions confirm: Are you sure? diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index 2aef70006..e79e52595 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -1,6 +1,8 @@ --- es: admin: + header: + title: Administración actions: actions: Acciones confirm: "¿Estás seguro?" diff --git a/config/locales/moderation.en.yml b/config/locales/moderation.en.yml index 6304e8d62..66697f5e4 100755 --- a/config/locales/moderation.en.yml +++ b/config/locales/moderation.en.yml @@ -1,6 +1,8 @@ --- en: moderation: + header: + title: Moderation comments: index: block_authors: Block authors diff --git a/config/locales/moderation.es.yml b/config/locales/moderation.es.yml index 2d7c3aea5..b41ba0fbf 100644 --- a/config/locales/moderation.es.yml +++ b/config/locales/moderation.es.yml @@ -1,6 +1,8 @@ --- es: moderation: + header: + title: Moderación comments: index: block_authors: Bloquear autores diff --git a/config/locales/officing.en.yml b/config/locales/officing.en.yml index 2ba703672..ffda9d326 100644 --- a/config/locales/officing.en.yml +++ b/config/locales/officing.en.yml @@ -1,6 +1,8 @@ --- en: officing: + header: + title: Polling dashboard: index: title: Poll officing diff --git a/config/locales/officing.es.yml b/config/locales/officing.es.yml index 215b1e9d9..7958b64b0 100644 --- a/config/locales/officing.es.yml +++ b/config/locales/officing.es.yml @@ -1,6 +1,8 @@ --- es: officing: + header: + title: Votaciones dashboard: index: title: Presidir mesa de votaciones diff --git a/config/locales/valuation.en.yml b/config/locales/valuation.en.yml index de19fea09..56cf38f4c 100644 --- a/config/locales/valuation.en.yml +++ b/config/locales/valuation.en.yml @@ -1,6 +1,8 @@ --- en: valuation: + header: + title: Valuation menu: title: Valuation budgets: Participatory budgets diff --git a/config/locales/valuation.es.yml b/config/locales/valuation.es.yml index b588c8521..e45b57e73 100644 --- a/config/locales/valuation.es.yml +++ b/config/locales/valuation.es.yml @@ -1,6 +1,8 @@ --- es: valuation: + header: + title: Evaluación menu: title: Evaluación budgets: Presupuestos participativos