Move officing link inside header dropdown menu
Also include the condition to hide this link on officing namespace.
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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 %>
|
||||||
</ul>
|
|
||||||
</li>
|
<% if current_user.poll_officer? && Poll.current.any? %>
|
||||||
<% end %>
|
|
||||||
<% if current_user && current_user.poll_officer? %>
|
|
||||||
<li>
|
<li>
|
||||||
<%= link_to t("layouts.header.officing"), officing_root_path %>
|
<%= link_to t("layouts.header.officing"), officing_root_path %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<% 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")
|
||||||
|
|||||||
Reference in New Issue
Block a user