Merge branch 'master' into fix-social-media-splashpage
This commit is contained in:
commit
b5bcc28fa2
5 changed files with 18 additions and 3 deletions
|
|
@ -115,3 +115,9 @@ p.comment-body {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* omniauth btn grp */
|
||||||
|
#openid-btn-grp{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
@ -20,6 +20,11 @@ class ConferencesController < ApplicationController
|
||||||
authorize! :show, @conference # TODO: reduce the 10 queries performed here
|
authorize! :show, @conference # TODO: reduce the 10 queries performed here
|
||||||
|
|
||||||
splashpage = @conference.splashpage
|
splashpage = @conference.splashpage
|
||||||
|
|
||||||
|
unless splashpage.present?
|
||||||
|
redirect_to admin_conference_splashpage_path(@conference.short_title) && return
|
||||||
|
end
|
||||||
|
|
||||||
if splashpage.include_cfp
|
if splashpage.include_cfp
|
||||||
cfps = @conference.program.cfps
|
cfps = @conference.program.cfps
|
||||||
@call_for_events = cfps.find { |call| call.cfp_type == 'events' }
|
@call_for_events = cfps.find { |call| call.cfp_type == 'events' }
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,11 @@ class Ticket < ApplicationRecord
|
||||||
|
|
||||||
def tickets_turnover_total(id)
|
def tickets_turnover_total(id)
|
||||||
tickets = TicketPurchase.where(ticket_id: id).paid
|
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
|
end
|
||||||
|
|
||||||
def tickets_sold
|
def tickets_sold
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
.text-center
|
.text-center
|
||||||
.btn-group.btn-group-lg
|
.btn-group.btn-group-lg#openid-btn-grp
|
||||||
- omniauth_configured.each do |provider|
|
- omniauth_configured.each do |provider|
|
||||||
= link_to "user_#{provider}_omniauth_authorize".to_sym, class: "btn btn-success btn-lg",
|
= link_to "user_#{provider}_omniauth_authorize".to_sym, class: "btn btn-success btn-lg",
|
||||||
id: "omniauth-#{provider}",
|
id: "omniauth-#{provider}",
|
||||||
|
|
|
||||||
|
|
@ -496,7 +496,7 @@ ActiveRecord::Schema.define(version: 20171201163628) do
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.integer "payment_id"
|
t.integer "payment_id"
|
||||||
t.integer "week"
|
t.integer "week"
|
||||||
t.float "amount_paid"
|
t.float "amount_paid", default: 0.0
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "ticket_scannings", force: :cascade do |t|
|
create_table "ticket_scannings", force: :cascade do |t|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue