Browse Source

Created a new payment admin page

development
Godwin 8 years ago
parent
commit
2f375f7ff2
  1. 153
      app/assets/stylesheets/_application.scss
  2. 59
      app/controllers/conferences_controller.rb
  3. 89
      app/helpers/application_helper.rb
  4. 6
      app/models/conference.rb
  5. 31
      app/views/conferences/_payment.html.haml
  6. 1
      app/views/conferences/admin/_broadcast_sent.html.haml
  7. 6
      app/views/conferences/admin/_edit.html.haml
  8. 20
      app/views/conferences/admin/_payment.html.haml
  9. 20
      config/locales/en.yml
  10. 3
      config/locales/es.yml
  11. 5
      db/migrate/20160814000814_add_payment_message_to_conference.rb
  12. 5
      db/migrate/20160814000940_add_payment_amounts_to_conference.rb
  13. 864
      db/schema.rb

153
app/assets/stylesheets/_application.scss

@ -109,6 +109,21 @@ table, .table {
background-color: transparent;
border: 0;
}
&.state {
background-size: 1.333em;
background-repeat: no-repeat;
background-position: center;
width: 1.75em;
&.happy {
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 87.8 73.2'><polygon fill='#{$colour-5}' points='34.3 73.2 0 32.6 18.7 16.8 35.4 36.5 70.1 0 87.8 16.8 '/></svg>");
}
&.unhappy {
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path xmlns="http://www.w3.org/2000/svg" d="M50 5C25.1 5 5 25.1 5 50c0 24.9 20.1 45 45 45s45-20.1 45-45C95 25.1 74.9 5 50 5zM72.5 64.3l-8.2 8.2L50 58.2 35.7 72.5l-8.2-8.2L41.8 50 27.5 35.7l8.2-8.2L50 41.8l14.3-14.3 8.2 8.2L58.2 50 72.5 64.3z" fill="#{$colour-4}"/></svg>');
}
}
}
th, .table-th {
@ -120,6 +135,39 @@ table, .table {
}
}
td, .table-td {
&.inner-table {
padding: 0;
table {
margin: 0;
width: 100%;
}
tr:first-child {
td, th {
border-top: 0;
}
}
tr:last-child {
td, th {
border-bottom: 0;
}
}
td, th {
&:first-child {
border-left: 0
}
&:last-child {
border-right: 0
}
}
}
}
tbody th {
width: 0.1rem;
}
@ -281,6 +329,10 @@ textarea, .textarea {
&:hover, &:focus, &:active {
@include _(box-shadow, 0 0 0 0.3em rgba(0,0,0,0.05));
}
&.short {
min-height: 10em;
}
}
.textarea, .workshop-description {
@ -1437,6 +1489,92 @@ ul.warnings li,
}
}
#admin-housing {
.host-table {
tr.place-guest {
td {
background-color: lighten($colour-1, 40%);
&:hover {
background-color: $colour-1;
}
}
a {
display: block;
color: $white;
text-align: center;
@include font-family(secondary);
@include after {
display: none;
}
}
}
button, .button {
float: right;
}
td {
vertical-align: top;
}
.state {
position: relative;
font-family: inherit;
&.unhappy {
cursor: pointer;
}
ul {
display: none;
position: absolute;
right: 100%;
top: 0;
background-color: $white;
border: 0.1em solid #CCC;
padding: 0.25em 0.75em;
margin: 0;
list-style: none;
@include default-box-shadow(top, 2);
}
li {
margin: 0;
}
&:hover {
ul {
display: block;
}
}
}
}
#guest-selector {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba($black, 0.5);
.guest-dlg {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: $white;
width: 80%;
max-width: 25em;
@include default-box-shadow(top, 2);
}
}
}
#admin-housing {
#hosts {
background-color: $white;
@ -2407,7 +2545,7 @@ html :focus {
padding: 0.5em 1.5em;
}
#main .three-options {
#main .graded-options {
text-align: center;
button {
@ -2416,7 +2554,7 @@ html :focus {
font-size: 1.5em;
margin: 0.25em;
&:first-child {
&.option-1 {
background-color: $colour-3;
}
@ -2424,6 +2562,17 @@ html :focus {
background-color: $colour-5;
}
}
&.option-count-4 button.option-3,
&.option-count-5 button.option-4 {
background-color: mix($colour-3, $colour-5);
}
&.option-count-5 {
button.option-2 {
background-color: mix($colour-3, $colour-4);
}
}
}
#main .skip {

59
app/controllers/conferences_controller.rb

@ -268,7 +268,7 @@ class ConferencesController < ApplicationController
@page_title = 'articles.conference_registration.headings.Policy_Agreement'
when :administration
@warnings << flash[:error] if flash[:error].present?
@admin_step = params[:admin_step] || 'edit'
@admin_step = params[:admin_step] || view_context.admin_steps.first.to_s
return do_404 unless view_context.valid_admin_steps.include?(@admin_step.to_sym)
@page_title = 'articles.conference_registration.headings.Administration'
@ -383,7 +383,7 @@ class ConferencesController < ApplicationController
name: user.firstname || '',
email: user.email || '',
status: (view_context._"articles.conference_registration.terms.registration_status.#{(steps.include? 'questions') ? 'registered' : ((steps.include? 'contact_info') ? 'preregistered' : 'unregistered')}"),
date: r.created_at,# ? r.created_at.strftime("%F %T") : '',
date: r.created_at ? r.created_at.strftime("%F %T") : '',
city: r.city || '',
preferred_language: user.locale.present? ? (view_context.language_name user.locale) : '',
languages: ((r.languages || []).map { |x| view_context.language_name x }).join(', ').to_s,
@ -462,7 +462,7 @@ class ConferencesController < ApplicationController
ConferenceRegistration.where(:conference_id => @this_conference.id).each do | registration |
if registration.can_provide_housing
@hosts[registration.id] = registration
else
elsif registration.housing.present? && registration.housing != 'none'
@guests[registration.id] = registration
end
end
@ -515,6 +515,14 @@ class ConferencesController < ApplicationController
@housing_data[host_id][:warnings][:space][space] << :overbooked
end
@housing_data[host_id][:guest_data] ||= {}
@housing_data[host_id][:guest_data][guest_id] = { warnings: {}, errors: {} }
if (guest.housing == 'house' && space == :tent) ||
(guest.housing == 'tent' && (space == :bed_space || space == :floor_space))
@housing_data[host_id][:guest_data][guest_id][:warnings][:space] = { actual: space.to_s, expected: guest.housing}
end
companions = data['companions'] || []
companions.each do | companion |
user = User.find_by_email(companion)
@ -523,16 +531,17 @@ class ConferencesController < ApplicationController
:user_id => user.id,
:conference_id => @this_conference.id
)
housing_data = reg.housing_data || {}
companion_host = housing_data['host'].present? ? housing_data['host'].to_i : nil
if companion_host.blank?
@hosts_affected_by_guests[guest_id] << companion_host
if companion_host != host_id
# set this as an error if the guest has selected only one other to stay with, but if they have requested to stay with more, make this only a warning
status = companions.size > 1 ? :warnings : :errors
@housing_data[host_id][:guests][guest][status] ||= {}
@housing_data[host_id][:guests][guest][status][:companions] ||= []
@housing_data[host_id][:guests][guest][status][:companions] << reg.id
if reg.present? && @guests[reg.id].present?
housing_data = reg.housing_data || {}
companion_host = housing_data['host'].present? ? housing_data['host'].to_i : nil
if companion_host.blank?
@hosts_affected_by_guests[guest_id] << companion_host
if companion_host != host_id && reg.housing.present? && reg.housing != 'none'
# set this as an error if the guest has selected only one other to stay with, but if they have requested to stay with more, make this only a warning
status = companions.size > 1 ? :warnings : :errors
@housing_data[host_id][:guest_data][guest_id][status][:companions] ||= []
@housing_data[host_id][:guest_data][guest_id][status][:companions] << { name: reg.user.name, id: reg.id }
end
end
end
end
@ -568,12 +577,8 @@ class ConferencesController < ApplicationController
params[:info_translations].each do | locale, value |
@this_conference.set_column_for_locale(:info, locale, value, current_user.id) unless value == @this_conference._info(locale)
end
@this_conference.paypal_email_address = params[:paypal_email_address]
@this_conference.paypal_username = params[:paypal_username]
@this_conference.paypal_password = params[:paypal_password]
@this_conference.paypal_signature = params[:paypal_signature]
@this_conference.save
return redirect_to register_step_path(@this_conference.slug, :administration)
return redirect_to administration_step_path(@this_conference.slug, :edit)
when 'add_member'
org = nil
@this_conference.organizations.each do | organization |
@ -583,6 +588,24 @@ class ConferencesController < ApplicationController
org.save
return redirect_to administration_step_path(@this_conference.slug, :edit)
end
when 'payment'
case params[:button]
when 'save'
@this_conference.payment_message = LinguaFranca::ActiveRecord::UntranslatedValue.new(params[:payment_message]) unless @this_conference.payment_message! == params[:payment_message]
params[:payment_message_translations].each do | locale, value |
@this_conference.set_column_for_locale(:payment_message, locale, value, current_user.id) unless value == @this_conference._payment_message(locale)
end
@this_conference.payment_amounts = ((params[:payment_amounts] || {}).values.map &:to_i) - [0]
@this_conference.paypal_email_address = params[:paypal_email_address]
@this_conference.paypal_username = params[:paypal_username]
@this_conference.paypal_password = params[:paypal_password]
@this_conference.paypal_signature = params[:paypal_signature]
@this_conference.save
return redirect_to administration_step_path(@this_conference.slug, :payment)
end
when 'housing'
space = params[:button].split(':')[0]
host_id = params[:button].split(':')[1].to_i

89
app/helpers/application_helper.rb

@ -957,7 +957,7 @@ module ApplicationHelper
end
def admin_steps
[:edit, :stats, :broadcast, :housing, :locations, :meals, :events, :workshop_times, :schedule]
[:stats, :edit, :payment, :broadcast, :housing, :locations, :meals, :events, :workshop_times, :schedule]
end
def valid_admin_steps
@ -991,6 +991,81 @@ module ApplicationHelper
return _'articles.workshops.info.interested_count', :vars => {:count => workshop.interested_count}
end
def host_guests_table(registration)
id = registration.id
html = ''
@housing_data[id][:guests].each do | area, guests |
guest_rows = ''
guests.each do | guest_id, guest |
status_html = ''
@housing_data[id][:guest_data][guest_id][:errors].each do | error, value |
if value.is_a?(Array)
value.each do | v |
status_html += _("errors.housing.space.#{error.to_s}", vars: {value: v})
end
else
status_html += _("errors.housing.space.#{error.to_s}", vars: {value: value })
end
end
@housing_data[id][:guest_data][guest_id][:warnings].each do | error, value |
if value.is_a?(Array)
value.each do | v |
status_html += _("warnings.housing.space.#{error.to_s}", v)
end
else
status_html += _("warnings.housing.space.#{error.to_s}", vars: value)
end
end
if status_html.present?
status_html = content_tag(:ul, status_html.html_safe)
end
guest_rows += content_tag :tr, id: "hosted-guest-#{guest_id}" do
(content_tag :td, guest[:guest].user.name) +
(content_tag :td do
(guest[:guest].city +
(button_tag :remove, class: [:small, :delete])).html_safe
end) +
(content_tag :td, status_html.html_safe, class: [:state, status_html.present? ? :unhappy : :happy])
end
for i in guests.size..(@housing_data[id][:space][area] || 0)
guest_rows += content_tag :tr, class: 'empty-space' do
(content_tag :td, '', colspan: 2) +
(content_tag :td)
end
end
end
status_html = ''
if @housing_data[id][:warnings].present? && @housing_data[id][:warnings][:space].present? && @housing_data[id][:warnings][:space][area].present?
@housing_data[id][:warnings][:space][area].each do | w |
status_html += content_tag(:li, _("warnings.housing.space.#{w.to_s}"))
end
end
if status_html.present?
status_html = content_tag(:ul, status_html.html_safe)
end
html += content_tag :tr do
(content_tag :th, (_"forms.labels.generic.#{area}"), colspan: 2) +
(content_tag :th, status_html.html_safe, class: [:state, status_html.present? ? :unhappy : :happy])
end
html += guest_rows
html += content_tag :tr, class: 'place-guest' do
content_tag :td, colspan: 3 do
content_tag :a, (_'forms.actions.generic.place_guest'), class: 'select-guest', href: '#', data: { host: id, space: area }
end
end
end
content_tag :table, html.html_safe, class: 'host-table'
end
def host_guests_widget(registration)
html = ''
classes = ['host']
@ -1102,19 +1177,25 @@ module ApplicationHelper
aria = {}
aria[:labelledby] = label_id if label_id.present?
aria[:describedby] = description_id if description_id.present?
css_class = [
options[:short] === true ? :short : nil
].compact
if options[:plain]
html += (text_area_tag name, value,
id: id,
lang: options[:lang],
aria: aria)
aria: aria,
class: css_class
)
else
html += content_tag(:div, value.present? ? value.html_safe : '',
id: id,
class: 'textarea',
data: { name: name, 'edit-on': options[:edit_on] || :load },
lang: options[:lang],
aria: aria,
tabindex: 0
tabindex: 0,
class: [:textarea] + css_class
)
add_stylesheet :editor

