Skip to content

Commit

Permalink
#531: Detailed search is now shown for all users
Browse files Browse the repository at this point in the history
  • Loading branch information
pschijven committed Oct 11, 2023
1 parent 045b089 commit 37eacbf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
3 changes: 0 additions & 3 deletions app/models/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ def initialize(user = nil)
can :read, :help
can :read, :version

# Search Results
can :show, :detailed_search

if user # Every logged in user ...
can :use, :dashboard
can :destroy, UserSession
Expand Down
24 changes: 10 additions & 14 deletions app/views/search_results/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@
<div class="col">
<%= render "search_results/sections/languages" %>
</div>
<% if can?(:show, :detailed_search) %>
<div class="col-auto">
<button class="btn btn-outline-secondary collapse-toggle" data-toggle="collapse" data-target="#detailedSearch" type="button" aria-expanded="false" aria-controls="detailedSearch">
<span class="mr-2"><%= t('txt.views.search_results.detailed_search') %></span>
<i class="hide-if-expanded fa fa-chevron-down"></i>
<i class="hide-if-collapsed fa fa-chevron-up"></i>
</button>
</div>
<% end %>
</div>
<% if can?(:show, :detailed_search) %>
<div id="detailedSearch" class="collapse">
<%= render 'detailed_search' %>
<div class="col-auto">
<button class="btn btn-outline-secondary collapse-toggle" data-toggle="collapse" data-target="#detailedSearch" type="button" aria-expanded="false" aria-controls="detailedSearch">
<span class="mr-2"><%= t('txt.views.search_results.detailed_search') %></span>
<i class="hide-if-expanded fa fa-chevron-down"></i>
<i class="hide-if-collapsed fa fa-chevron-up"></i>
</button>
</div>
<% end %>
</div>
<div id="detailedSearch" class="collapse">
<%= render 'detailed_search' %>
</div>
<% end %>

0 comments on commit 37eacbf

Please sign in to comment.