AgileVentures/osra

View on GitHub
app/views/orphans/show.html.erb

Summary

Maintainability
Test Coverage
<%=render partial: "layouts/content_title.erb", locals: {title: "Show Orphan: #{@orphan.name}, OSRA Number: #{@orphan.osra_num}"} %>

<div class="main-content-header">
  <%= link_to('Edit Orphan', edit_orphan_path(@orphan.id),
              class: 'btn btn-default', role: 'button') %>
</div>

<br>
<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">
      Orphan Details
    </h3>
  </div>
  <div class="panel-body">
    <dl class="dl-horizontal">
      <dt>OSRA Num</dt>
      <dd><%= @orphan.osra_num %></dd>
    </dl>
    <% if @sponsor %>
      <dl class="dl-horizontal">
        <dt>Sponsor</dt>
        <dd><%= link_to @sponsor.name, sponsor_path(@sponsor) %></dd>
      </dl>
    <% end %>
    <dl class="dl-horizontal">
      <dt>Orphan Name</dt>
      <dd><%= @orphan.name %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Date of Birth</dt>
      <dd><%= format_full_date @orphan.date_of_birth %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Gender</dt>
      <dd><%= @orphan.gender %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Health Status</dt>
      <dd><%= @orphan.health_status %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Schooling Status</dt>
      <dd><%= @orphan.schooling_status %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Goes to School</dt>
      <dd><%= @orphan.goes_to_school ? 'Yes' : 'No' %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Contact Number</dt>
      <dd><%= @orphan.contact_number %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Orphan Status</dt>
      <dd><%= @orphan.status.humanize %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Sponsorship Status</dt>
      <dd><%= @orphan.sponsorship_status.humanize %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Priority</dt>
      <dd><%= @orphan.priority %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Created at</dt>
      <dd><%= format_full_date @orphan.created_at %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Updated at</dt>
      <dd><%= format_full_date @orphan.updated_at %></dd>
    </dl>
  </div>
</div>
<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">
      Parents' Details
    </h3>
  </div>
  <div class="panel-body">
    <dl class="dl-horizontal">
      <dt>Father's Given Name</dt>
      <dd><%= @orphan.father_given_name %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Family Name</dt>
      <dd><%= @orphan.family_name %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Father is Deceased</dt>
      <dd><%= @orphan.father_deceased ? 'Yes' : 'No' %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Mother Name</dt>
      <dd><%= @orphan.mother_name %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Mother is Alive</dt>
      <dd><%= @orphan.mother_alive ? 'Yes' : 'No' %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Father is Martyr</dt>
      <dd><%= @orphan.father_is_martyr ? 'Yes' : 'No' %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Father Occupation</dt>
      <dd><%= @orphan.father_occupation %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Father Place of Death</dt>
      <dd><%= @orphan.father_place_of_death %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Father Cause of Death</dt>
      <dd><%= @orphan.father_cause_of_death %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Father Date of Death</dt>
      <dd><%= format_full_date @orphan.father_date_of_death %></dd>
    </dl>
  </div>
</div>
<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">
      Guardian Details
    </h3>
  </div>
  <div class="panel-body">
    <dl class="dl-horizontal">
      <dt>Guardian Name</dt>
      <dd><%= @orphan.guardian_name %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Guardian Relationship</dt>
      <dd><%= @orphan.guardian_relationship %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Guardian Id Num</dt>
      <dd><%= @orphan.guardian_id_num %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Guardian Contact Number</dt>
      <dd><%= @orphan.contact_number %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Alt Contact Number</dt>
      <dd><%= @orphan.alt_contact_number %></dd>
    </dl>
  </div>
</div>
<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">
      Original Address
    </h3>
  </div>
  <div class="panel-body">
    <dl class="dl-horizontal">
      <dt>Province Name</dt>
      <dd><%= @orphan.original_address.province.name %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>City</dt>
      <dd><%= @orphan.original_address.city %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Neighborhood</dt>
      <dd><%= @orphan.original_address.neighborhood %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Street</dt>
      <dd><%= @orphan.original_address.street %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Details</dt>
      <dd><%= @orphan.original_address.details %></dd>
    </dl>
  </div>
</div>
<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">
      Current Address
    </h3>
  </div>
  <div class="panel-body">
    <dl class="dl-horizontal">
      <dt>Province Name</dt>
      <dd><%= @orphan.current_address.province.name %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>City</dt>
      <dd><%= @orphan.current_address.city %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Neighborhood</dt>
      <dd><%= @orphan.current_address.neighborhood %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Street</dt>
      <dd><%= @orphan.current_address.street %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Details</dt>
      <dd><%= @orphan.current_address.details %></dd>
    </dl>
  </div>
</div>
<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">
      Additional Details
    </h3>
  </div>
  <div class="panel-body">
    <dl class="dl-horizontal">
      <dt>Partner</dt>
      <dd><%= @orphan.partner.name %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Sponsored by Another Org.</dt>
      <dd><%= @orphan.sponsored_by_another_org ? 'Yes' : 'No' %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Minor Siblings Count</dt>
      <dd><%= @orphan.minor_siblings_count %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Sponsored Minor Siblings Ct.</dt>
      <dd><%= @orphan.sponsored_minor_siblings_count %></dd>
    </dl>
    <dl class="dl-horizontal">
      <dt>Comments</dt>
      <dd><%= @orphan.comments %></dd>
    </dl>
  </div>
</div>