Skip to content

Commit

Permalink
Changes behavior for Collection tabs.
Browse files Browse the repository at this point in the history
  • Loading branch information
bwatson78 committed Jun 14, 2022
1 parent ec9122c commit eb6e04e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 38 deletions.
1 change: 0 additions & 1 deletion app/assets/javascripts/hyrax.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
//= require hyrax/nav_safety
//= require hyrax/analytics_events
//= require hyrax/select_submit
//= require hyrax/tabs
//= require hyrax/user_search
//= require hyrax/proxy_rights
//= require hyrax/sorting
Expand Down
32 changes: 0 additions & 32 deletions app/assets/javascripts/hyrax/tabs.js

This file was deleted.

15 changes: 11 additions & 4 deletions app/views/hyrax/my/collections/_tabs.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<% current_page_dashboard = current_page?(hyrax.dashboard_collections_path(locale: nil)) %>
<ul class="nav nav-tabs" id="my_nav" role="navigation">
<li<%= ' class="nav-item"'.html_safe if current_page?(hyrax.dashboard_collections_path(locale: nil)) %>>
<%= link_to t("hyrax.dashboard.#{current_ability.admin? ? 'all' : 'managed'}.collections"), hyrax.dashboard_collections_path, class: "nav-link" %>
<li<%= ' class="nav-item"'.html_safe if current_page_dashboard %>>
<%= link_to(
t("hyrax.dashboard.#{current_ability.admin? ? 'all' : 'managed'}.collections"),
hyrax.dashboard_collections_path,
class: "nav-link#{' active' if current_page_dashboard}") %>
</li>
<li<%= ' class="nav-item"'.html_safe if current_page?(hyrax.my_collections_path(locale: nil)) %>>
<%= link_to t('hyrax.dashboard.my.your_collections'), hyrax.my_collections_path, class: "nav-link active" %>
<li<%= ' class="nav-item"'.html_safe if !current_page_dashboard %>>
<%= link_to(
t('hyrax.dashboard.my.your_collections'),
hyrax.my_collections_path,
class: "nav-link#{' active' if !current_page_dashboard}") %>
</li>
</ul>
2 changes: 1 addition & 1 deletion spec/features/collection_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
end

# forwards to Dashboard -> Collections -> All Collections
within('li.active') do
within('.nav-tabs li.nav-item') do
expect(page).to have_link('All Collections')
end

Expand Down

0 comments on commit eb6e04e

Please sign in to comment.