forked from otwcode/otwarchive
/
_header.html.erb
42 lines (36 loc) · 2.16 KB
/
_header.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
<!--Descriptive page name, messages and instructions-->
<div class="primary header module">
<h2 class="heading"><%= link_to_unless_current(@collection.title, @collection) %></h2>
<div class="icon">
<%= image_tag(@collection.icon.url(:standard), :size => "100x100", :alt => collection.icon_alt_text) %>
</div>
<!--/descriptions-->
<!--subnav-->
<ul class="navigation actions" role="menu">
<li><%= span_if_current ts("Profile"), collection_profile_path(@collection) %></li>
<% if logged_in? && !@collection.closed? && @collection.challenge_type != "PromptMeme" %>
<li><%= link_to ts("Post To Collection"), new_collection_work_path(@collection) %></li>
<% end %>
<% if @collection.challenge # add custom navigation for the specific challenge if there is one %>
<%= render "challenge/#{challenge_class_name(@collection)}/challenge_navigation_user" %>
<% end %>
<% unless @collection.user_is_owner?(current_user) %>
<% if (@participant ||= @collection.get_participants_for_user(current_user).first) %>
<li><%= link_to ts("Leave"), collection_participant_path(@collection, @participant),
:confirm => ts('Are you certain you want to leave this collection?'),
:method => :delete %></li>
<% elsif logged_in? && @collection.moderated? %>
<li><%= link_to ts("Join"), join_collection_participants_path(@collection) %></li>
<% end %>
<% end %>
<% if @collection.user_is_maintainer?(current_user) %>
<li><%= link_to ts("Membership"), collection_participants_path(@collection) %></li>
<li><%= link_to ts("Manage Items"), collection_items_path(@collection) %></li>
<% end %>
</ul>
<!--/subnav-->
<blockquote class="userstuff"><%=raw sanitize_field(@collection, :description) %></blockquote>
<p class="type">
(<%= collection.closed? ? ts("Closed") : ts("Open") %>, <%= collection.moderated? ? ts("Moderated") : ts("Unmoderated") %><%= collection.unrevealed? ? ts(", Unrevealed") : "" %><%= collection.anonymous? ? ts(", Anonymous") : "" %><%= collection.gift_exchange? ? ts(", Gift Exchange Challenge") : "" %><%= collection.prompt_meme? ? ts(", Prompt Meme Challenge") : "" %>)
</p>
</div>