The current tracking section had a few issues: * When browsing as an admin, this section becomes useless since no investments are shown * Browsing investments in the admin section, you're suddenly redirected to the tracking section, making navigation confusing * One test related to the officing dashboard failed due to these changes and had been commented * Several views and controller methods were copied from other sections, leading to duplication and making the code harder to maintain * Tracking routes were defined for proposals and legislation processes, but in the tracking section only investments were shown * Probably many more things, since these issues were detected after only an hour reviewing and testing the code So we're removing this untested section before releasing version 1.1. We might add it back afterwards.
326 lines
13 KiB
Plaintext
326 lines
13 KiB
Plaintext
<div class="admin-sidebar" data-equalizer-watch>
|
|
<ul id="admin_menu" data-accordion-menu data-multi-open="false">
|
|
<% if feature?(:proposals) %>
|
|
<li class="section-title">
|
|
<%= link_to admin_proposals_path do %>
|
|
<span class="icon-proposals"></span>
|
|
<strong><%= t("admin.menu.proposals") %></strong>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<% if feature?(:debates) %>
|
|
<li class="section-title <%= "is-active" if controller_name == "debates" %>">
|
|
<%= link_to admin_debates_path do %>
|
|
<span class="icon-debates"></span>
|
|
<strong><%= t("admin.menu.debates") %></strong>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<li class="section-title <%= "is-active" if controller_name == "comments" %>">
|
|
<%= link_to admin_comments_path do %>
|
|
<span class="icon-comments"></span>
|
|
<strong><%= t("admin.menu.comments") %></strong>
|
|
<% end %>
|
|
</li>
|
|
|
|
<% if feature?(:polls) %>
|
|
<li class="section-title <%= "is-active" if menu_polls? %>">
|
|
<%= link_to admin_polls_path do %>
|
|
<span class="icon-checkmark-circle"></span>
|
|
<strong><%= t("admin.menu.polls") %></strong>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<% if feature?(:legislation) %>
|
|
<li class="section-title <%= "is-active" if controller.class.parent == Admin::Legislation %>">
|
|
<%= link_to admin_legislation_processes_path do %>
|
|
<span class="icon-file-text"></span>
|
|
<strong><%= t("admin.menu.legislation") %></strong>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<% if feature?(:budgets) %>
|
|
<li class="section-title <%= "is-active" if menu_budgets? %>">
|
|
<%= link_to admin_budgets_path do %>
|
|
<span class="icon-budget"></span>
|
|
<strong><%= t("admin.menu.budgets") %></strong>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<li class="section-title">
|
|
<a href="#">
|
|
<span class="icon-box"></span>
|
|
<strong><%= t("admin.menu.title_booths") %></strong>
|
|
</a>
|
|
<ul id="booths_menu" <%= "class=is-active" if menu_booths? || controller_name == "polls" && action_name == "booth_assignments" %>>
|
|
<li <%= "class=is-active" if %w[officers officer_assignments].include?(controller_name) %>>
|
|
<%= link_to t("admin.menu.poll_officers"), admin_officers_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "booths" &&
|
|
action_name != "available" %>>
|
|
<%= link_to t("admin.menu.poll_booths"), admin_booths_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if (controller_name == "polls" &&
|
|
action_name == "booth_assignments") ||
|
|
controller_name == "booth_assignments" &&
|
|
action_name == "manage" %>>
|
|
<%= link_to t("admin.menu.poll_booth_assignments"), booth_assignments_admin_polls_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if %w[shifts booths].include?(controller_name) &&
|
|
%w[available new].include?(action_name) %>>
|
|
<%= link_to t("admin.menu.poll_shifts"), available_admin_booths_path %>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<% if feature?(:signature_sheets) %>
|
|
<li class="section-title <%= "is-active" if controller_name == "signature_sheets" %>">
|
|
<%= link_to admin_signature_sheets_path do %>
|
|
<span class="icon-file-text-o"></span>
|
|
<strong><%= t("admin.menu.signature_sheets") %></strong>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<% messages_sections = %w[newsletters emails_download admin_notifications system_emails] %>
|
|
<% messages_menu_active = messages_sections.include?(controller_name) %>
|
|
<li class="section-title" <%= "class=is-active" if messages_menu_active %>>
|
|
<a href="#">
|
|
<span class="icon-zip"></span>
|
|
<strong><%= t("admin.menu.messaging_users") %></strong>
|
|
</a>
|
|
<ul id="messaging_users_menu" <%= "class=is-active" if messages_menu_active %>>
|
|
<li <%= "class=is-active" if controller_name == "newsletters" %>>
|
|
<%= link_to t("admin.menu.newsletters"), admin_newsletters_path %>
|
|
</li>
|
|
<li <%= "class=is-active" if controller_name == "admin_notifications" %>>
|
|
<%= link_to t("admin.menu.admin_notifications"), admin_admin_notifications_path %>
|
|
</li>
|
|
<li <%= "class=is-active" if controller_name == "system_emails" %>>
|
|
<%= link_to t("admin.menu.system_emails"), admin_system_emails_path %>
|
|
</li>
|
|
<li <%= "class=is-active" if controller_name == "emails_download" %>>
|
|
<%= link_to t("admin.menu.emails_download"), admin_emails_download_index_path %>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="section-title">
|
|
<a href="#">
|
|
<span class="icon-edit"></span>
|
|
<strong><%= t("admin.menu.title_site_customization") %></strong>
|
|
</a>
|
|
<ul <%= "class=is-active" if menu_customization? &&
|
|
controller.class.parent != Admin::Poll::Questions::Answers %>>
|
|
|
|
<li <%= "class=is-active" if menu_homepage? %>>
|
|
<%= link_to t("admin.menu.site_customization.homepage"), admin_homepage_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if menu_pages? || controller_name == "pages" %>>
|
|
<%= link_to t("admin.menu.site_customization.pages"), admin_site_customization_pages_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "banners" %>>
|
|
<%= link_to t("admin.menu.banner"), admin_banners_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "information_texts" %>>
|
|
<%= link_to t("admin.menu.site_customization.information_texts"), admin_site_customization_information_texts_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "documents" %>>
|
|
<%= link_to t("admin.menu.site_customization.documents"),
|
|
admin_site_customization_documents_path %>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="section-title">
|
|
<a href="#">
|
|
<span class="icon-eye"></span>
|
|
<strong><%= t("admin.menu.title_moderated_content") %></strong>
|
|
</a>
|
|
<ul <%= "class=is-active" if menu_moderated_content? %>>
|
|
<% if feature?(:proposals) %>
|
|
<li <%= "class=is-active" if controller_name == "hidden_proposals" %>>
|
|
<%= link_to t("admin.menu.hidden_proposals"), admin_hidden_proposals_path %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<% if feature?(:debates) %>
|
|
<li <%= "class=is-active" if controller_name == "hidden_debates" %>>
|
|
<%= link_to t("admin.menu.hidden_debates"), admin_hidden_debates_path %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<% if feature?(:budgets) %>
|
|
<li <%= "class=is-active" if controller_name == "hidden_budget_investments" %>>
|
|
<%= link_to t("admin.menu.hidden_budget_investments"), admin_hidden_budget_investments_path %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<li <%= "class=is-active" if controller_name == "hidden_comments" %>>
|
|
<%= link_to t("admin.menu.hidden_comments"), admin_hidden_comments_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "proposal_notifications" %>>
|
|
<%= link_to t("admin.menu.hidden_proposal_notifications"), admin_proposal_notifications_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "hidden_users" %>>
|
|
<%= link_to t("admin.menu.hidden_users"), admin_hidden_users_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "activity" %>>
|
|
<%= link_to t("admin.menu.activity"), admin_activity_path %>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="section-title">
|
|
<a href="#">
|
|
<span class="icon-organizations"></span>
|
|
<strong><%= t("admin.menu.title_profiles") %></strong>
|
|
</a>
|
|
<ul <%= "class=is-active" if menu_profiles? %>>
|
|
<li <%= "class=is-active" if controller_name == "administrators" %>>
|
|
<%= link_to t("admin.menu.administrators"), admin_administrators_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "organizations" %>>
|
|
<%= link_to t("admin.menu.organizations"), admin_organizations_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "officials" %>>
|
|
<%= link_to t("admin.menu.officials"), admin_officials_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "moderators" %>>
|
|
<%= link_to t("admin.menu.moderators"), admin_moderators_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "valuators" %>>
|
|
<%= link_to t("admin.menu.valuators"), admin_valuators_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "managers" %>>
|
|
<%= link_to t("admin.menu.managers"), admin_managers_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "users" %>>
|
|
<%= link_to t("admin.menu.users"), admin_users_path %>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="section-title" <%= "class=is-active" if controller_name == "stats" %>>
|
|
<%= link_to admin_stats_path do %>
|
|
<span class="icon-stats"></span><%= t("admin.menu.stats") %>
|
|
<% end %>
|
|
</li>
|
|
|
|
<li class="section-title">
|
|
<a href="#">
|
|
<span class="icon-arrow-down"></span>
|
|
<strong><%= t("admin.menu.download_settings.title") %></strong>
|
|
</a>
|
|
<ul <%= "class=is-active" if controller_name == "download_settings" %>>
|
|
|
|
<% if feature?(:debates) %>
|
|
<li <%= "class=is-active" if !@download_resource.nil? && @download_resource == "debates" %>>
|
|
<%= link_to t("admin.menu.download_settings.debates"), admin_edit_download_settings_path(resource: "debates") %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<% if feature?(:proposals) %>
|
|
<li <%= "class=is-active" if !@download_resource.nil? && @download_resource == "proposals" %>>
|
|
<%= link_to t("admin.menu.download_settings.proposals"), admin_edit_download_settings_path(resource: "proposals") %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<% if feature?(:legislation) %>
|
|
<li <%= "class=is-active" if !@download_resource.nil? && @download_resource == "legislation_processes" %>>
|
|
<%= link_to t("admin.menu.download_settings.legislation_processes"), admin_edit_download_settings_path(resource: "legislation_processes") %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<% if feature?(:budgets) %>
|
|
<li <%= "class=is-active" if !@download_resource.nil? && @download_resource == "budget_investments" %>>
|
|
<%= link_to t("admin.menu.download_settings.budget_investments"), admin_edit_download_settings_path(resource: "budget_investments") %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<% if feature?(:budgets) %>
|
|
<li <%= "class=is-active" if !@download_resource.nil? && @download_resource == "budget_investments" %>>
|
|
<%= link_to t("admin.menu.download_settings.budget_investments_milestones"), admin_edit_download_settings_path(resource: "budget_investments", config: 1) %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<li <%= "class=is-active" if !@download_resource.nil? && @download_resource == "comments" %>>
|
|
<%= link_to t("admin.menu.download_settings.comments"), admin_edit_download_settings_path(resource: "comments") %>
|
|
</li>
|
|
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="section-title">
|
|
<a href="#">
|
|
<span class="icon-settings"></span>
|
|
<strong><%= t("admin.menu.title_settings") %></strong>
|
|
</a>
|
|
<ul <%= "class=is-active" if menu_settings? %>>
|
|
<li <%= "class=is-active" if controller_name == "settings" %>>
|
|
<%= link_to t("admin.menu.settings"), admin_settings_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "tags" %>>
|
|
<%= link_to t("admin.menu.proposals_topics"), admin_tags_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "geozones" %>>
|
|
<%= link_to t("admin.menu.geozones"), admin_geozones_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "images" &&
|
|
controller.class.parent != Admin::Poll::Questions::Answers %>>
|
|
<%= link_to t("admin.menu.site_customization.images"), admin_site_customization_images_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "content_blocks" %>>
|
|
<%= link_to t("admin.menu.site_customization.content_blocks"), admin_site_customization_content_blocks_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if submenu_local_census_records? %>>
|
|
<%= link_to t("admin.menu.local_census_records"), admin_local_census_records_path %>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="section-title">
|
|
<a href="#">
|
|
<span class="icon-check"></span>
|
|
<strong><%= t("admin.menu.dashboard") %></strong>
|
|
</a>
|
|
<ul <%= "class=is-active" if menu_dashboard? %>>
|
|
<li <%= "class=is-active" if controller_name == "actions" %>>
|
|
<%= link_to t("admin.menu.dashboard_actions"), admin_dashboard_actions_path %>
|
|
</li>
|
|
|
|
<li <%= "class=is-active" if controller_name == "administrator_tasks" %>>
|
|
<%= link_to admin_dashboard_administrator_tasks_path do %>
|
|
<%= t("admin.menu.administrator_tasks") %>
|
|
<% end %>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|