genome/dgi-db

View on GitHub
app/views/drug_claims/_drug_claim.html.haml

Summary

Maintainability
Test Coverage
- cache drug_claim do
  .container-fluid
    .tabbable
      .tab-content
        .tab-pane.active#summary
          .row-fluid#container 
            .span12
              %ul(class="result-list" id="list-results")
                %li.drug
                  %div(class="item-title")
                    %div(class="item-name")
                      %h3(class="item-source")
                        =succeed ':' do
                          =link_to drug_claim.source.source_db_name, source_path(drug_claim.source.source_db_name)
                        %span(class="item-id")
                          =ext_link_to drug_claim.name, drug_claim.original_data_source_url
                    %div(class="item-corner")
                      %ul(class="attribute-list")
                        %li
                          %strong
                            Version:
                          =drug_claim.source.source_db_version
                  %div(class="item-content")
                    %div{class: "cell category", style: "float: right; width: 50%"}
                      %div{class: "item-panel", style: "width: 100%;"}
                        %h4
                          Alternate Names:
                        %div{style: "height: 461px; overflow-y: scroll; margin-bottom: 5px;"}
                          %table{class: "table table-condensed table-striped", id: "table_aliases"}
                            %tbody
                              -drug_claim.drug_claim_aliases.each do |alt_name| ######
                                %tr
                                  %td
                                    =alt_name.alias
                                  %td{style: "text-align: right;"}
                                    =alt_name.nomenclature
                    %div{class: "cell category", style: "float: left; width: 50%" }
                      %div{class: "item-panel", style: "margin-bottom: 11px;"}
                        %h4
                          Drug Info:
                        %div{style: "height: 200px; overflow-y: scroll; margin-bottom: 5px;"}  
                          %table{class: "table table-condensed table-striped", id:"table_info"}
                            %tbody
                              -drug_claim.drug_claim_attributes.each do |attribute| #######
                                %tr
                                  %td=attribute.name
                                  %td=attribute.value
                      %div{class: "item-panel"}
                        %h4
                          Publications:
                        %div{style: "height: 200px; overflow-y: scroll; margin-bottom: 5px;"}
                          %table{class: "table table-condensed table-striped", id:"table_publications"}
                            -drug_claim.publications.each do |publication| ########
                              %tr
                                %td
                                  %a{href: PMID.pubmed_url(publication.pmid)}
                                    = publication.citation