openSNP/snpr

View on GitHub
app/views/layouts/application.html.erb

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" http-equiv="X-UA-Compatible" content="IE=edge">
    <title>openSNP <% if @title %>| <%= @title %><% end %></title>
    <link rel="shortcut icon" href="/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
    <%= stylesheet_link_tag "application" %>
    <%= javascript_include_tag "application" %>
    <%= csrf_meta_tag %>
  </head>
  <body>
    <%= render "layouts/navbar"%>

    <%if current_user %>
    <div id="help_block" class="container">
    <% if current_user.display_help_header? %>
      <div class ="well row userpage__help-block">
        <%if !current_user.help_one %>
        <div class="col-md-4 text-center" id="help_one">
          <%=link_to "x",{:controller => "users", :action => "remove_help_one", :id => current_user}, :remote => true, id: "remove_help_one",:class => "close" %>
          <a href="/genotypes/new"><span class="glyphicon glyphicon-arrow-up userpage__help-text-icons"></span></a><br/>
          <h3>Upload Your Genotyping File</h3>
          <p>
            <%=link_to("Upload the genotyping raw-data you got","/genotypes/new")%> from <em>23andMe</em>, <em>deCODEme</em> or <em>FamilyTreeDNA</em> to the <em>openSNP</em> database to share it with other personal-genomics customers and scientists from around the world.
          </p>
        </div>
        <%end%>
        <%if !current_user.help_two %>
        <div class="col-md-4 text-center" id="help_two">
          <%=link_to("x",{:controller => "users", :action => "remove_help_two", :id => current_user},:remote => true, id: "remove_help_two", :class => "close")%>
          <a href="/users/"+current_user.id.t_s+"#unentered_variations"><span class="glyphicon glyphicon-heart userpage__help-text-icons"></span></a><br/>
          <h3>Enter Your Variations</h3>
          Let us, and the other <em>openSNP</em> users, know some of your characteristics&mdash;like hair or eye color! Or how about some diseases? <%=link_to("Whatever you feel like sharing!","/users/"+current_user.id.to_s+"#unentered_variations")%>.
        </div>
        <%end%>
        <%if !current_user.help_three %>
        <div class="col-md-4 text-center" id="help_three">
          <%=link_to("x",{:controller => "users", :action => "remove_help_three", :id => current_user},:remote => true, id: "remove_help_three", :class => "close")%>
          <a href="/phenotypes/new"><span class="glyphicon glyphicon-folder-open userpage__help-text-icons"></span></a><br/>
          <h3>Enter a New Phenotype</h3>
          <p>
            Got an idea for a phenotype that has not been asked about yet and that could have genetical roots? <%=link_to("Great, you can add one","/phenotypes/new")%> to the <em>openSNP</em> database.
          </p>
        </div>
        <%end%>
        </div>
      <%end%>
    </div>
    <%end%>
    <noscript>
    <div class="container-fluid warnings_container" id="alert-messages">
        <div class="warning__alert alert alert-danger text-center center-block" data-dismiss="alert">
          <button type="button" class="close" data-dismiss="alert">x</button>
          <strong>It seems like you have JavaScript disabled. This will make some features of openSNP.org, like the drop-down menus, break.</strong>
    </div>
    </noscript>

    <div class="container-fluid warnings_container" id="alert-messages">
      <div id="flash_notice" class="alert alert-success" style="display:none"></div>
      <% if flash[:notice] %>
        <div class="warning__alert alert alert-success text-center center-block" data-dismiss="alert">
          <button type="button" class="close" data-dismiss="alert">x</button>
          <strong><%= flash[:notice].html_safe %></strong>
        </div>
      <% end %>
      <% if flash[:warning] %>
        <div class="warning__alert alert alert-danger text-center center-block" data-dismiss="alert">
          <button type="button" class="close" data-dismiss="alert">x</button>
          <strong><%= flash[:warning].html_safe %></strong>
        </div>
      <% end %>
      <% if flash[:achievement] %>
        <div class="warning__alert alert alert-info text-center center-block" data-dismiss="alert">
          <button type="button" class="close" data-dismiss="alert">x</button>
          <strong><%= flash[:achievement].html_safe %></strong>
        </div>
      <% end %>
    </div>

      <% if ["phenotypes", "picture_phenotypes", "open_humans_profiles"].include? params[:controller] %>
      <div class="container-fluid">
        <div class="row">
          <div class="col-md-2 col-xs-6 col-xs-offset-2 col-md-offset-0">

            <ul class="nav nav-pills nav-stacked phenotype__side-menu">
              <li class="nav-header">User-generated</li>
              <li <% if params[:controller] == "phenotypes" %>class="active"<% end %>>
                <a class="phenotype__side-menu-item" href="/phenotypes">Normal phenotypes</a>
              </li>
              <li <% if params[:controller] == "picture_phenotypes" %>class="active"<% end %>>
                <a class="phenotype__side-menu-item" href="/picture_phenotypes">Picture phenotypes</a>
              </li>
              <li class="nav-header">APIs</li>
              <li <% if params[:controller] == "open_humans_profiles" %>class="active"<% end %>>
                <a class="phenotype__side-menu-item" href="/openhumans">Open Humans</a>
              </li>
            </ul>

          </div>
          <div class="col-md-8 col-xs-12">
            <%= yield %>
          </div>
        </div>
      </div>
      <% else %>
      <%= yield %>
      <% end # of sidebar%>

    <%= render "layouts/footer"%>
  </body>
</html>