openSNP/snpr

View on GitHub
app/views/phenotypes/recommend_phenotype.html.erb

Summary

Maintainability
Test Coverage
<% if @similar_variations.any? %>
  <h2>Similar Variations</h2>
  You have just entered that
  <em><strong><%= @user_phenotype.variation %></strong></em>
  is your variation for the phenotype
  <em><strong><%= @phenotype.characteristic %></strong></em>.
  Below you can find
  <%= @similar_variations.count %>
  <% if @similar_variations.size > 1 %>
    phenotypes and the answers which are
  <% else %>
    phenotype and the answer which is
  <% end %>
  most-often entered by users who also gave
  <em><%= @user_phenotype.variation %></em> as their variation for
  <em><%= @phenotype.characteristic %></em>. You haven't entered information
  about this phenotype yet. Do you have the same variation for the phenotype or
  something completely different? Let us know!<br/><br/>
  <div class="row">
  <% @similar_variations.each do |v| %>
    <div class="span<%= 16 / @similar_variations.count %> columns">
      <div class="alert alert-block alert-success" data-alert="alert">
        <h5><%= link_to(v.phenotype.characteristic, v.phenotype) %></h5>
        Users with phenotypic variation similar to yours often gave
        <em><strong><%= v.variation %></strong></em> as variation for this
        phenotype. What about you?
        </div>
      </div>
    <% end %>
  </div> 
<% end %>

<% if @similar_phenotypes.any? %>
  <h2>Similar Phenotypes</h2>
  Below you can find <%=@similar_phenotypes.size %>
  <% if @similar_phenotypes.count > 1 %>
    phenotypes
  <% else %>
    phenotype
  <% end %>
  which
  <% if @similar_phenotypes.count > 1 %>
    are
  <% else %>
    is
  <% end %>
  often entered by users who provided us with any information about
  <em><strong><%= @phenotype.characteristic %></strong></em>. This list ignores
  the specific answers that have been given about phenotypes. Maybe you also
  want to enter information about this?<br/><br/>
  <div class="row">
  <% @similar_phenotypes.each do |p| %>
    <div class="span<%= 16 / @similar_phenotypes.count %> columns">
      <div class="alert alert-block alert-success" data-alert="alert">
      <h5><%= link_to(p.characteristic, p) %></h5>
      Description: <em><%= simple_format(p.description) %></em>
      </div>
    </div>
  <% end %>
  </div>
<% end %>