Skip to content

Commit

Permalink
optimize the rating interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh committed Apr 9, 2024
1 parent 45abb9d commit 0e7ba1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions app/controllers/judgements_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# frozen_string_literal: true

# rubocop:disable Metrics/ClassLength
class JudgementsController < ApplicationController
skip_before_action :set_recent_cases, except: [ :index, :destroy ]
skip_before_action :set_recent_books, except: [ :index, :destroy ]
skip_before_action :check_for_announcement, except: [ :index, :destroy ]
before_action :skip_header_links, except: [ :index, :destroy ]
before_action :set_judgement, only: [ :show, :edit, :update, :destroy ]
before_action :set_book

Expand Down Expand Up @@ -136,4 +141,9 @@ def set_judgement
def judgement_params
params.require(:judgement).permit(:user_id, :rating, :query_doc_pair_id, :unrateable, :explanation)
end

def skip_header_links
@skip_header_links = true
end
end
# rubocop:enable Metrics/ClassLength
2 changes: 1 addition & 1 deletion app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto">
<% if @current_user.present? %>
<% if @current_user.present? && !@skip_header_links %>
<li class="nav-item dropdown">

<a class="nav-link dropdown-toggle" href="#" id="dropdownCases" role="button" data-bs-toggle="dropdown">
Expand Down

0 comments on commit 0e7ba1f

Please sign in to comment.