genome/dgi-db

View on GitHub
app/views/interactions/_interaction_summary_tab.html.haml

Summary

Maintainability
Test Coverage
/ special partial for summary tab of interaction view
/ displays main interaction info, other info, and publications
/ - card layout, just like gene drug summary tab
/ - main info in one column? then same 2nd column as gene drug summary tab? so main info replaces aliases?

%div(class="item-title")
  %div(class="item-name")
    %h3(class="item-source")
      %a{href: "/drugs/#{interaction.drug.name}"} 
        =interaction.drug.name
      %span{class: "glyphicon glyphicon-play", "aria-hidden" => "true", style: "margin-left: 10px; margin-right: -8px"}
      &nbsp
      %a{href: "/genes/#{interaction.gene.name}"} 
        =interaction.gene.name 

%div(class="item-content")
  %div{class: "cell category", style: "float: left; width: 50%" }
    %div{class: "item-panel", style:"margin-bottom: 11px"}
      %h4
        Main Info:
      %div{style: "height: 135px; overflow-y: scroll; margin-bottom: 5px;"}
        %table{class: "table table-condensed table-striped", id: "table_main"}
          %tbody
            %tr
              %td{style: "width: 30%"}="Gene"
              %td{style: "width: 70%"}
                %a{href: "/genes/#{interaction.gene.name}"} 
                  =interaction.gene.name
            %tr
              %td="Drug"
              %td
                %a{href: "/drugs/#{interaction.drug.name}"} 
                  =interaction.drug.name
            %tr
              %td="Interaction Types & Directionality"
              %td=interaction.na_or_types.map{|t| t[:directionality].nil? ? t[:type] : "#{t[:type]} (#{t[:directionality]})"}.join(', ')
            %tr
              %td="Interaction Score"
              %td=interaction.interaction_score.round(2)
    %div(class="item-panel")
      %h4
        Publications:
      %div{style: "height: 260px; overflow-y: scroll; "}
        %table{class: "table table-condensed table-striped", id:"table_publications"}
          -interaction.publications.each do |publication|
            %tr
              %td
                %a{href: PMID.pubmed_url(publication.pmid)}
                  = publication.citation
  %div{class: "cell category", style: "float: right; width: 50%"}
    %div(class="item-panel")
      %h4
        Other Info:
      %div{style: "height: 456px; overflow-y: scroll; "}
        %table{class: "table table-condensed table-striped", id: "table_info"}
          -interaction.interaction_attributes.each do |attribute|
            %tr
              %td=attribute.name
              %td=attribute.value