Allow admin to show/generate ticket
Created physical ticket controller and views for admin.
This commit is contained in:
parent
f37d3095e1
commit
3d4adb5683
4 changed files with 59 additions and 5 deletions
43
app/views/admin/physical_ticket/index.html.haml
Normal file
43
app/views/admin/physical_ticket/index.html.haml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
.container
|
||||
.row
|
||||
.col-md-12.page-header
|
||||
%h2
|
||||
Tickets Sold
|
||||
.text-muted
|
||||
Tickets sold for the conference
|
||||
.row
|
||||
.col-md-4
|
||||
= render partial: 'admin/conferences/doughnut_chart',
|
||||
locals: { title: 'Tickets sold', data: @tickets_sold_distribution }
|
||||
.col-md-4
|
||||
= render partial: 'admin/conferences/doughnut_chart',
|
||||
locals: {title: 'Tickets turnover', data: @tickets_turnover_distribution}
|
||||
%br
|
||||
- if @physical_tickets.any?
|
||||
.row
|
||||
.col-md-12
|
||||
%table.table.table-hover.datatable#tickets
|
||||
%thead
|
||||
%th ID
|
||||
%th Type
|
||||
%th User
|
||||
%th Actions
|
||||
%tbody
|
||||
- @physical_tickets.each do |physical_ticket|
|
||||
%tr
|
||||
%td= physical_ticket.id
|
||||
%td= physical_ticket.ticket.title
|
||||
%td= physical_ticket.user.email
|
||||
%td
|
||||
.btn-group
|
||||
= link_to 'Show',
|
||||
conference_physical_ticket_path(@conference.short_title,
|
||||
physical_ticket.id),
|
||||
class: 'btn btn-primary'
|
||||
= link_to 'Generate PDF',
|
||||
conference_physical_ticket_path(@conference.short_title,
|
||||
physical_ticket.id,
|
||||
format: :pdf),
|
||||
class: 'button btn btn-default btn-info'
|
||||
- else
|
||||
%h5 No Tickets sold!
|
||||
|
|
@ -4,11 +4,6 @@
|
|||
%h1 Tickets
|
||||
%p.text-muted
|
||||
Tickets to get during registration
|
||||
.row
|
||||
.col-md-4
|
||||
= render partial: 'admin/conferences/doughnut_chart', locals: { title: 'Tickets sold', data: @tickets_sold_distribution,}
|
||||
.col-md-4
|
||||
= render partial: 'admin/conferences/doughnut_chart', locals: { title: 'Tickets turnover', data: @tickets_turnover_distribution }
|
||||
%br
|
||||
- if @conference.tickets.any?
|
||||
.row
|
||||
|
|
@ -42,3 +37,4 @@
|
|||
.row
|
||||
.col-md-12
|
||||
= link_to 'Add Ticket', new_admin_conference_ticket_path, class: 'btn btn-success pull-right'
|
||||
= link_to 'Tickets Sold', admin_conference_physical_ticket_index_path, class: 'button btn btn-default btn-info pull-right'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue