publiclab/plots2

View on GitHub
app/views/notes/index.html.erb

Summary

Maintainability
Test Coverage
<div class="col-lg-9">
  <% if params[:controller] == "search" %>
  <h3><%= raw translation('notes.index.search_results_for', :params => params[:id]) %> <small>(<a href="/search/advanced/<%= params[:id] %>"><%= translation('notes.index.advanced_search') %></a>)</h3>

  <% elsif params[:controller] == "tag" %>
  <h3><%= raw translation('notes.index.notes_tagged_with', :params => params[:id]) %></h3>
  <% elsif params[:action] == "popular" %>
  <h2><%= translation('notes.index.popular_research_notes') %></h2>
  <% elsif params[:action] == "recent" %>
  <h2><%= translation('notes.index.recent_research_notes') %></h2>
  <% elsif params[:action] == "author_topic" %>
  <h3><%= raw translation('notes.index.research_on', :tags => @tagnames.join(', '), :url1 => "/people/"+@user.name, :user_name => @user.name) %> <br /><small><%= raw translation('notes.index.research_notes_and_wiki_edits_with_time', :count => @user.nodes.count, :time => time_ago_in_words(@user.created_at)) %></small></h3>
  <% elsif params[:action] == "author" %>
  <h3><%= raw translation('notes.index.research_by', :url1 => "/people/"+@user.name, :user_name => @user.name) %> <small><%= raw translation('notes.index.research_notes_and_wiki_edits', :count1 => @user.note_count, :word1 => 'note'.pluralize(@user.note_count), :count2 => @user.revisions.count, :word2 => 'edit'.pluralize(@user.revisions.count)) %> <% if @user.notes.size > 0 %><%= raw translation('notes.index.starting_time', :time => time_ago_in_words(@user.created_at)) %><% end %></small></h3>
  <% else %>
  <h2><%= raw translation('notes.index.research_notes_ideas_and_documentation') %></h2>
  <% end %>
  <br />
  <% if params[:action] == "liked" %><a style="margin-right:9px; margin-top: -33px;" class="float-right btn btn-outline-secondary btn-sm" href="/feed/liked.rss"><i class="fa fa-rss"></i></a><% end %>

  <% if params[:action] == "author" %>
  <%= render :partial => "notes/nav_tabs" %>
  <% else %>
  <%= render :partial => "notes/nav_links" %>
  <% end %>

  <%= render :partial => "notes/sidebar" %>
  <br />

  <%= render :partial => "notes/notes" %>
  <hr />
</div>

<!-- Galaxy Fold Responsive Styling  -->
<style>
  @media (max-width: 280px) {
    .notes-pills {
      display: inline !important;
    }
  }
</style>