Merge settings & core indexes into a single nav

This commit is contained in:
sto
2025-11-13 18:21:31 +01:00
parent 97ea17b7c2
commit cdf87e48f2
18 changed files with 32 additions and 116 deletions

View File

@@ -6,7 +6,6 @@ class ContestantsController < ApplicationController
def index
authorize @contest
@title = @contest.name
@contestants = @contest.contestants.sort_by { |contestant| [
-contestant.completions.where(remaining_pieces: nil).size,
(contestant.completions.where(remaining_pieces: nil).size == @contest.puzzles.length ? 1 : 0) * contestant.time_seconds,
@@ -18,17 +17,11 @@ class ContestantsController < ApplicationController
def edit
authorize @contest
@action_name = t("helpers.buttons.back")
@action_path = contest_path(@contest)
@title = @contestant.name
end
def new
authorize @contest
@action_name = t("helpers.buttons.back")
@action_path = contest_path(@contest)
@contestant = Contestant.new
end
@@ -41,8 +34,6 @@ class ContestantsController < ApplicationController
update_contestant_categories
redirect_to contest_path(@contest), notice: t("contestants.new.notice")
else
@action_name = t("helpers.buttons.back")
@action_path = contest_path(@contest)
render :new, status: :unprocessable_entity
end
end
@@ -54,8 +45,6 @@ class ContestantsController < ApplicationController
update_contestant_categories
redirect_to @contest, notice: t("contestants.edit.notice")
else
@action_name = t("helpers.buttons.back")
@action_path = contest_path(@contest)
render :edit, status: :unprocessable_entity
end
end
@@ -83,8 +72,6 @@ class ContestantsController < ApplicationController
if @csv_import.save
redirect_to "/contests/#{@contest.id}/import/#{@csv_import.id}"
else
@action_name = t("helpers.buttons.back")
@action_path = contest_path(@contest)
render :import, status: :unprocessable_entity
end
end
@@ -92,8 +79,6 @@ class ContestantsController < ApplicationController
def convert_csv
authorize @contest
@action_name = t("helpers.buttons.back")
@action_path = contest_path(@contest)
@csv_import = CsvImport.find(params[:id])
@content = JSON.parse(@csv_import.content)
@form = Forms::CsvConversionForm.new
@@ -119,8 +104,6 @@ class ContestantsController < ApplicationController
end
redirect_to contest_path(@contest), notice: t("contestants.import.notice")
else
@action_name = t("helpers.buttons.back")
@action_path = contest_path(@contest)
render :convert_csv, status: :unprocessable_entity
end
end