Skip to content

Commit

Permalink
Add judge result generate button into judge UI
Browse files Browse the repository at this point in the history
Resolves: #425

Signed-off-by: Kostiantyn Kostiuk <[email protected]>
  • Loading branch information
kostyanf14 committed Nov 18, 2023
1 parent 6a401fb commit 5402516
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/judges_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ def users_csv
send_data UsersList.new(contest, params[:separator]).build_csv, filename: 'users-list.csv'
end

def judge_xlsx
send_file Spreadsheet::Judge.new(contest).build
end

def destroy
session.clear
redirect_to :root
Expand Down
4 changes: 4 additions & 0 deletions app/views/results/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<h3>Результати олімпіади</h3>

<% if judge? %>
<p><%= link_to 'Таблиця результатів для журі', [:judge_xlsx, contest, :judge] %></p>
<% end %>

<% if contest.preliminary_results.attached? %>
<h4><%= link_to 'Попередні результати', contest.preliminary_results %></h4>
<% end %>
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

resource :judge, only: %i[show destroy] do
get :users_csv
get :judge_xlsx
end
end

Expand Down

0 comments on commit 5402516

Please sign in to comment.