Add contest badges
This commit is contained in:
parent
4b3bc58474
commit
eca2e46d23
@ -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
|
||||||
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user