Add (admin-only) tickets via 'visibile' attribute [migration]

(cherry picked from commit ce0db3d7a736e7bcde480721986dbfb4a82aa083)
This commit is contained in:
James Mason 2018-04-09 11:53:31 -07:00 committed by Henne Vogelsang
parent 6e276b2787
commit 199bc00c08
No known key found for this signature in database
GPG key ID: 97DDB66BDAF8D4D6
15 changed files with 73 additions and 9 deletions

View file

@ -1,3 +1,4 @@
<<<<<<< HEAD
= form_for(@ticket, url: (@ticket.new_record? ? admin_conference_tickets_path : admin_conference_ticket_path(@conference.short_title, @ticket))) do |f|
.form-group
= f.label :title
@ -21,5 +22,8 @@
%label
= f.check_box :registration_ticket
A registration ticket is with which user register for the conference.
%label
= f.check_box :visible
Only visible tickets are available to registrants. Non-visible tickets can only be managed by Admins.
%p.text-right
= f.submit nil, class: 'btn btn-primary'

View file

@ -16,6 +16,7 @@
%th Sold
%th Turnover
%th Registration Ticket
%th Visible?
%th Actions
%tbody
- @conference.tickets.each do |ticket|
@ -31,6 +32,8 @@
= humanized_money_with_symbol ticket.tickets_turnover_total(ticket.id)
%td
= ticket.registration_ticket? ? 'Yes' : 'No'
%td
= ticket.visible? ? 'Yes' : 'No'
%td
.btn-group
= link_to 'Edit', edit_admin_conference_ticket_path(@conference.short_title, ticket.id),

View file

@ -74,7 +74,7 @@
= link_to event.title, conference_program_proposal_path(@conference.short_title, event.id)
= '(' + registered_text(event) + ')'
- if @conference.tickets.any?
- if @conference.tickets.visible.any?
.row
.col-md-12
%h4

View file

@ -19,8 +19,8 @@
%th Price
%th Total
%tbody
- @conference.tickets.each do |ticket|
= render 'ticket', f: f, ticket: ticket
- @conference.tickets.visible.each do |ticket|
= render partial: 'ticket', f: f, locals: {ticket: ticket}
%tr
%td
- if @conference.tickets.for_registration.any?