forked from otwcode/otwarchive
/
index.html.erb
executable file
·79 lines (65 loc) · 2.98 KB
/
index.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!--Descriptive page name and system messages, descriptions, and instructions.-->
<!--NOTE FOR BACK END: set this in the controller and just send a @page_heading variable or something to the view-->
<h2 class="heading"><%= search_header @works, @query, "Work" %>
<% if @collection %>
<%= ts("in %{collection_title}", :collection_title => link_to(@collection.title, @collection)).html_safe %>
<% elsif @user %>
<%= @author ? ts("by %{author_byline}", :author_byline => @author.byline) : ts("by %{user_name}", :user_name => @user.login) %>
<% elsif @tag %>
<%= ts("in %{tag_name}", :tag_name => @tag.name) %>
<% end %>
</h2>
<% if @tag && (%w(Fandom Character Relationship).include?(@tag.type.to_s) || @tag.name == "F/F") %>
<p><%= link_to_rss feed_tag_path(:id => @tag.id, :format => :atom) %></p>
<% end %>
<% if @too_many %>
<p><%= ts("The Archive is currently unable to return more than %{search_max} results. You can browse through the ones that we found first, or narrow your results by adding some more keywords, like character names or tags.", :search_max => ArchiveConfig.SEARCH_RESULTS_MAX) %></p>
<% end %>
<!-- /end descriptions-->
<div class="navigation actions module">
<!--Subnavigation, sorting and actions.-->
<h3 class="landmark heading">Navigation, Sorting and Actions</h3>
<!--gift search subnav-->
<% if @collection && @collection.gift_exchange? %>
<%= render :partial => 'gifts/gift_search' %>
<% end %>
<!--user role subnav-->
<% if params[:tag_id] || (@user && @user == current_user) %>
<ul class="user navigation actions" role="navigation">
<% if @user && @user == current_user %>
<li id="edit_multiple"><%= link_to ts('Edit Works'), show_multiple_user_works_path(@user) %></li>
<% end %>
<% if params[:tag_id] %>
<%= taggable_list(params[:tag_id], "works") %>
<% end %>
</ul>
<% end %>
<!--sorting subnav-->
<ul class="sorting actions" role="menu">
<li><h4 class="heading"><%= ts('Sort By') %></h4></li>
<% unless @query.blank? %>
<li><%= sort_link ts('Relevance') %></li>
<% end %>
<li><%= sort_link ts('Author'), :author %></li>
<li><%= sort_link ts('Title'), :title %></li>
<li><%= sort_link ts('Date Updated'), :date, {:sort_default => @query.blank?, :desc_default => true} %></li>
<li><%= sort_link ts('Date Added'), :created_at, {:desc_default => true} %></li>
<li><%= sort_link ts('Word Count'), :word_count, {:desc_default => true} %></li>
<% unless logged_in? && current_user.preference.try(:hide_all_hit_counts) %>
<li><%= sort_link ts('Hits'), :hit_count, {:desc_default => true} %></li>
<% end %>
</ul>
</div>
<!---/subnav-->
<!--main content-->
<h3 class="landmark heading">Listing Works</h3>
<ol class="work index group">
<% for work in @works %>
<% if work %><%= render 'work_blurb', :work => work %><% end %>
<% end %>
</ol>
<!--/content-->
<!--filters subnav-->
<%= render :partial => 'filters' %>
<!---/subnav-->
<%= will_paginate @works %>