Fix Stellas review gripes

This commit is contained in:
Henne Vogelsang 2014-12-09 15:19:01 +01:00
parent d13efa5f52
commit c6bd65deaa
6 changed files with 51 additions and 46 deletions

View file

@ -3,11 +3,11 @@
@font-face { @font-face {
font-family: "suse-icons"; font-family: "suse-icons";
src:url("fonts/suse-icons.eot"); src:font-url("suse-icons.eot");
src:url("fonts/suse-icons.eot?#iefix") format("embedded-opentype"), src:font-url("suse-icons.eot?#iefix") format("embedded-opentype"),
url("fonts/suse-icons.woff") format("woff"), font-url("suse-icons.woff") format("woff"),
url("fonts/suse-icons.ttf") format("truetype"), font-url("suse-icons.ttf") format("truetype"),
url("fonts/suse-icons.svg#suse-icons") format("svg"); font-url("suse-icons.svg#suse-icons") format("svg");
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
@ -22,8 +22,7 @@
text-transform: none !important; text-transform: none !important;
speak: none; speak: none;
line-height: 1; line-height: 1;
-webkit-font-smoothing: antialiased; font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
} }
/* We have to repeat this for every symbol that extends font awesome. So if /* We have to repeat this for every symbol that extends font awesome. So if
@ -38,8 +37,7 @@
text-transform: none !important; text-transform: none !important;
speak: none; speak: none;
line-height: 1; line-height: 1;
-webkit-font-smoothing: antialiased; font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
} }
.fa-suse:before { .fa-suse:before {

View file

@ -11,7 +11,7 @@ class ConferenceRegistrationsController < ApplicationController
def show def show
@workshops = @registration.workshops @workshops = @registration.workshops
@total_price = Ticket.total_price(@conference, current_user) @total_price = Ticket.total_price(@conference, current_user)
@tickets = current_user.ticket_purchases.where(conference_id: 1) @tickets = current_user.ticket_purchases.where(conference_id: @conference.id)
end end
def edit; end def edit; end

View file

@ -1,8 +1,15 @@
class TicketsController < ApplicationController class TicketsController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
load_resource :conference, find_by: :short_title load_resource :conference, find_by: :short_title
load_resource :tickets, class: Ticket load_resource :ticket, through: :conference
authorize_resource :conference_registrations, class: Registration authorize_resource :conference_registrations, class: Registration
before_filter :check_load_resource, only: :index
def index; end def index; end
def check_load_resource
if @tickets.empty?
redirect_to root_path, notice: "There are no tickets available for #{@conference.title}!"
end
end
end end

View file

@ -66,36 +66,36 @@
- @workshops.each do |workshop| - @workshops.each do |workshop|
%li %li
= link_to workshop.title, conference_proposal_path(@conference.short_title, workshop.id) = link_to workshop.title, conference_proposal_path(@conference.short_title, workshop.id)
.row - if @conference.tickets.any?
.col-md-12 .row
%h4 .col-md-12
%span.fa-stack %h4
%i.fa.fa-square-o.fa-stack-2x %span.fa-stack
%i.fa.fa-ticket.fa-stack-1x %i.fa.fa-square-o.fa-stack-2x
Tickets %i.fa.fa-ticket.fa-stack-1x
-if @tickets.any? Tickets
= "(#{@total_price} #{@tickets.first.price.symbol})" -if @tickets.any?
%ul = "(#{@total_price} #{@tickets.first.price.symbol})"
- @tickets.each do |ticket| %ul
- @tickets.each do |ticket|
%li
= ticket.quantity
= ticket.title
= word_pluralize(ticket.quantity, 'Ticket')
for
= humanized_money ticket.price
= ticket.price.symbol
= link_to conference_ticket_purchase_path(@conference.short_title, ticket.id), method: :delete,
id: "ticket-#{ticket.id}-delete",
class: 'btn btn-danger btn-xs',
data: { confirm: "Do you really want to delete the #{ticket.title} ticket for #{@conference.title}?" } do
%i.fa.fa-trash-o
%li %li
= ticket.quantity - if @tickets.any?
= ticket.title = link_to 'Buy more tickets', conference_tickets_path(@conference.short_title)
= word_pluralize(ticket.quantity, 'Ticket') - else
for You haven't bought any tickets.
= humanized_money ticket.price = link_to 'Please buy some tickets to support us!', conference_tickets_path(@conference.short_title)
= ticket.price.symbol
= link_to conference_ticket_purchase_path(@conference.short_title, ticket.id), method: :delete,
id: "ticket-#{ticket.id}-delete",
class: 'btn btn-danger btn-xs',
data: { confirm: "Do you really want to delete the #{ticket.title} ticket for #{@conference.title}?" } do
%i.fa.fa-trash-o
%li
- if @tickets.any?
= link_to 'Buy more tickets', conference_tickets_path(@conference.short_title)
- else
You haven't bought any tickets.
= link_to 'Please buy some tickets to support us!', conference_tickets_path(@conference.short_title)
.row .row
.col-md-12 .col-md-12

View file

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

View file

@ -58,10 +58,10 @@ Osem::Application.routes.draw do
resources :emails, only: [:show, :update, :index] resources :emails, only: [:show, :update, :index]
resources :sponsorship_levels, except: [:show] do resources :sponsorship_levels, except: [:show] do
member do member do
patch :up patch :up
patch :down patch :down
end end
end end
resources :questions do resources :questions do