-
Notifications
You must be signed in to change notification settings - Fork 523
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AO3-6238 Random Items button on a collection doesn't work from the co…
…llection homepage (#4462) * change remote from true to false * address linter comments pt 1 * address linter comments pt 2 * fix UTs by fixing missing translation error * internationalization changes * fixed random link and added UT * commit erb linter autocorrect * fix linter issue * revert mistaken change
- Loading branch information
1 parent
0b05a7e
commit 36ca470
Showing
4 changed files
with
68 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,54 @@ | ||
<div id="dashboard" class="region" role="navigation region"> | ||
<h3 class="landmark heading">Dashboard</h3> | ||
<h3 class="landmark heading"><%= t(".landmark.dashboard") %></h3> | ||
<ul class="navigation actions"> | ||
<li><%= span_if_current ts('Dashboard', key: 'dashboard'), @collection %></li> | ||
<li><%= span_if_current ts('Profile', key: 'dashboard'), collection_profile_path(@collection) %></li> | ||
<li><%= span_if_current t(".dashboard"), @collection %></li> | ||
<li><%= span_if_current t(".profile"), collection_profile_path(@collection) %></li> | ||
<% if !@collection.collection_profile.faq.blank? %> | ||
<li><%= span_if_current ts('FAQ', key: 'dashboard'), collection_profile_path(@collection, :anchor => "faq") %></li> | ||
<li><%= span_if_current t(".faq"), collection_profile_path(@collection, anchor: "faq") %></li> | ||
<% end %> | ||
<% if !@collection.collection_profile.rules.blank? %> | ||
<li><%= span_if_current ts('Rules', key: 'dashboard'), collection_profile_path(@collection, :anchor => "rules") %></li> | ||
<li><%= span_if_current t(".rules"), collection_profile_path(@collection, anchor: "rules") %></li> | ||
<% end %> | ||
|
||
<% if @collection.parent %> | ||
<li><%= link_to ts('Parent Collection', key: 'dashboard'), collection_path(@collection.parent) %></li> | ||
<li><%= link_to t(".parent_collection"), collection_path(@collection.parent) %></li> | ||
<% else %> | ||
<li><%= span_if_current ts("Subcollections (%{count})", key: 'dashboard', :count => @collection.children.count), collection_collections_path(@collection) %></li> | ||
<li><%= span_if_current t(".subcollections", count: @collection.children.count), collection_collections_path(@collection) %></li> | ||
<% end %> | ||
</ul> | ||
|
||
<!-- challenge section of dash --> | ||
<% if @collection.challenge %> | ||
<%= render :partial => "challenge/#{challenge_class_name(@collection)}/challenge_sidebar" %> | ||
<%= render partial: "challenge/#{challenge_class_name(@collection)}/challenge_sidebar" %> | ||
<% end %> | ||
|
||
<h4 class="landmark heading">Contents</h4> | ||
<h4 class="landmark heading"><%= t(".landmark.contents") %></h4> | ||
<ul class="navigation actions"> | ||
<li><%= span_if_current ts("Fandoms (%{count})", key: 'dashboard', count: SearchCounts.fandom_count_for_collection(@collection)), collection_fandoms_path(@collection) %></li> | ||
<li><%= span_if_current t(".fandoms", count: SearchCounts.fandom_count_for_collection(@collection)), collection_fandoms_path(@collection) %></li> | ||
|
||
<li><%= span_if_current ts("Works (%{count})", key: 'dashboard', count: SearchCounts.work_count_for_collection(@collection)), collection_works_path(@collection) %></li> | ||
<li><%= span_if_current t(".works", count: SearchCounts.work_count_for_collection(@collection)), collection_works_path(@collection) %></li> | ||
|
||
<li><%= span_if_current ts("Bookmarked Items (%{count})", key: 'dashboard', count: SearchCounts.bookmarkable_count_for_collection(@collection)), collection_bookmarks_path(@collection) %></li> | ||
<li><%= span_if_current t(".bookmarks", count: SearchCounts.bookmarkable_count_for_collection(@collection)), collection_bookmarks_path(@collection) %></li> | ||
|
||
<li> | ||
<% if controller.controller_name == 'collections' && controller.action_name == 'show' %> | ||
<%= link_to 'Random Items', | ||
:url => collection_path(@collection, :show_random => true), :method => :get, :remote => true %> | ||
<% else %> | ||
<%= link_to 'Random Items', collection_path(@collection, :show_random => true) %> | ||
<% end %> | ||
</li> | ||
<li><%= span_if_current ts('People', key: 'dashboard'), collection_people_path(@collection) %></li> | ||
<li><%= span_if_current ts('Tags', key: 'dashboard'), collection_tags_path(@collection) %></li> | ||
</ul> | ||
<li><%= span_if_current t(".random_items"), collection_path(@collection, show_random: true) %></li> | ||
<li><%= span_if_current t(".people"), collection_people_path(@collection) %></li> | ||
<li><%= span_if_current t(".tags"), collection_tags_path(@collection) %></li> | ||
</ul> | ||
|
||
<% if @collection.user_is_maintainer?(current_user)%> | ||
<h4 class="landmark heading">Choices</h4> | ||
<% if @collection.user_is_maintainer?(current_user) %> | ||
<h4 class="landmark heading"><%= t(".landmark.choices") %></h4> | ||
<ul class="navigation actions"> | ||
<li><%= span_if_current(ts('Manage Items', key: 'dashboard'), collection_items_path(@collection)) %></li> | ||
<li><%= span_if_current(t(".manage_items"), collection_items_path(@collection)) %></li> | ||
<% if @collection.user_is_owner?(current_user) %> | ||
<% if @collection.challenge %> | ||
<% if @collection.prompt_meme? %> | ||
<li><%= span_if_current ts('Challenge Settings', key: 'dashboard'), edit_collection_prompt_meme_path(@collection) %></li> | ||
<li><%= span_if_current t(".challenge_settings"), edit_collection_prompt_meme_path(@collection) %></li> | ||
<% elsif @collection.gift_exchange? %> | ||
<li><%= span_if_current ts('Challenge Settings', key: 'dashboard'), edit_collection_gift_exchange_path(@collection) %></li> | ||
<li><%= span_if_current t(".challenge_settings"), edit_collection_gift_exchange_path(@collection) %></li> | ||
<% end %> | ||
<% end %> | ||
<li><%= span_if_current ts('Collection Settings', key: 'dashboard'), edit_collection_path(@collection) %></li> | ||
<li><%= span_if_current t(".collection_settings"), edit_collection_path(@collection) %></li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters