publiclab/spectral-workbench

View on GitHub
app/views/users/dashboard.html.erb

Summary

Maintainability
Test Coverage
<div class="container">
  <% if logged_in? && !flash[:notice] && !flash[:error] && !flash[:warning] && !mobile? %>
    <% spectrum_count = current_user.spectrum_count %>
    <% if spectrum_count < 3 %>
    <% elsif spectrum_count >= 3 %>
    <% end %>
  <% end %>

  <div class="row-fluid">

    <div class="span4">
      <div class="hidden-phone">
        <h2>Dashboard</h2>
        <hr />
      </div>

      <%= render :partial => 'spectrums/search' %>

      <div class="hidden-phone">

        <p><strong>Subscribe to the "plots-spectrometry" mailing list</strong> for support, discussion, and to share your work:</p>
        <form class="form form-inline" action="https://groups.google.com/group/plots-spectrometry/boxsubscribe"><input placeholder="you@email.com" class="input-medium" type=text name=email /> <input class="btn btn-primary" type=submit name="sub" value="Subscribe" /></form>

        <hr />

        <p><a href="https://publiclab.org/questions/tag/question:spectral-workbench">Read through the FAQ</a> to find answers to your questions, or:</p>
        
        <p><a href="https://publiclab.org/post?tags=question:spectral-workbench&template=question" class="btn btn-primary"><i class="fa fa-question-circle fa-white"></i> Post a question</a> &nbsp;to get help from other users.</p>

        <p><a href="https://publiclab.org/subscribe/tag/question:spectral-workbench" class="btn btn-primary">Follow</a> &nbsp;questions from other community members or <a href="https://publiclab.org/tag/question:spectral-workbench">browse questions here</a>.</p>
  
        <iframe style="margin-top:10px;border:none;width:100%;height:180px;" src="https://publiclab.org/features/embed/spectral-workbench-sidebar"></iframe>

        <ul class="nav nav-list">
          <li class="nav-header">Support</li>
          <li><a href="http://publiclab.org/wiki/spectral-workbench-help">Troubleshooting/Help</a></li>
          <li><a href="http://publiclab.org/wiki/spectral-workbench-usage">Using Spectral Workbench</a></li>
          <li class="nav-header">Research</li>
          <li><a href="http://publiclab.org/wiki/spectrometry">Ongoing open source research</a></li>
          <li><a href="https://publiclab.org/wiki/spectrometry#Frequently+Asked+Questions">Questions</a></li>
          <li><a href="http://publiclab.org/wiki/spectrometry#Activities">Activities</a></li>
          <li><a href="http://publiclab.org/wiki/spectrometry#Upgrades">Things to build</a></li>
          <li><a href="http://publiclab.org/wiki/spectrometer-curriculum">Theory and background</a></li>
        </ul>

      </div>


    </div>

    <div class="span8 pull-right">

      <%= render :partial => 'users/wizard' %>

      <!--<div class="alert">Learn more about the new <a href="https://publiclab.org/notes/warren/02-10-2016/announcing-spectral-workbench-2">Spectral Workbench 2</a>.</div>-->

      <% if Rails.env == "production" %>
        <div class="hidden-phone">
          <h3>Recent community research <small>| <a href="https://publiclab.org/tag/spectrometer">More</a> | <a href="http://publiclab.org/post">Share your own work &raquo;</a></small></h3>
 
          <%= render :partial => 'users/research_notes' %>
 
        </div>
      <% end %>

      <ul class="nav nav-tabs">
        <li class="active"><a data-toggle="tab" href="#spectra"><i class="fa fa-signal"></i><span class="hidden-phone"> Spectra</span></a></li>
        <li><a data-toggle="tab" href="#comments"><i class="fa fa-comment"></i><span class="hidden-phone"> Comments</span></a></li>
        <li><a data-toggle="tab" href="#sets"><i class="fa fa-list"></i><span class="hidden-phone"> Sets</span></a></li>
        <li><a data-toggle="tab" href="#authors"><i class="fa fa-user"></i><span class="hidden-phone"> Authors</span></a></li>
        <li><a data-toggle="tab" href="#tags"><i class="fa fa-tag"></i><span class="hidden-phone"> Tags</span></a></li>
      </ul>

      <div class="tab-content">

        <div class="tab-pane active" id="spectra">
          <h3 style="padding-top:0;">
            <a name="spectra"></a>Recent spectra
            <small class="hidden-phone">
              by contributors like you |
              <a href="/profile/<%= current_user.login %>">Your spectra</a> |
              <a href="/popular">Popular</a> |
              <a href="/popular/recent">Recently liked</a>
          </small></h3>
          <%= render :partial => 'spectrums/list', locals: { spectrums: @spectrums } %>
          <hr style="clear:both;" />
          <%= will_paginate @spectrums, :param_name => 'page', :params => {:anchor => "spectrums"}, renderer: BootstrapPagination::Rails %>
        </div>

        <div class="tab-pane" id="comments">
        <h3><a name="authors"></a>Recent comments</h3>
          <%= render :partial => 'comments/table', :locals => { :comments => @comments }%>
          <hr style="clear:both;" />
          <%= will_paginate @comments, :param_name => 'comments_page', :params => {:anchor => "comments"}, renderer: BootstrapPagination::Rails %>
        </div>

        <div class="tab-pane" id="sets">
          <h3><a name="sets"></a>Recent sets <small class="hidden-phone">by contributors like you</small></h3>
          <%= render :partial => 'spectrums/sets', :locals => {:row => 2} %>
          <hr style="clear:both;" />
          <%= will_paginate @sets, :param_name => 'sets_page', :params => {:anchor => "sets"}, renderer: BootstrapPagination::Rails %>
        </div>

        <div class="tab-pane" id="authors">
          <h3><a name="authors"></a>Recent authors</h3>
           <%= render :partial => 'users/list', :locals => {:row => 2} %>
          <hr style="clear:both;" />
          <%= will_paginate @users, :param_name => 'users_page', :params => {:anchor => "users"}, renderer: BootstrapPagination::Rails %>
        </div>

        <div class="tab-pane" id="tags">
          <h3><a name="tags"></a>Recent tags</h3>
          <%= render :partial => 'tags/list', :locals => {:row => 2} %>
          <hr style="clear:both;" />
          <%= will_paginate @sets, :param_name => 'tags_page', :params => {:anchor => "tags"}, renderer: BootstrapPagination::Rails %>
        </div>

      </div>
    </div>
  </div>
</div>