diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 13e537835..547b25787 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -52,8 +52,15 @@ module UsersHelper current_user && current_user.manager? end + def current_poll_officer? + current_user && current_user.poll_officer? + end + def show_admin_menu?(user = nil) - current_administrator? || current_moderator? || current_valuator? || current_manager? || (user && user.administrator?) + unless namespace == "officing" + current_administrator? || current_moderator? || current_valuator? || current_manager? || + (user && user.administrator?) || current_poll_officer? + end end def interests_title_text(user) diff --git a/app/views/admin/shared/_admin_shortcuts.html.erb b/app/views/admin/shared/_admin_shortcuts.html.erb deleted file mode 100644 index 5371cd27e..000000000 --- a/app/views/admin/shared/_admin_shortcuts.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -<% if current_user.administrator? %> -
  • - <%= link_to admin_stats_path, title: t("admin.menu.stats") do %> - - - <%= t("admin.menu.stats") %> - - <% end %> -
  • -
  • - <%= link_to admin_settings_path, title: t("admin.menu.settings") do %> - - - <%= t("admin.menu.settings") %> - - <% end %> -
  • -<% end %> \ No newline at end of file diff --git a/app/views/layouts/_admin_header.html.erb b/app/views/layouts/_admin_header.html.erb index f9d09cc37..d05e61515 100644 --- a/app/views/layouts/_admin_header.html.erb +++ b/app/views/layouts/_admin_header.html.erb @@ -19,12 +19,21 @@
    @@ -32,7 +41,6 @@
    <% end %> -<% if current_user && current_user.poll_officer? %> -
  • - <%= link_to t("layouts.header.officing"), officing_root_path %> -
  • -<% end %> diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml index 8eedc17e9..66661512d 100644 --- a/config/locales/en/general.yml +++ b/config/locales/en/general.yml @@ -229,7 +229,7 @@ en: participation_title: Participation privacy: Privacy Policy header: - administration_menu: Admin + administration_menu: Menu administration: Administration available_locales: Available languages collaborative_legislation: Collaborative legislation @@ -242,7 +242,7 @@ en: officing: Polling officers help: Help my_account_link: My account - my_activity_link: My activity + my_activity_link: My content open: open open_gov: Open government proposals: Proposals @@ -679,7 +679,7 @@ en: info_about_receivers_html: "This message will be sent to %{count} people and it will be visible in %{proposal_page}.
    Messages are not sent immediately, users will receive periodically an email with all proposal notifications." proposal_page: "the proposal's page" show: - back: "Go back to my activity" + back: "Go back to my content" shared: edit: "Edit" save: "Save" diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index 6bf6057d1..414ab4ddf 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -229,7 +229,7 @@ es: participation_title: Participación privacy: Política de privacidad header: - administration_menu: Admin + administration_menu: Menú administration: Administración available_locales: Idiomas disponibles collaborative_legislation: Legislación colaborativa @@ -242,7 +242,7 @@ es: officing: Presidentes de mesa help: Ayuda my_account_link: Mi cuenta - my_activity_link: Mi actividad + my_activity_link: Mi contenido open: abierto open_gov: Gobierno %{open} proposals: Propuestas @@ -679,7 +679,7 @@ es: info_about_receivers_html: "Este mensaje se enviará a %{count} usuarios y se publicará en %{proposal_page}.
    El mensaje no se enviará inmediatamente, los usuarios recibirán periódicamente un email con todas las notificaciones de propuestas." proposal_page: "la página de la propuesta" show: - back: "Volver a mi actividad" + back: "Volver a mi contenido" shared: edit: "Editar" save: "Guardar" diff --git a/spec/features/admin/budget_investments_spec.rb b/spec/features/admin/budget_investments_spec.rb index 79bdd3483..2fb83ef52 100644 --- a/spec/features/admin/budget_investments_spec.rb +++ b/spec/features/admin/budget_investments_spec.rb @@ -1542,7 +1542,7 @@ feature "Admin budget investments" do login_as(valuator.user.reload) visit root_path - click_link "Admin" + click_link "Menu" click_link "Valuation" within "#budget_#{budget.id}" do diff --git a/spec/features/management_spec.rb b/spec/features/management_spec.rb index 8fd95dcba..4a5fd426f 100644 --- a/spec/features/management_spec.rb +++ b/spec/features/management_spec.rb @@ -12,7 +12,7 @@ feature "Management" do click_link "Management" - expect(page).to have_content("My activity") + expect(page).to have_content("My content") expect(page).to have_content("My account") expect(page).to have_content("Sign out") end @@ -26,7 +26,7 @@ feature "Management" do click_link "Management" - expect(page).not_to have_content("My activity") + expect(page).not_to have_content("My content") expect(page).not_to have_content("My account") expect(page).not_to have_content("Sign out") end diff --git a/spec/features/officing_spec.rb b/spec/features/officing_spec.rb index fe03d5eef..9a8bc3f26 100644 --- a/spec/features/officing_spec.rb +++ b/spec/features/officing_spec.rb @@ -118,6 +118,7 @@ feature "Poll Officing" do expect(page).to have_current_path(officing_root_path) expect(page).to have_css("#officing_menu") + expect(page).not_to have_link("Polling officers") expect(page).not_to have_css("#valuation_menu") expect(page).not_to have_css("#admin_menu") expect(page).not_to have_css("#moderation_menu") diff --git a/spec/features/proposal_notifications_spec.rb b/spec/features/proposal_notifications_spec.rb index d02895b4e..089138e21 100644 --- a/spec/features/proposal_notifications_spec.rb +++ b/spec/features/proposal_notifications_spec.rb @@ -9,7 +9,7 @@ feature "Proposal Notifications" do login_as(author) visit root_path - click_link "My activity" + click_link "My content" click_link proposal.title click_link "Access the community" click_link "Send message to the community" diff --git a/spec/features/users_auth_spec.rb b/spec/features/users_auth_spec.rb index cffd8c453..7c7a1222f 100644 --- a/spec/features/users_auth_spec.rb +++ b/spec/features/users_auth_spec.rb @@ -75,7 +75,7 @@ feature "Users" do visit account_path - expect(page).to have_link "My activity", href: user_path(u1) + expect(page).to have_link "My content", href: user_path(u1) visit "/" click_link "Sign out" @@ -98,7 +98,7 @@ feature "Users" do visit account_path - expect(page).to have_link "My activity", href: user_path(u2) + expect(page).to have_link "My content", href: user_path(u2) end end end diff --git a/spec/support/common_actions/notifications.rb b/spec/support/common_actions/notifications.rb index a68af5a56..2d10fab21 100644 --- a/spec/support/common_actions/notifications.rb +++ b/spec/support/common_actions/notifications.rb @@ -17,7 +17,7 @@ module Notifications login_as(proposal.author) visit root_path - click_link "My activity" + click_link "My content" within("#proposal_#{proposal.id}") do click_link proposal.title