SpeciesFileGroup/taxonworks

View on GitHub
app/views/observation_matrices/show_ascii.html.erb

Summary

Maintainability
Test Coverage
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <link href="/stylesheets/class/mx.css" rel="stylesheet" type="text/css" />
    <title>     matrix: <%=h @mx.name %> (id: <%= @mx.id %>) generated by mx on <%= Time.now %>  </title>
</head>

<body>

    <div style="padding: 20px;">
        matrix: <%=h @mx.name %> (id: <%= @mx.id %>) generated by mx on <%= Time.now %> 
    </div>

    <div style="font-family: courier; font-size:smaller;"> 
        <% @mx.chrs.in_groups_of(@interleave_width, false) do |int| %>   
        <table class="mx" >
            <tr>
                <th>&nbsp;</th>
                <% int.each do |chr| -%>
                <th><%= chr.short_name -%></th>
                <% end -%>      
            </tr>

            <% i = 0 -%>
            <% @otus.each do |otu| -%> 
            <tr class="<%= i == 0 ? "" : "odd" -%>">
                <td><%= otu.display_name(:type => :matrix_name) -%></td>
                <% int.each do |chr| -%>

                <td class="mx_cell" style="text-align: center; min-width: 2em;">
                    <% @cs = ''; @cstxt = ''; -%>        
                    <% @codings_mx[chr.id][otu.id].each do |c| -%>
          <% @cs += c.display_name(:type => :value)  -%>
                    <% end -%>
                    <% if @cs.size > 0 -%>
                    <%= @cs -%>
                    <% else -%>
                    &#8212;  
                    <% end -%> 
                </td>

                <% end -%>          
            </tr>
            <% i == 0 ? i = 1 : i = 0 -%>
            <% end -%>
        </table>   
        <br />
        <% end %>

    </div>

</body>

</html>