6
app/models/conference.rb

@ -1,5 +1,5 @@
class Conference < ActiveRecord::Base
translates :info, :title
translates :info, :title, :payment_message
mount_uploader :cover, CoverUploader
mount_uploader :poster, PosterUploader
@ -64,4 +64,8 @@ class Conference < ActiveRecord::Base
write_attribute :registration_status, new_registration_status.to_s
end
def self.default_payment_amounts
[25, 50, 100]
end
end

31
app/views/conferences/_payment.html.haml

@ -1,28 +1,29 @@
= columns(medium: 12) do
- if @registration.registration_fees_paid.present?
%p
%strong=_'articles.conference_registration.paragraphs.Payment_Made', :p, vars: { fees_paid: @registration.registration_fees_paid }
%strong=_'articles.conference_registration.paragraphs.Payment_Made', :p, vars: { fees_paid: (number_to_currency @registration.registration_fees_paid, unit: '$') }
= _'articles.conference_registration.paragraphs.Payment_Add'
= @this_conference.payment_message.html_safe if @this_conference.payment_message.present?
- elsif @this_conference.payment_message.present?
= @this_conference.payment_message.html_safe
- else
%p=_'articles.conference_registration.paragraphs.Payment', :p
%p=@this_conference.payment_message || (_'articles.conference_registration.paragraphs.Payment', :p)
= columns(large: 9, push: 1) do
= form_tag register_path(@this_conference.slug), :class => :payment do
= form_tag register_path(@this_conference.slug), class: :payment do
= hidden_field_tag :button, :payment
.three-options
= button_tag :amount_25, :name => :amount, :value => '25.0' do
=_! '$25.00'
= button_tag :amount_50, :name => :amount, :value => '50.0' do
=_! '$50.00'
= button_tag :amount_100, :name => :amount, :value => '100.0' do
= _!'$100.00'
= form_tag register_path(@this_conference.slug), :class => ['custom-payment', :centered] do
- payment_amounts = @this_conference.payment_amounts.present? ? @this_conference.payment_amounts : Conference.default_payment_amounts
.graded-options{class: "option-count-#{payment_amounts.size}"}
- payment_amounts.each_with_index do | amount, i |
= button_tag :amount_25, name: :amount, value: amount.to_f.to_s, class: "option-#{i + 1}" do
=_! (number_to_currency amount, unit: '$')
= form_tag register_path(@this_conference.slug), class: ['custom-payment', :centered] do
%span.currency=_!'$'
= numberfield :amount, nil, :required => true, :step => 0.01, :min => 0.00, label: false
= button_tag :custom_amount, :value => :payment
= numberfield :amount, nil, required: true, step: 0.01, min: 0.00, label: false
= button_tag :custom_amount, value: :payment
%p=_'articles.conference_registration.paragraphs.currency','(amounts are in $USD)'
= form_tag register_path(@this_conference.slug), :class => :payment do
= form_tag register_path(@this_conference.slug), class: :payment do
= hidden_field_tag :button, :payment
.actions.skip
= button_tag :skip, :name => :amount, :value => '0.0'
= button_tag :skip, name: :amount, value: '0.0'
= columns(large: 2)

