Implement consistent admin interface

* Consistent route/model/controller/view layout
* Get rid of unused photos, speakers, dietchoices, social_events controllers
* Drop unused :public from Rooms and :description from CallForPapers
This commit is contained in:
Henne Vogelsang 2014-11-25 10:47:18 +01:00
parent f6a87331be
commit 28063129c7
133 changed files with 1461 additions and 1461 deletions

View file

@ -1,5 +1,17 @@
= f.input :title
= f.input :description, input_html: { rows: 5, data: { provide: "markdown-editable" } }
= f.input :price
= f.input :price_currency, as: :select, class: 'form-control', collection: ['USD', 'EUR', 'GBP', 'INR', 'CNY'], include_blank: false
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
.row
.col-md-12
.page-header
%h1
- if @ticket.new_record?
New
= @ticket.title
Ticket
.row
.col-md-8
= semantic_form_for(@ticket, :url => (@ticket.new_record? ? admin_conference_tickets_path : admin_conference_ticket_path(@conference.short_title, @ticket))) do |f|
= f.input :title
= f.input :description, input_html: { rows: 5, data: { provide: "markdown-editable" } }
= f.input :price
= f.input :price_currency, as: :select, class: 'form-control', collection: ['USD', 'EUR', 'GBP', 'INR', 'CNY'], include_blank: false
%p.text-right
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -1,6 +0,0 @@
%h1
Edit Ticket
.row
.col-md-8
= semantic_form_for(@ticket, :url => admin_conference_ticket_path(@conference.short_title, @ticket)) do |f|
= render partial: 'form', locals: { f: f }

View file

@ -1,38 +1,35 @@
%h1 Tickets
%p.lead
If you add Tickets to your Conference, people will be redirected after registration to a page where they can purchase tickets.
.row
.col-md-12
.page-header
%h1 Tickets
%p.text-muted
Tickets to purchase during registration
- if @conference.tickets.any?
.row
.col-md-12
%table.table
%table.table.table-hover#tickets
%thead
%th #
%th Title
%th Price
%th Buyer
%th Show
%th Edit
%th Delete
%th Sold
%th Actions
%tbody
- @conference.tickets.each_with_index do |ticket, index|
- @conference.tickets.each do |ticket|
%tr
%td
= index + 1
%td
= ticket.title
= link_to(admin_conference_ticket_path(@conference.short_title, ticket.id)) do
= ticket.title
%td
= humanized_money_with_symbol ticket.price
%td
= ticket.buyers.count
%td
= link_to 'Show', admin_conference_ticket_path(@conference.short_title, ticket.id),
method: :get, class: 'btn btn-success'
%td
= link_to 'Edit', edit_admin_conference_ticket_path(@conference.short_title, ticket.id),
method: :get, class: 'btn btn-primary'
%td
= link_to 'Delete', admin_conference_ticket_path(@conference.short_title, ticket.id),
method: :delete, class: 'btn btn-danger', data: { confirm: "Do you really want to delete the Ticket for #{ticket.title}?" }
= link_to 'Add Ticket', new_admin_conference_ticket_path, class: 'btn btn-success'
.btn-group
= link_to 'Edit', edit_admin_conference_ticket_path(@conference.short_title, ticket.id),
method: :get, class: 'btn btn-primary'
= link_to 'Delete', admin_conference_ticket_path(@conference.short_title, ticket.id),
method: :delete, class: 'btn btn-danger', data: { confirm: "Do you really want to delete the Ticket for #{ticket.title}?" }
.row
.col-md-12
= link_to 'Add Ticket', new_admin_conference_ticket_path, class: 'btn btn-success pull-right'

View file

@ -1,6 +0,0 @@
%h1
New Ticket
.row
.col-md-8
= semantic_form_for(@ticket, :url => admin_conference_tickets_path(@conference.short_title, @ticket)) do |f|
= render partial: 'form', locals: { f: f }

View file

@ -1,33 +1,35 @@
%h1
= @ticket.title
%small
= humanized_money_with_symbol @ticket.price
- if @ticket.description.present?
%p.lead
= markdown(@ticket.description)
.row
.col-md-12
.page-header
%h1
= @ticket.title
Ticket
%small
= humanized_money_with_symbol @ticket.price
%p.text-muted
People who bought this ticket
.row
.col-md-12
%table.table.table-hover.datatable
%thead
%th #
%th Name
%th E-Mail
%th Affiliation
%th Paid
%tbody
- @ticket.buyers.each_with_index do |buyer, index|
%tr
%td
= index + 1
%td
= buyer.name
%span.label.label-success
= buyer.ticket_purchases.find_by(ticket_id: @ticket.id).quantity
%td
= buyer.email
%td
= buyer.affiliation
%td
= @ticket.paid?(buyer)
%h4 The following persons bought this ticket:
%table.table.table-striped.table-bordered.table-hover.datatable
%thead
%th #
%th Name
%th E-Mail
%th Affiliation
%th Paid
%tbody
- @ticket.buyers.each_with_index do |buyer, index|
%tr
%td
= index + 1
%td
= buyer.name
%span.label.label-success
= buyer.ticket_purchases.find_by(ticket_id: @ticket.id).quantity
%td
= buyer.email
%td
= buyer.affiliation
%td
= @ticket.paid?(buyer)
= link_to 'Edit', edit_admin_conference_ticket_path(@conference.short_title, @ticket.id),
method: :get, class: 'btn btn-primary'