Skip to content

Commit

Permalink
List endorsed for curators
Browse files Browse the repository at this point in the history
  • Loading branch information
lmrodriguezr committed Aug 8, 2023
1 parent 4ac1a83 commit 79b5058
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
21 changes: 12 additions & 9 deletions app/controllers/names_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class NamesController < ApplicationController
before_action(
:authenticate_curator!,
only: %i[
check_ranks unknown_proposal submitted drafts return validate endorse
check_ranks unknown_proposal submitted endorsed drafts
return validate endorse
]
)

Expand All @@ -44,17 +45,11 @@ def autocomplete
def index(opts = {})
return user_names if params[:status] == 'user' && opts == {}
@submitted ||= false
@endorsed ||= false
@drafts ||= false
@sort ||= params[:sort] || 'date'
@status ||= params[:status] || 'public'
@title ||=
if @submitted
'Review Submitted'
elsif @drafts
'Review Drafts'
else
"#{@status.gsub(/^\S/, &:upcase)} Names"
end
@title ||= "#{@status.gsub(/^\S/, &:upcase)} Names"

opts[:status] ||=
case @status
Expand Down Expand Up @@ -123,6 +118,14 @@ def submitted
render(:index)
end

# GET /endorsed
def endorsed
@endorsed = true
@status = 'endorsed'
index(status: 12)
render(:index)
end

# GET /drafts
def drafts
@drafts = true
Expand Down
3 changes: 2 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
get 'check_ranks' => 'names#check_ranks', as: :check_ranks
get 'unknown_proposal' => 'names#unknown_proposal', as: :unknown_proposal
get 'submitted' => 'names#submitted', as: :submitted_names
get 'drafts' => 'names#drafts', as: :draft_names
get 'endorsed' => 'names#endorsed', as: :endorsed_names
get 'drafts' => 'names#drafts', as: :draft_names
get 'user-names' => 'names#user_names', as: :user_names
get 'search' => 'application#search', as: :search
get 'type-genomes(.:format)' => 'names#type_genomes', as: :name_type_genomes
Expand Down

0 comments on commit 79b5058

Please sign in to comment.