1
app/views/conferences/admin/_broadcast_sent.html.haml

@ -1 +0,0 @@
%p= _'articles.conference_registration.paragraphs.admin.broadcast.sent'

6
app/views/conferences/admin/_edit.html.haml

@ -4,12 +4,6 @@
- I18n.backend.enabled_locales.each do | locale |
- if locale.to_s != @this_conference.locale.to_s
= textarea "info_translations[#{locale.to_s}]", @this_conference._info(locale), label: 'translate.pages.Locale_Translation', vars: { language: _("languages.#{locale}") }, lang: locale, edit_on: :focus
%h4=_'articles.admin.edit.headings.paypal_info', :t
%p=(_'articles.admin.edit.paragraphs.paypal_info', :p).html_safe
= emailfield :paypal_email_address, @this_conference.paypal_email_address || @this_conference.email_address || (@this_conference.organizations.present? && @this_conference.organizations.first.present? ? @this_conference.organizations.first.email_address : nil)
= textfield :paypal_username, @this_conference.paypal_username
= passwordfield :paypal_password, @this_conference.paypal_password
= textfield :paypal_signature, @this_conference.paypal_signature
.actions.right
= button_tag :save, value: :save
%h4=_'articles.admin.edit.headings.host_organizations'

20
app/views/conferences/admin/_payment.html.haml

@ -0,0 +1,20 @@
= form_tag administration_update_path(@this_conference.slug, :payment) do
= textarea :payment_message, (@this_conference.payment_message! || "<p>#{I18n.t('articles.conference_registration.paragraphs.Payment', locale: @this_conference.locale)}</p>"), help: 'articles.conference_registration.paragraphs.admin.payment.message', lang: @this_conference.locale, edit_on: :focus, short: true
- I18n.backend.enabled_locales.each do | locale |
- if locale.to_s != @this_conference.locale.to_s
= textarea "payment_message_translations[#{locale.to_s}]", (@this_conference._payment_message(locale) || "<p>#{I18n.t('articles.conference_registration.paragraphs.Payment', locale: locale)}</p>"), label: 'translate.pages.Locale_Translation', vars: { language: _("languages.#{locale}") }, lang: locale, edit_on: :focus, short: true
%h4=_'articles.admin.payment.headings.payment_amounts', :t
= fieldset :payment_amounts, help: 'articles.admin.payment.paragraphs.payment_amounts' do
- payment_amounts = @this_conference.payment_amounts.present? ? @this_conference.payment_amounts : Conference.default_payment_amounts
- for i in 1..5 do
= numberfield "payment_amounts[#{i - 1}]", payment_amounts[i - 1], step: 0.01, min: 0.00, label: false
%h4=_'articles.admin.edit.headings.paypal_info', :t
%p=(_'articles.admin.edit.paragraphs.paypal_info', :p).html_safe
= emailfield :paypal_email_address, @this_conference.paypal_email_address || @this_conference.email_address || (@this_conference.organizations.present? && @this_conference.organizations.first.present? ? @this_conference.organizations.first.email_address : nil)
= textfield :paypal_username, @this_conference.paypal_username
= passwordfield :paypal_password, @this_conference.paypal_password
= textfield :paypal_signature, @this_conference.paypal_signature
.actions.right
= button_tag :save, value: :save

20
config/locales/en.yml

