vegantech/sims

View on GitHub
app/views/students/_extended_profile.html.erb

Summary

Maintainability
Test Coverage
<h3 class="extended_profile dbl_toggler" data-toggle-id="extended_profile"><span>Extended Profile</span></h3>
<% if @student.extended_profile? %>
  <%= link_to( 'Show/Hide Extended Profile',"" ,:class => 'toggler', "data-toggle-id" => "extended_profile") unless defined?(in_report) %>
  <div id="extended_profile" <%=style_display_none_unless(defined?(in_report)) %> >
     <% ext_pro = @student.ext_summary || @student.build_ext_summary %>
    <%#=extended_profile(@student)%>


<table>
    <tr><td>Student Address: <%=ext_pro.streetAddress.to_s + " " + ext_pro.cityStateZip.to_s%></td></tr>
</table>

  <% if @student.ext_adult_contacts.present? %>
  <h3>Adult Contacts</h3>
  <table>
    <%= render :partial=>'students/adult_contact', :collection=>@student.ext_adult_contacts %>
  </table>
  <% end %>

<table>
<tr><td>Race/Ethnicity: <%=ext_pro.raceEthnicity.to_s%></td></tr>
    <tr><td>Home Language: <%=ext_pro.HomeLanguage%></td></tr>
    <tr><td>Language Proficiency Level: <%=ext_pro.englishProficiency.to_s%></td></tr>
    <tr><td>Receiving ESL services or ESL status:</td><td><%=yes_or_no(ext_pro.esl)%></td></tr>
</table>
<table>
        <tr><td>Special Education Status: <%=ext_pro.specialEdStatus.to_s%></td></tr>
    <tr><td>Primary Disability: <%=ext_pro.disability1.to_s%></td></tr>
    <tr><td>Other Disability: <%=ext_pro.disability2.to_s%></td></tr>

</table>

<%=help_popup("Free/Reduced Lunch status is only available to principals.  (The district admin can change this.)") if restrict_to_principals?(@student) %>
<table>

  <% unless restrict_to_principals?(@student)   %>
    <tr><td>Lunch Status: <%= ext_pro.mealstatus.to_s%></td></tr>
  <% end %>
    <tr><td>Current Attendance:</td><td><%=ext_pro.current_attendance_rate%>%</td></tr>
  <tr><td>Previous Attendance:</td><td><%=ext_pro.previous_attendance_rate%>%</td></tr>
    <tr><td>Suspensions In: <%=ext_pro.suspensions_in.to_s%>  Out: <%=ext_pro.suspensions_out.to_s%></td></tr>
    <tr><td>Periods Tardy: <%=ext_pro.tardies.to_s%></td></tr>
</table>
<table>
  <tr><td>Student Mobility: </td>
    <td> Years In District:</td><td><%=ext_pro.years_in_district%></td></tr>
  <tr><td></td><td>Years at Current School:</td><td><%=ext_pro.years_at_current_school%></td></tr>
  <tr><td></td><td>Previous School:</td><td><%=ext_pro.previous_school_name.to_s%></td></tr>
  <tr><td></td><td>School Changes:</td><td><%=ext_pro.school_changes%></td></tr>
</table>





  <% if @student.ext_siblings.present? %>
    <h3>Siblings</h3>
  <table border=1>
    <tr>
      <th>Name</th>
      <th>Age</th>
      <th>Grade</th>
      <th>StudentNum</th>
    <th>School Name</th>
    </tr>

    <%=render :partial=>'students/sibling', :collection=>@student.ext_siblings %>
  </table>
  <% end %>



  <% if @student.ext_test_scores.present? %>
    <% @test_scores = @student.ext_test_scores.group_by{|e| [e.test_group,e.date.to_s,e.grade]}.group_by{|e| e[0][0]} %>
    <h3>Test Scores:</h3>
    <% @test_scores.each do |test_group| %>
      <center><h4><%=ExtTestScore::TEST_GROUPS[test_group[0]] || test_group[0]%></h4></center>
      <table cellpadding="3">
      <% test_group[1].sort{|x,y| x[1]<=>y[1]}.each do |grade_group| 
      #sorts them by date
      %>
        <tr>

        <% scores=[]
        grade_group[1].each_with_index{ |e,idx| scores[idx/2] = (scores[idx/2] || [] ) + [e] } %>
        <td rowspan="<%=scores.size() +1 %>">
        <%=grade_group[0][2]%>
        </td>
        <td rowspan = "<%=scores.size() +1%>"><%=grade_group[0][1].to_date unless grade_group[0][1].blank?%></td>
        </tr>
        <% scores.each do |score| %>
          <tr>
          <td></td><td></td>
          <%=render :partial=>"students/extended_test_score",:collection=>score %>
          </tr>
       <% end %>
       <% end %>

      </table>
    <% end  %>
  <% end  %>


    <%=@student.ext_arbitrary%>


    <%=links_and_attachments @student, "p" %>
  </div>
<% end %>