Add contest badges

This commit is contained in:
sto 2025-03-15 13:36:02 +01:00
parent 4b3bc58474
commit eca2e46d23
2 changed files with 17 additions and 2 deletions

View File

@ -8,6 +8,7 @@ class ContestsController < ApplicationController
def show def show
@title = @contest.name @title = @contest.name
set_badges
end end
def edit def edit
@ -42,6 +43,12 @@ class ContestsController < ApplicationController
private private
def set_badges
@badges = []
@badges.push("team") if @contest.team
@badges.push("registration") if @contest.allow_registration
end
def set_contest def set_contest
@contest = Contest.find(params[:id]) @contest = Contest.find(params[:id])
end end

View File

@ -1,2 +1,10 @@
a.btn.btn-primary href=edit_contest_path(@contest) .row.mb-4
| Edit .col
- @badges.each do |badge|
span.badge.text-bg-info.me-2
= badge
.row
.col
a.btn.btn-primary href=edit_contest_path(@contest)
| Edit