diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index 0798be3..72c28be 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -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 diff --git a/app/views/contests/show.html.slim b/app/views/contests/show.html.slim index 7b403b1..d6cf88f 100644 --- a/app/views/contests/show.html.slim +++ b/app/views/contests/show.html.slim @@ -1,2 +1,10 @@ -a.btn.btn-primary href=edit_contest_path(@contest) - | Edit \ No newline at end of file +.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 \ No newline at end of file