@@ -52,8 +52,15 @@ module UsersHelper
|
|||||||
current_user && current_user.manager?
|
current_user && current_user.manager?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def current_poll_officer?
|
||||||
|
current_user && current_user.poll_officer?
|
||||||
|
end
|
||||||
|
|
||||||
def show_admin_menu?(user = nil)
|
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
|
end
|
||||||
|
|
||||||
def interests_title_text(user)
|
def interests_title_text(user)
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
<% if current_user.administrator? %>
|
|
||||||
<li>
|
|
||||||
<%= link_to admin_stats_path, title: t("admin.menu.stats") do %>
|
|
||||||
<span class="icon-stats"></span>
|
|
||||||
<span class="show-for-small-only">
|
|
||||||
<%= t("admin.menu.stats") %>
|
|
||||||
</span>
|
|
||||||
<% end %>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<%= link_to admin_settings_path, title: t("admin.menu.settings") do %>
|
|
||||||
<span class="icon-settings"></span>
|
|
||||||
<span class="show-for-small-only">
|
|
||||||
<%= t("admin.menu.settings") %>
|
|
||||||
</span>
|
|
||||||
<% end %>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
@@ -19,12 +19,21 @@
|
|||||||
<div class="top-bar-left">
|
<div class="top-bar-left">
|
||||||
<ul class="menu">
|
<ul class="menu">
|
||||||
<li class="menu-text">
|
<li class="menu-text">
|
||||||
<h1>
|
<% if namespace == "officing" %>
|
||||||
<%= link_to namespaced_root_path do %>
|
<h1>
|
||||||
<%= setting["org_name"] %>
|
<%= link_to "#" do %>
|
||||||
<br><small><%= namespaced_header_title %></small>
|
<%= setting["org_name"] %>
|
||||||
<% end %>
|
<br><small><%= namespaced_header_title %></small>
|
||||||
</h1>
|
<% end %>
|
||||||
|
</h1>
|
||||||
|
<% else %>
|
||||||
|
<h1>
|
||||||
|
<%= link_to namespaced_root_path do %>
|
||||||
|
<%= setting["org_name"] %>
|
||||||
|
<br><small><%= namespaced_header_title %></small>
|
||||||
|
<% end %>
|
||||||
|
</h1>
|
||||||
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -32,7 +41,6 @@
|
|||||||
<div id="responsive_menu">
|
<div id="responsive_menu">
|
||||||
<div class="top-bar-right">
|
<div class="top-bar-right">
|
||||||
<ul class="dropdown menu" data-dropdown-menu>
|
<ul class="dropdown menu" data-dropdown-menu>
|
||||||
<%= render "admin/shared/admin_shortcuts" %>
|
|
||||||
<%= render "shared/admin_login_items" %>
|
<%= render "shared/admin_login_items" %>
|
||||||
<%= render "layouts/notification_item" %>
|
<%= render "layouts/notification_item" %>
|
||||||
<%= render "devise/menu/login_items" %>
|
<%= render "devise/menu/login_items" %>
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
<div class="top-bar-right">
|
<div class="top-bar-right">
|
||||||
<ul class="menu" data-responsive-menu="medium-dropdown">
|
<ul class="menu" data-responsive-menu="medium-dropdown">
|
||||||
<%= render "admin/shared/admin_shortcuts", current_user: manager_logged_in %>
|
|
||||||
<%= render "shared/admin_login_items", current_user: manager_logged_in %>
|
<%= render "shared/admin_login_items", current_user: manager_logged_in %>
|
||||||
<%= render "devise/menu/login_items", current_user: manager_logged_in %>
|
<%= render "devise/menu/login_items", current_user: manager_logged_in %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -26,11 +26,12 @@
|
|||||||
<%= link_to t("layouts.header.management"), management_sign_in_path %>
|
<%= link_to t("layouts.header.management"), management_sign_in_path %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<% if current_user.poll_officer? && Poll.current.any? %>
|
||||||
|
<li>
|
||||||
|
<%= link_to t("layouts.header.officing"), officing_root_path %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if current_user && current_user.poll_officer? %>
|
|
||||||
<li>
|
|
||||||
<%= link_to t("layouts.header.officing"), officing_root_path %>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ en:
|
|||||||
participation_title: Participation
|
participation_title: Participation
|
||||||
privacy: Privacy Policy
|
privacy: Privacy Policy
|
||||||
header:
|
header:
|
||||||
administration_menu: Admin
|
administration_menu: Menu
|
||||||
administration: Administration
|
administration: Administration
|
||||||
available_locales: Available languages
|
available_locales: Available languages
|
||||||
collaborative_legislation: Collaborative legislation
|
collaborative_legislation: Collaborative legislation
|
||||||
@@ -242,7 +242,7 @@ en:
|
|||||||
officing: Polling officers
|
officing: Polling officers
|
||||||
help: Help
|
help: Help
|
||||||
my_account_link: My account
|
my_account_link: My account
|
||||||
my_activity_link: My activity
|
my_activity_link: My content
|
||||||
open: open
|
open: open
|
||||||
open_gov: Open government
|
open_gov: Open government
|
||||||
proposals: Proposals
|
proposals: Proposals
|
||||||
@@ -679,7 +679,7 @@ en:
|
|||||||
info_about_receivers_html: "This message will be sent to <strong>%{count} people</strong> and it will be visible in %{proposal_page}.<br> Messages are not sent immediately, users will receive periodically an email with all proposal notifications."
|
info_about_receivers_html: "This message will be sent to <strong>%{count} people</strong> and it will be visible in %{proposal_page}.<br> Messages are not sent immediately, users will receive periodically an email with all proposal notifications."
|
||||||
proposal_page: "the proposal's page"
|
proposal_page: "the proposal's page"
|
||||||
show:
|
show:
|
||||||
back: "Go back to my activity"
|
back: "Go back to my content"
|
||||||
shared:
|
shared:
|
||||||
edit: "Edit"
|
edit: "Edit"
|
||||||
save: "Save"
|
save: "Save"
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ es:
|
|||||||
participation_title: Participación
|
participation_title: Participación
|
||||||
privacy: Política de privacidad
|
privacy: Política de privacidad
|
||||||
header:
|
header:
|
||||||
administration_menu: Admin
|
administration_menu: Menú
|
||||||
administration: Administración
|
administration: Administración
|
||||||
available_locales: Idiomas disponibles
|
available_locales: Idiomas disponibles
|
||||||
collaborative_legislation: Legislación colaborativa
|
collaborative_legislation: Legislación colaborativa
|
||||||
@@ -242,7 +242,7 @@ es:
|
|||||||
officing: Presidentes de mesa
|
officing: Presidentes de mesa
|
||||||
help: Ayuda
|
help: Ayuda
|
||||||
my_account_link: Mi cuenta
|
my_account_link: Mi cuenta
|
||||||
my_activity_link: Mi actividad
|
my_activity_link: Mi contenido
|
||||||
open: abierto
|
open: abierto
|
||||||
open_gov: Gobierno %{open}
|
open_gov: Gobierno %{open}
|
||||||
proposals: Propuestas
|
proposals: Propuestas
|
||||||
@@ -679,7 +679,7 @@ es:
|
|||||||
info_about_receivers_html: "Este mensaje se enviará a <strong>%{count} usuarios</strong> y se publicará en %{proposal_page}.<br> El mensaje no se enviará inmediatamente, los usuarios recibirán periódicamente un email con todas las notificaciones de propuestas."
|
info_about_receivers_html: "Este mensaje se enviará a <strong>%{count} usuarios</strong> y se publicará en %{proposal_page}.<br> 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"
|
proposal_page: "la página de la propuesta"
|
||||||
show:
|
show:
|
||||||
back: "Volver a mi actividad"
|
back: "Volver a mi contenido"
|
||||||
shared:
|
shared:
|
||||||
edit: "Editar"
|
edit: "Editar"
|
||||||
save: "Guardar"
|
save: "Guardar"
|
||||||
|
|||||||
@@ -1542,7 +1542,7 @@ feature "Admin budget investments" do
|
|||||||
|
|
||||||
login_as(valuator.user.reload)
|
login_as(valuator.user.reload)
|
||||||
visit root_path
|
visit root_path
|
||||||
click_link "Admin"
|
click_link "Menu"
|
||||||
click_link "Valuation"
|
click_link "Valuation"
|
||||||
|
|
||||||
within "#budget_#{budget.id}" do
|
within "#budget_#{budget.id}" do
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ feature "Management" do
|
|||||||
|
|
||||||
click_link "Management"
|
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("My account")
|
||||||
expect(page).to have_content("Sign out")
|
expect(page).to have_content("Sign out")
|
||||||
end
|
end
|
||||||
@@ -26,7 +26,7 @@ feature "Management" do
|
|||||||
|
|
||||||
click_link "Management"
|
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("My account")
|
||||||
expect(page).not_to have_content("Sign out")
|
expect(page).not_to have_content("Sign out")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ feature "Poll Officing" do
|
|||||||
|
|
||||||
expect(page).to have_current_path(officing_root_path)
|
expect(page).to have_current_path(officing_root_path)
|
||||||
expect(page).to have_css("#officing_menu")
|
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("#valuation_menu")
|
||||||
expect(page).not_to have_css("#admin_menu")
|
expect(page).not_to have_css("#admin_menu")
|
||||||
expect(page).not_to have_css("#moderation_menu")
|
expect(page).not_to have_css("#moderation_menu")
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ feature "Proposal Notifications" do
|
|||||||
login_as(author)
|
login_as(author)
|
||||||
visit root_path
|
visit root_path
|
||||||
|
|
||||||
click_link "My activity"
|
click_link "My content"
|
||||||
click_link proposal.title
|
click_link proposal.title
|
||||||
click_link "Access the community"
|
click_link "Access the community"
|
||||||
click_link "Send message to the community"
|
click_link "Send message to the community"
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ feature "Users" do
|
|||||||
|
|
||||||
visit account_path
|
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 "/"
|
visit "/"
|
||||||
click_link "Sign out"
|
click_link "Sign out"
|
||||||
@@ -98,7 +98,7 @@ feature "Users" do
|
|||||||
|
|
||||||
visit account_path
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ module Notifications
|
|||||||
login_as(proposal.author)
|
login_as(proposal.author)
|
||||||
visit root_path
|
visit root_path
|
||||||
|
|
||||||
click_link "My activity"
|
click_link "My content"
|
||||||
|
|
||||||
within("#proposal_#{proposal.id}") do
|
within("#proposal_#{proposal.id}") do
|
||||||
click_link proposal.title
|
click_link proposal.title
|
||||||
|
|||||||
Reference in New Issue
Block a user