Merge branch 'master' into fix-social-media-splashpage

This commit is contained in:
James Mason 2018-01-31 09:56:32 -08:00 committed by GitHub
commit b5bcc28fa2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 3 deletions

View file

@ -115,3 +115,9 @@ p.comment-body {
float: right;
}
}
/* omniauth btn grp */
#openid-btn-grp{
display: flex;
justify-content: center;
}

View file

@ -20,6 +20,11 @@ class ConferencesController < ApplicationController
authorize! :show, @conference # TODO: reduce the 10 queries performed here
splashpage = @conference.splashpage
unless splashpage.present?
redirect_to admin_conference_splashpage_path(@conference.short_title) && return
end
if splashpage.include_cfp
cfps = @conference.program.cfps
@call_for_events = cfps.find { |call| call.cfp_type == 'events' }

View file

@ -62,7 +62,11 @@ class Ticket < ApplicationRecord
def tickets_turnover_total(id)
tickets = TicketPurchase.where(ticket_id: id).paid
tickets.inject(0){ |sum, ticket| sum + (ticket.amount_paid * ticket.quantity) }
if tickets.blank?
Money.new(0, Ticket.find(id).price_currency)
else
tickets.inject(Money.new(0, tickets.first.price_currency)){ |sum, ticket| sum + (ticket.amount_paid * ticket.quantity) }
end
end
def tickets_sold

View file

@ -1,5 +1,5 @@
.text-center
.btn-group.btn-group-lg
.btn-group.btn-group-lg#openid-btn-grp
- omniauth_configured.each do |provider|
= link_to "user_#{provider}_omniauth_authorize".to_sym, class: "btn btn-success btn-lg",
id: "omniauth-#{provider}",