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

@@ -41,4 +41,13 @@ javascript:
= t("puzzles.plural").capitalize
li.nav-item
a.nav-link class=active_page(contest_messages_path(@contest)) href=contest_messages_path(@contest)
= t("messages.plural").capitalize
= t("messages.plural").capitalize
li.nav-item
a.nav-link class=active_page("/contests/#{@contest.id}/settings/general") href="/contests/#{@contest.id}/settings/general"
= t("contests.form.general")
li.nav-item
a.nav-link class=active_page("/contests/#{@contest.id}/settings/offline") href="/contests/#{@contest.id}/settings/offline"
= t("contests.form.offline")
li.nav-item
a.nav-link class=active_page("/contests/#{@contest.id}/settings/categories") href="/contests/#{@contest.id}/settings/categories"
= t("contests.form.categories")

View File

@@ -1,7 +1,3 @@
.row
.col
h3 Informations
= form_with model: contestant, url: url, method: method do |form|
.row.mb-3
.col
@@ -15,7 +11,7 @@
= form.label :email
.form-text
= t("activerecord.attributes.contestant.email_description")
- if @contest.categories
- if @contest.categories && method == :patch
.row.mt-4
.col
- @contest.categories.each do |category|

View File

@@ -1,5 +1,3 @@
= render "contest_nav"
.row.mb-4 style="height: calc(100vh - 280px)"
.col.d-flex.flex-column style="height: 100%"
.row.mb-4

View File

@@ -1 +1,2 @@
h5.mb-3 = t("contestants.new.title")
= render "form", contest: @contest, contestant: @contestant, submit_text: t("helpers.buttons.add"), method: :post, url: "/contests/#{@contest.id}/contestants"

View File

@@ -1,12 +0,0 @@
.row
.col
ul.nav.nav-tabs.mb-4
li.nav-item
a.nav-link class=active_page("/contests/#{@contest.id}/settings/general") href="/contests/#{@contest.id}/settings/general"
= t("contests.form.general")
li.nav-item
a.nav-link class=active_page("/contests/#{@contest.id}/settings/offline") href="/contests/#{@contest.id}/settings/offline"
= t("contests.form.offline")
li.nav-item
a.nav-link class=active_page("/contests/#{@contest.id}/settings/categories") href="/contests/#{@contest.id}/settings/categories"
= t("contests.form.categories")

View File

@@ -1,5 +1,3 @@
= render "settings_nav"
= form_with model: Category, url: "/contests/#{@contest.id}/categories" do |form|
- if @contest.categories.size > 0
.row

View File

@@ -1,5 +1,3 @@
= render "settings_nav"
= form_with model: @contest, url: "/contests/#{@contest.id}/settings/general" do |form|
.row.mt-2.mb-3
.col

View File

@@ -1,5 +1,3 @@
= render "settings_nav"
- if @contest.puzzles.length > 1
.row
.col

View File

@@ -44,9 +44,15 @@ html
= msg
h1.mb-4
= @title
- if @action_path
a.ms-4.btn.btn-primary href=@action_path style="margin-top: -6px"
= @action_name
- if @contest
= @contest.name
- if active_page("/public") == "active" && @action_path
a.ms-4.btn.btn-primary href=@action_path style="margin-top: -6px"
= t("helpers.buttons.refresh")
- else
= @title
- if @contest && active_page("/public") != "active"
= render "contest_nav"
= yield

View File

@@ -1,5 +1,3 @@
= render "contest_nav"
.row.mb-4 style="height: calc(100vh - 280px)"
.col.d-flex.flex-column style="height: 100%"

View File

@@ -1,5 +1,3 @@
= render "contest_nav"
.row.mb-4 style="height: calc(100vh - 280px)"
.col.d-flex.flex-column style="height: 100%"