@ -889,6 +889,7 @@ en:
housing:
description: The housing tool can be used to help you set up visitors that have requested to be housed with a host.
headings:
hosts: Hosts
guests: Guests
email: Email
housing: Preference
@ -918,8 +919,16 @@ en:
paypal_info: PayPal info is used for donations and fee payments. You must enter all fields to enable online fee payments, see the <a href="https://developer.paypal.com/docs/classic/api/apiCredentials/#creating-an-api-signature" target="_blank">PayPal API credential guide</a> for more information.
broadcast:
description: The broadcast tool is used to contact users through email. You can send messages en masse to select groups of users.
broadcast_sent:
description: Your message has been sent.
workshop_times:
description: Before you scheulde workshops, you must first create blocks of time when the workshops will be.
payment:
description: Here you can set up how users will pay you for registration
headings:
payment_amounts: Suggested Payment Amounts
paragraphs:
payment_amounts: Enter up to five suggested payment amounts. Users will still be able to select any amount including none but these amounts will show up as easy to select buttons on the 'Donations' page.
contact:
headings:
contact: Send us a question or a complement
@ -1005,13 +1014,15 @@ en:
admin:
edit:
info: Info
payment:
message: XXX
companion: Companion
paragraphs:
Policy_Agreement: Ensuring that all attendees feel welcome, safe, and respected at all times is especially important to us all. Please ensure that you have fully read and understand our safer spaces policy below, if you have any questions or concerns you can reach out to the organizers at any time.
Confirm_Agreement: By clicking the "I Agree" button, you are pledging to do your best to uphold Bike!Bike!'s safer space agreement. Thank you!
Registration_Info: Please fill in this registration form to help us prepare for your arrival to %{city}. If you wish to ask questions or tell us information we did not ask, please fill in the preferences field at the bottom of the page or use the contact us link.
Payment: Thank you for completing your registration. We'll see you at Bike!Bike! Payment is by donation and can be done now or upon arrival but to help us fund the conference, we ask that you pay the registration donation as soon as you can.
Payment_Made: You have made a payment of $%{fees_paid}.
Payment_Made: You have made a payment of %{fees_paid}.
Payment_Add: Thank you! You may add to this amount if you wish by making another payment below.
currency: "(amounts are in USD)"
email_confirm: Go to your inbox! You should see an email from Bike!Bike! in just a few moments. There will be a link in the email for you to click on. Check your spam box if you do not see it. If you encounter any problems, please contact us.
@ -1048,9 +1059,10 @@ en:
broadcast:
test: Please take a look at this preview to ensure that you want to send this email. Clicking ‘Test’ will send the email only to you. Only after that then the email will be set to %{send_to_count} people.
preview: Clicking ‘Send’ will send this message to %{send_to_count} people. Please confirm that you have verified that the test email sent to you is what you want to be sent.
sent: Your message has been sent.
events:
info: Describe your event for anyone attending the conference.
payment:
message: This is the text that will be displayed on the 'Donation' page.
companion: Is there someone who you would like us to ensure that you are housed with?
arrival_and_departure: If you don't need housing, just tell us how long you plan to hang out with Bike!Bike!
host:
@ -1196,6 +1208,7 @@ en:
forms:
labels:
generic:
payment_message: Payment Message
other: Disabilities, housing preferences, etc.
email: Email address
allergies: Allergies
@ -1361,11 +1374,14 @@ en:
Workshops: Workshops
Stats: Stats
Broadcast: Broadcast
Payment: Payment
Edit: Edit Conference
admin:
Edit: Edit
Stats: Stats
Payment: Payment
Broadcast: Broadcast
Broadcast_Sent: Broadcast Sent
Housing: Housing
Locations: Locations
Meals: Meals

3
config/locales/es.yml

@ -802,7 +802,7 @@ es:
availability: Disponibilidad
address: Dirección
paragraphs:
Payment_Made: Usted ya ha realizado un pago de $ %{fees_paid}.
Payment_Made: Usted ya ha realizado un pago de %{fees_paid}.
Payment_Add: ¡Gracias! Puede añadir a esta cantidad si desea realizar otra de pago a continuación.
companion: ¿Quieres que nos aseguremos de que la persona que viaja contigo se hospede en el mismo lugar que tú?
Workshops_You_Have_Requested: La siguiente es una lista de todos los talleres que pediste facilitar.
@ -1034,6 +1034,7 @@ es:
previous: Anterior
next: Siguiente
reply: Responder
close: Cerca
aria:
remove_interest: Haga clic en si ya no está interesado en este taller
show_interest: Haga clic en si usted está interesado en este taller

5
db/migrate/20160814000814_add_payment_message_to_conference.rb

@ -0,0 +1,5 @@
class AddPaymentMessageToConference < ActiveRecord::Migration
def change
add_column :conferences, :payment_message, :text
end
end

5
db/migrate/20160814000940_add_payment_amounts_to_conference.rb

@ -0,0 +1,5 @@
class AddPaymentAmountsToConference < ActiveRecord::Migration
def change
add_column :conferences, :payment_amounts, :json
end
end

864
db/schema.rb

