vegantech/sims

View on GitHub
app/views/layouts/_menu.html.erb

Summary

Maintainability
Test Coverage
<ul>
  <% if user_signed_in? %>
    <li><%= link_to "Home", root_path %> </li>
    <%= li_link_to_if_authorized 'School Selection', schools_path %>
    <% cache ["core_pract_and_intervention_pdf_menu",current_district] do %>
      <%= render :partial => "layouts/core_practices" %>
      <%= render :partial => "layouts/intervention_pdf_html_list" %>
      <%= render :partial => "layouts/district_docs" %>

    <% end %>

    <% cache ["menu",current_district,current_user.try(:roles_mask),Right.cache_key,session[:search].blank?] do %>

      <% if session[:search] %>
        <%= li_link_to_if_authorized 'Group Progress Assignment',grouped_progress_entries_path%>
        <%= li_link_to_if_authorized "Personal Groups",personal_groups_path,{},help_popup(PersonalGroup::DESCRIPTION) if current_district.show_personal_groups? %>
      <% end %>
      <%= li_link_to_if_authorized 'Checklist Builder', checklist_builder_checklists_path %>
      <%= li_link_to_if_authorized 'Intervention Builder', intervention_builder_goals_path %>
      <%= li_link_to_if_authorized 'Progress Monitor Builder', intervention_builder_probes_path %>
      <%= li_link_to_if_authorized 'Flag Categories/Core Practices', flag_categories_path %>
      <%= li_link_to_if_authorized 'Tier Builder', tiers_path %>
      <%= content_tag(:li, link_to_with_icon(current_district.active_checklist_document.original_filename,
                                             current_district.active_checklist_document.url )) if current_district && current_district.active_checklist_document? %>
      <%= mmsd_eligibility_criteria(menu=true) if current_district %>

    <% end %>
    <%= plus_minus_li "Reports" do %>
      <%= li_link_to_if_authorized('School Team Notes by Date', '/reports/team_notes') unless current_school.blank? %>
      <%= li_link_to_if_authorized "Regenerate Intervention documents in menu",
        intervention_builder_regenerate_intervention_pdfs_path, :method => :put %>

        <%= li_link_to_if_authorized "Interventions Without Recommended Monitors",
          intervention_builder_interventions_without_recommended_monitors_path, :method => :get %>
          <% if current_student  %>
            <%= li_link_to_if_authorized "<b>Student Report</b>".html_safe, {:controller => 'reports', :action => 'student_overall_options', :student_id => current_student.id } %>
            <%= li_link_to_if_authorized "Student Interventions", {:controller => 'reports', :action => 'student_interventions', :student_id => current_student.id } %>
          <% end %>
          <%= li_link_to_if_authorized 'User Interventions', '/reports/user_interventions' %>
          <%= li_link_to_if_authorized "Grouped Progress Monitors and Comments", '/reports/grouped_progress_entry' if session[:search] %>
          <%= li_link_to_if_authorized "Flagged Students", '/reports/student_flag_summary' if session[:search] %>
        <%  end %>

      <li><%= link_to "Change Password", change_password_path %></li>
      <li><%= link_to "Logout", destroy_user_session_path, :method => :delete, :id => 'logout_link' %></li>
    <% elsif !defined?DEFAULT_URL %>
      <li>Please login.</li>
      <% unless Rails.env.production? %>
        <li>For this demo, use oneschool as the username and password for a basic user</li>
        <li>alphaprin for a principal and school admin</li>
        <li>content_builder to access the builders</li>
        <li>district_admin for the district administration tools</li>
        <li>the training districts use the dpi content</li>
        <li>the z madison district has the madison content</li>
    <% end %>
  <% end %>


  <% cache ["help",current_user.try(:roles_mask),Role.cache_key] do %>
  <%= plus_minus_li "Help" do %>
    <% if user_signed_in? %>
      <% current_user.roles.each do |role| %>
        <%= plus_minus_li role.humanize do %>
          <%Role::HELP[role].each do |role_help| %>
            <%=content_tag(:li, link_to(role_help[:name],role_help[:url])) %>
          <% end %>
        <% end %>
      <% end %>
    <% end %>
  <% end %>
<% end %>
    <%= li_link_to('SIMS Virtual Outbox', railmail_index_url, {:target=>:blank}) if defined? RailmailController or Rails.env.development? %>

</ul>