Improve admin UI
Some checks failed
CI / scan_ruby (push) Failing after 21s
CI / scan_js (push) Successful in 14s
CI / lint (push) Successful in 14s
CI / test (push) Failing after 32s

This commit is contained in:
sto
2025-11-22 09:06:10 +01:00
parent ae3c7c73e1
commit d59090cded

View File

@@ -1,29 +1,36 @@
.row
.d-flex.flex-row.justify-content-start.align-items-center
a.btn.btn-primary href=new_user_path
| New user
= button_to "Update contestants", "/update_contestants", method: :post, class: "ms-3 btn btn-success"
= button_to "Regenerate QR codes", "/regenerate_qrcodes", method: :post, class: "ms-3 btn btn-success"
- @users.each do |user|
- if user.admin
h3.mt-5 = "#{user.username} (admin)"
- else
h3.mt-5 = user.username
table.table.table-striped.table-hover table.table.table-striped.table-hover
thead thead
tr tr
th scope="col" th scope="col"
| Id | ID
th scope="col" th scope="col"
| Name | Friendly ID
th scope="col" th scope="col"
| Admin? | # Puzzles
th scope="col" th scope="col"
| # contests | # Participants
tbody tbody
- @users.each do |user| - user.contests.each do |contest|
tr scope="row" tr scope="row"
td td
= user.id = contest.id
td td
= user.username = contest.friendly_id
td td
= user.admin ? "Yes" : "No" = contest.puzzles.length
td td
= user.contests.length = contest.contestants.length
.row
.col
a.btn.btn-primary href=new_user_path
| New user
= button_to "Update contestants", "/update_contestants", method: :post, class: "mt-3 btn btn-success"
= button_to "Regenerate QR codes", "/regenerate_qrcodes", method: :post, class: "mt-3 btn btn-success"