@ -1,431 +1,433 @@
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160708042511) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "authentications", force: :cascade do |t|
t.integer "user_id", null: false
t.string "provider", null: false
t.string "uid", null: false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "comments", force: :cascade do |t|
t.string "model_type"
t.integer "model_id"
t.text "comment"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "user_id"
end
create_table "conference_admins", force: :cascade do |t|
t.integer "conference_id"
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "conference_host_organizations", force: :cascade do |t|
t.integer "conference_id"
t.integer "organization_id"
t.integer "order"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "conference_registration_form_fields", force: :cascade do |t|
t.integer "conference_id"
t.integer "registration_form_field_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "position"
end
create_table "conference_registration_responses", force: :cascade do |t|
t.integer "conference_registration_id"
t.integer "registration_form_field_id"
t.text "data"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "conference_registrations", force: :cascade do |t|
t.integer "conference_id"
t.integer "user_id"
t.string "is_attending"
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "is_confirmed"
t.boolean "is_participant"
t.boolean "is_volunteer"
t.string "confirmation_token"
t.binary "data"
t.string "email"
t.boolean "complete"
t.boolean "completed"
t.string "payment_confirmation_token"
t.string "payment_info"
t.integer "registration_fees_paid"
t.string "city"
t.datetime "arrival"
t.datetime "departure"
t.string "housing"
t.string "bike"
t.text "other"
t.string "allergies"
t.string "languages"
t.string "food"
t.string "highest_step"
t.json "steps_completed"
t.boolean "can_provide_housing"
t.json "housing_data"
end
create_table "conference_types", force: :cascade do |t|
t.string "title"
t.string "info"
t.datetime "created_at"
t.datetime "updated_at"
t.string "slug"
end
create_table "conferences", force: :cascade do |t|
t.string "title"
t.string "slug"
t.datetime "start_date"
t.datetime "end_date"
t.text "info"
t.string "poster"
t.string "cover"
t.boolean "workshop_schedule_published"
t.boolean "registration_open"
t.boolean "meals_provided"
t.text "meal_info"
t.text "travel_info"
t.integer "conference_type_id"
t.datetime "created_at"
t.datetime "updated_at"
t.text "preregistration_info"
t.text "registration_info"
t.text "postregistration_info"
t.integer "cover_attribution_id"
t.string "cover_attribution_name"
t.string "cover_attribution_src"
t.integer "cover_attribution_user_id"
t.string "locale"
t.string "email_address"
t.string "paypal_email_address"
t.string "paypal_username"
t.string "paypal_password"
t.string "paypal_signature"
t.string "day_parts"
t.string "registration_status"
t.json "meals"
t.json "workshop_blocks"
end
create_table "delayed_jobs", force: :cascade do |t|
t.integer "priority", default: 0, null: false
t.integer "attempts", default: 0, null: false
t.text "handler", null: false
t.text "last_error"
t.datetime "run_at"
t.datetime "locked_at"
t.datetime "failed_at"
t.string "locked_by"
t.string "queue"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree
create_table "dynamic_translation_records", force: :cascade do |t|
t.string "locale"
t.integer "translator_id"
t.string "model_type"
t.integer "model_id"
t.string "column"
t.text "value"
t.datetime "created_at"
end
create_table "email_confirmations", force: :cascade do |t|
t.string "token"
t.integer "user_id"
t.datetime "expiry"
t.string "url"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "event_locations", force: :cascade do |t|
t.string "title"
t.integer "conference_id"
t.float "latitude"
t.float "longitude"
t.string "address"
t.string "amenities"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "space"
end
create_table "event_types", force: :cascade do |t|
t.string "slug"
t.text "info"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "events", force: :cascade do |t|
t.string "title"
t.string "slug"
t.integer "event_type_id"
t.integer "conference_id"
t.text "info"
t.integer "location_id"
t.datetime "start_time"
t.datetime "end_time"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "event_location_id"
t.string "event_type"
t.string "locale"
end
create_table "locations", force: :cascade do |t|
t.string "title"
t.float "latitude"
t.float "longitude"
t.datetime "created_at"
t.datetime "updated_at"
t.string "country"
t.string "territory"
t.string "city"
t.string "street"
t.string "postal_code"
end
add_index "locations", ["latitude", "longitude"], name: "index_locations_on_latitude_and_longitude", using: :btree
create_table "locations_organizations", id: false, force: :cascade do |t|
t.integer "organization_id"
t.integer "location_id"
end
add_index "locations_organizations", ["organization_id", "location_id"], name: "loc_org_index", using: :btree
create_table "organization_statuses", force: :cascade do |t|
t.string "name"
t.string "slug"
t.string "info"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "organizations", force: :cascade do |t|
t.string "name"
t.string "slug"
t.string "email_address"
t.string "url"
t.integer "year_founded"
t.text "info"
t.string "logo"
t.string "avatar"
t.boolean "requires_approval"
t.string "secret_question"
t.string "secret_answer"
t.integer "user_organization_replationship_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "cover"
t.integer "cover_attribution_id"
t.string "cover_attribution_name"
t.string "cover_attribution_src"
t.string "phone"
t.integer "organization_status_id"
t.integer "cover_attribution_user_id"
t.string "status"
end
create_table "registration_form_fields", force: :cascade do |t|
t.string "title"
t.text "help"
t.boolean "required"
t.string "field_type"
t.string "options"
t.boolean "is_retired"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "sessions", force: :cascade do |t|
t.string "session_id", null: false
t.text "data"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", unique: true, using: :btree
add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree
create_table "translation_records", force: :cascade do |t|
t.string "locale"
t.integer "translator_id"
t.string "key"
t.text "value"
t.datetime "created_at"
end
create_table "translations", force: :cascade do |t|
t.string "locale"
t.string "key"
t.text "value"
t.text "interpolations"
t.boolean "is_proc", default: false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "user_organization_relationships", force: :cascade do |t|
t.integer "user_id"
t.integer "organization_id"
t.string "relationship"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "users", force: :cascade do |t|
t.string "username"
t.string "email"
t.string "crypted_password"
t.string "salt"
t.datetime "created_at"
t.datetime "updated_at"
t.string "remember_me_token"
t.datetime "remember_me_token_expires_at"
t.string "reset_password_token"
t.datetime "reset_password_token_expires_at"
t.datetime "reset_password_email_sent_at"
t.string "activation_state"
t.string "activation_token"
t.datetime "activation_token_expires_at"
t.integer "failed_logins_count", default: 0
t.datetime "lock_expires_at"
t.string "unlock_token"
t.string "avatar"
t.text "about_me"
t.string "role"
t.string "firstname"
t.string "lastname"
t.boolean "is_translator"
t.json "languages"
t.string "locale"
t.boolean "is_subscribed"
end
add_index "users", ["activation_token"], name: "index_users_on_activation_token", using: :btree
add_index "users", ["remember_me_token"], name: "index_users_on_remember_me_token", using: :btree
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", using: :btree
create_table "versions", force: :cascade do |t|
t.string "item_type"
t.integer "item_id"
t.string "event"
t.string "whodunnit"
t.text "object"
t.datetime "created_at"
t.string "value"
end
create_table "workshop_facilitators", force: :cascade do |t|
t.integer "user_id"
t.integer "workshop_id"
t.string "role"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "workshop_interests", force: :cascade do |t|
t.integer "workshop_id"
t.integer "user_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "workshop_presentation_styles", force: :cascade do |t|
t.string "name"
t.string "slug"
t.string "info"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "order"
end
create_table "workshop_requested_resources", force: :cascade do |t|
t.integer "workshop_id"
t.integer "workshop_resource_id"
t.string "status"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "workshop_resources", force: :cascade do |t|
t.string "name"
t.string "slug"
t.string "info"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "workshop_streams", force: :cascade do |t|
t.string "name"
t.string "slug"
t.string "info"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "order"
end
create_table "workshops", force: :cascade do |t|
t.string "title"
t.string "slug"
t.text "info"
t.integer "conference_id"
t.integer "workshop_stream_id"
t.integer "workshop_presentation_style"
t.integer "min_facilitators"
t.integer "location_id"
t.datetime "start_time"
t.datetime "end_time"
t.datetime "created_at"
t.datetime "updated_at"
t.string "languages"
t.string "needs"
t.string "space"
t.string "theme"
t.text "host_info"
t.text "notes"
t.string "locale"
t.integer "event_location_id"
t.boolean "needs_facilitators"
t.json "block"
end
end
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160814000940) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "authentications", force: :cascade do |t|
t.integer "user_id", null: false
t.string "provider", null: false
t.string "uid", null: false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "comments", force: :cascade do |t|
t.string "model_type"
t.integer "model_id"
t.text "comment"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "user_id"
end
create_table "conference_admins", force: :cascade do |t|
t.integer "conference_id"
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "conference_host_organizations", force: :cascade do |t|
t.integer "conference_id"
t.integer "organization_id"
t.integer "order"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "conference_registration_form_fields", force: :cascade do |t|
t.integer "conference_id"
t.integer "registration_form_field_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "position"
end
create_table "conference_registration_responses", force: :cascade do |t|
t.integer "conference_registration_id"
t.integer "registration_form_field_id"
t.text "data"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "conference_registrations", force: :cascade do |t|
t.integer "conference_id"
t.integer "user_id"
t.string "is_attending"
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "is_confirmed"
t.boolean "is_participant"
t.boolean "is_volunteer"
t.string "confirmation_token"
t.binary "data"
t.string "email"
t.boolean "complete"
t.boolean "completed"
t.string "payment_confirmation_token"
t.string "payment_info"
t.integer "registration_fees_paid"
t.string "city"
t.datetime "arrival"
t.datetime "departure"
t.string "housing"
t.string "bike"
t.text "other"
t.string "allergies"
t.string "languages"
t.string "food"
t.string "highest_step"
t.json "steps_completed"
t.boolean "can_provide_housing"
t.json "housing_data"
end
create_table "conference_types", force: :cascade do |t|
t.string "title"
t.string "info"
t.datetime "created_at"
t.datetime "updated_at"
t.string "slug"
end
create_table "conferences", force: :cascade do |t|
t.string "title"
t.string "slug"
t.datetime "start_date"
t.datetime "end_date"
t.text "info"
t.string "poster"
t.string "cover"
t.boolean "workshop_schedule_published"
t.boolean "registration_open"
t.boolean "meals_provided"
t.text "meal_info"
t.text "travel_info"
t.integer "conference_type_id"
t.datetime "created_at"
t.datetime "updated_at"
t.text "preregistration_info"
t.text "registration_info"
t.text "postregistration_info"
t.integer "cover_attribution_id"
t.string "cover_attribution_name"
t.string "cover_attribution_src"
t.integer "cover_attribution_user_id"
t.string "locale"
t.string "email_address"
t.string "paypal_email_address"
t.string "paypal_username"
t.string "paypal_password"
t.string "paypal_signature"
t.string "day_parts"
t.string "registration_status"
t.json "meals"
t.json "workshop_blocks"
t.text "payment_message"
t.json "payment_amounts"
end
create_table "delayed_jobs", force: :cascade do |t|
t.integer "priority", default: 0, null: false
t.integer "attempts", default: 0, null: false
t.text "handler", null: false
t.text "last_error"
t.datetime "run_at"
t.datetime "locked_at"
t.datetime "failed_at"
t.string "locked_by"
t.string "queue"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree
create_table "dynamic_translation_records", force: :cascade do |t|
t.string "locale"
t.integer "translator_id"
t.string "model_type"
t.integer "model_id"
t.string "column"
t.text "value"
t.datetime "created_at"
end
create_table "email_confirmations", force: :cascade do |t|
t.string "token"
t.integer "user_id"
t.datetime "expiry"
t.string "url"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "event_locations", force: :cascade do |t|
t.string "title"
t.integer "conference_id"
t.float "latitude"
t.float "longitude"
t.string "address"
t.string "amenities"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "space"
end
create_table "event_types", force: :cascade do |t|
t.string "slug"
t.text "info"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "events", force: :cascade do |t|
t.string "title"
t.string "slug"
t.integer "event_type_id"
t.integer "conference_id"
t.text "info"
t.integer "location_id"
t.datetime "start_time"
t.datetime "end_time"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "event_location_id"
t.string "event_type"
t.string "locale"
end
create_table "locations", force: :cascade do |t|
t.string "title"
t.float "latitude"
t.float "longitude"
t.datetime "created_at"
t.datetime "updated_at"
t.string "country"
t.string "territory"
t.string "city"
t.string "street"
t.string "postal_code"
end
add_index "locations", ["latitude", "longitude"], name: "index_locations_on_latitude_and_longitude", using: :btree
create_table "locations_organizations", id: false, force: :cascade do |t|
t.integer "organization_id"
t.integer "location_id"
end
add_index "locations_organizations", ["organization_id", "location_id"], name: "loc_org_index", using: :btree
create_table "organization_statuses", force: :cascade do |t|
t.string "name"
t.string "slug"
t.string "info"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "organizations", force: :cascade do |t|
t.string "name"
t.string "slug"
t.string "email_address"
t.string "url"
t.integer "year_founded"
t.text "info"
t.string "logo"
t.string "avatar"
t.boolean "requires_approval"
t.string "secret_question"
t.string "secret_answer"
t.integer "user_organization_replationship_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "cover"
t.integer "cover_attribution_id"
t.string "cover_attribution_name"
t.string "cover_attribution_src"
t.string "phone"
t.integer "organization_status_id"
t.integer "cover_attribution_user_id"
t.string "status"
end
create_table "registration_form_fields", force: :cascade do |t|
t.string "title"
t.text "help"
t.boolean "required"
t.string "field_type"
t.string "options"
t.boolean "is_retired"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "sessions", force: :cascade do |t|
t.string "session_id", null: false
t.text "data"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", unique: true, using: :btree
add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree
create_table "translation_records", force: :cascade do |t|
t.string "locale"
t.integer "translator_id"
t.string "key"
t.text "value"
t.date "created_at"
end
create_table "translations", force: :cascade do |t|
t.string "locale"
t.string "key"
t.text "value"
t.text "interpolations"
t.boolean "is_proc", default: false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "user_organization_relationships", force: :cascade do |t|
t.integer "user_id"
t.integer "organization_id"
t.string "relationship"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "users", force: :cascade do |t|
t.string "username"
t.string "email"
t.string "crypted_password"
t.string "salt"
t.datetime "created_at"
t.datetime "updated_at"
t.string "remember_me_token"
t.datetime "remember_me_token_expires_at"
t.string "reset_password_token"
t.datetime "reset_password_token_expires_at"
t.datetime "reset_password_email_sent_at"
t.string "activation_state"
t.string "activation_token"
t.datetime "activation_token_expires_at"
t.integer "failed_logins_count", default: 0
t.datetime "lock_expires_at"
t.string "unlock_token"
t.string "avatar"
t.text "about_me"
t.string "role"
t.string "firstname"
t.string "lastname"
t.boolean "is_translator"
t.json "languages"
t.string "locale"
t.boolean "is_subscribed"
end
add_index "users", ["activation_token"], name: "index_users_on_activation_token", using: :btree
add_index "users", ["remember_me_token"], name: "index_users_on_remember_me_token", using: :btree
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", using: :btree
create_table "versions", force: :cascade do |t|
t.string "item_type"
t.integer "item_id"
t.string "event"
t.string "whodunnit"
t.text "object"
t.datetime "created_at"
t.string "value"
end
create_table "workshop_facilitators", force: :cascade do |t|
t.integer "user_id"
t.integer "workshop_id"
t.string "role"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "workshop_interests", force: :cascade do |t|
t.integer "workshop_id"
t.integer "user_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "workshop_presentation_styles", force: :cascade do |t|
t.string "name"
t.string "slug"
t.string "info"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "order"
end
create_table "workshop_requested_resources", force: :cascade do |t|
t.integer "workshop_id"
t.integer "workshop_resource_id"
t.string "status"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "workshop_resources", force: :cascade do |t|
t.string "name"
t.string "slug"
t.string "info"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "workshop_streams", force: :cascade do |t|
t.string "name"
t.string "slug"
t.string "info"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "order"
end
create_table "workshops", force: :cascade do |t|
t.string "title"
t.string "slug"
t.text "info"
t.integer "conference_id"
t.integer "workshop_stream_id"
t.integer "workshop_presentation_style"
t.integer "min_facilitators"
t.integer "location_id"
t.datetime "start_time"
t.datetime "end_time"
t.datetime "created_at"
t.datetime "updated_at"
t.string "languages"
t.string "needs"
t.string "space"
t.string "theme"
t.text "host_info"
t.text "notes"
t.string "locale"
t.integer "event_location_id"
t.boolean "needs_facilitators"
t.json "block"
end
end

Loading…
Cancel
Save