Skip to content

Commit

Permalink
QR Code now uses show permission for tournament. (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
plural authored Feb 17, 2025
1 parent ce1b887 commit 9867cd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/controllers/tournaments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def not_found
end

def qr
authorize @tournament, :edit?
authorize @tournament, :show?
end

def close_registration
Expand Down
17 changes: 8 additions & 9 deletions app/views/tournaments/_overview_card.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
.small.text-secondary Players:
=> pluralize(@players.count, 'active player')
| (#{@dropped.count} dropped)
- if policy(@tournament).edit?
li.list-group-item
.small.text-secondary
| QR Code:
.row
.col-sm-6
= link_to qr_tournament_path(@tournament), :target => '_blank' do
=> fa_icon 'qrcode'
| Open Printable QR Code
li.list-group-item
.small.text-secondary
| QR Code:
.row
.col-sm-6
= link_to qr_tournament_path(@tournament), :target => '_blank' do
=> fa_icon 'qrcode'
| Open Printable QR Code

0 comments on commit 9867cd3

Please sign in to comment.