Add contest badges
This commit is contained in:
parent
4b3bc58474
commit
eca2e46d23
@ -8,6 +8,7 @@ class ContestsController < ApplicationController
|
||||
|
||||
def show
|
||||
@title = @contest.name
|
||||
set_badges
|
||||
end
|
||||
|
||||
def edit
|
||||
@ -42,6 +43,12 @@ class ContestsController < ApplicationController
|
||||
|
||||
private
|
||||
|
||||
def set_badges
|
||||
@badges = []
|
||||
@badges.push("team") if @contest.team
|
||||
@badges.push("registration") if @contest.allow_registration
|
||||
end
|
||||
|
||||
def set_contest
|
||||
@contest = Contest.find(params[:id])
|
||||
end
|
||||
|
@ -1,2 +1,10 @@
|
||||
a.btn.btn-primary href=edit_contest_path(@contest)
|
||||
| Edit
|
||||
.row.mb-4
|
||||
.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
|
Loading…
x
Reference in New Issue
Block a user