Fixed registration emails and modified the schedule
This commit is contained in:
parent
2fe8b3c93d
commit
0770fd28e8
@ -2201,6 +2201,10 @@ table.schedule {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0 0 1em;
|
margin: 0 0 1em;
|
||||||
|
|
||||||
|
tbody {
|
||||||
|
border: 0.1rem solid #EEE;
|
||||||
|
}
|
||||||
|
|
||||||
&.locations-1 td.workshop.filled {
|
&.locations-1 td.workshop.filled {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
@ -2225,38 +2229,39 @@ table.schedule {
|
|||||||
width: 16.66667%;
|
width: 16.66667%;
|
||||||
}
|
}
|
||||||
td {
|
td {
|
||||||
//position: relative;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
border: 0;
|
||||||
&.empty {
|
background-color: #F8F8F8;
|
||||||
border-top: 0;
|
|
||||||
border-bottom: 0;
|
|
||||||
background-color: #F8F8F8;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.workshop {
|
&.workshop {
|
||||||
background-color: lighten($colour-1, 40%);
|
|
||||||
|
|
||||||
&.filled {
|
&.filled {
|
||||||
background-color: lighten($colour-1, 25%);
|
background-color: lighten($colour-1, 25%);
|
||||||
|
border: 0.1rem solid #EEE;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.open {
|
&.open {
|
||||||
cursor: pointer;
|
#admin-schedule & {
|
||||||
white-space: nowrap;
|
background-color: lighten($colour-1, 40%);
|
||||||
|
cursor: pointer;
|
||||||
|
white-space: nowrap;
|
||||||
|
border: 0.1rem solid #EEE;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: lighten($colour-1, 25%);
|
background-color: lighten($colour-1, 25%);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.event {
|
&.event {
|
||||||
background-color: lighten($colour-2, 25%);
|
background-color: lighten($colour-2, 25%);
|
||||||
|
border: 0.1rem solid #EEE;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.meal {
|
&.meal {
|
||||||
background-color: lighten($colour-3, 25%);
|
background-color: lighten($colour-3, 25%);
|
||||||
|
border: 0.1rem solid #EEE;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
|
@ -635,7 +635,7 @@ class ApplicationController < LinguaFrancaApplicationController
|
|||||||
} unless amenities.include? need
|
} unless amenities.include? need
|
||||||
end
|
end
|
||||||
|
|
||||||
@schedule[day][:times][time][:item][:workshops][ids[i]][:status][:conflict_score] = workshop_i.interested.present? ? (conflicts.length / workshop_i.interested.size) : 0
|
@schedule[day][:times][time][:item][:workshops][ids[i]][:status][:conflict_score] = (conflicts || []).length
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -201,13 +201,13 @@ class ConferencesController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
# workshops is the last step
|
# workshops is the last step
|
||||||
if @register_template == :workshops
|
# if @register_template == :workshops
|
||||||
UserMailer.send_mail :registration_confirmation do
|
# UserMailer.send_mail :registration_confirmation do
|
||||||
{
|
# {
|
||||||
:args => @registration
|
# :args => @registration
|
||||||
}
|
# }
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
@registration.save!
|
@registration.save!
|
||||||
|
@ -244,9 +244,8 @@ module ApplicationHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def registration_status(registration)
|
def registration_status(registration)
|
||||||
return :unregistered if registration.nil? || registration.user.firstname.blank? || registration.city.blank?
|
return :unregistered if registration.nil?
|
||||||
return :registered if registration.housing.present? || (registration.can_provide_housing && registration.housing_data.present? && registration.housing_data['availability'].present?)
|
return registration.status
|
||||||
return :preregistered
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def sortable(objects, id = 'id', url: nil, &block)
|
def sortable(objects, id = 'id', url: nil, &block)
|
||||||
|
@ -28,4 +28,48 @@ class ConferenceRegistration < ActiveRecord::Base
|
|||||||
def self.all_considerations
|
def self.all_considerations
|
||||||
[:vegan, :smoking, :pets, :quiet]
|
[:vegan, :smoking, :pets, :quiet]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def status(was = false)
|
||||||
|
return :unregistered if user.firstname.blank? || self.send(was ? :city_was : :city).blank?
|
||||||
|
return :registered if self.send(was ? :housing_was : :housing).present? || (self.send(was ? :can_provide_housing_was : :can_provide_housing) && (self.send(was ? :housing_data_was : :housing_data) || {})['availability'].present?)
|
||||||
|
return :preregistered
|
||||||
|
end
|
||||||
|
|
||||||
|
around_update :check_status
|
||||||
|
|
||||||
|
def check_status
|
||||||
|
yield #saves
|
||||||
|
old_status = status(true)
|
||||||
|
new_status = status
|
||||||
|
|
||||||
|
puts " ===== #{old_status.to_s} : #{new_status.to_s} ==> #{conference.registration_status} ===== "
|
||||||
|
if old_status.present? && old_status != new_status
|
||||||
|
if (conference.registration_status == :pre && new_status == :preregistered) ||
|
||||||
|
(conference.registration_status == :open && new_status == :registered)
|
||||||
|
|
||||||
|
UserMailer.send_mail :registration_confirmation do
|
||||||
|
{
|
||||||
|
:args => self
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# before_update do | registration |
|
||||||
|
# old_status = status
|
||||||
|
# new_status = registration.status
|
||||||
|
# puts " ===== #{old_status.to_s} : #{new_status.to_s} ===== "
|
||||||
|
# if old_status.present? && old_status != new_status
|
||||||
|
# if (conference.registration_status == :pre && new_status == :preregistered) ||
|
||||||
|
# (conference.registration_status == :open && new_status == :registered)
|
||||||
|
# end
|
||||||
|
|
||||||
|
# UserMailer.send_mail :registration_confirmation do
|
||||||
|
# {
|
||||||
|
# :args => registration
|
||||||
|
# }
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
|
@ -12,6 +12,10 @@ class User < ActiveRecord::Base
|
|||||||
has_many :authentications, :dependent => :destroy
|
has_many :authentications, :dependent => :destroy
|
||||||
accepts_nested_attributes_for :authentications
|
accepts_nested_attributes_for :authentications
|
||||||
|
|
||||||
|
before_update do |user|
|
||||||
|
user.locale ||= I18n.locale
|
||||||
|
end
|
||||||
|
|
||||||
before_save do |user|
|
before_save do |user|
|
||||||
user.locale ||= I18n.locale
|
user.locale ||= I18n.locale
|
||||||
end
|
end
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
%th.corner
|
%th.corner
|
||||||
- data[:locations].each do | id, location |
|
- data[:locations].each do | id, location |
|
||||||
%th=location.is_a?(Symbol) ? '' : location.title
|
%th=location.is_a?(Symbol) ? '' : location.title
|
||||||
%th.status
|
|
||||||
%tbody
|
%tbody
|
||||||
- data[:times].each do | time, time_data |
|
- data[:times].each do | time, time_data |
|
||||||
%tr
|
%tr
|
||||||
@ -50,8 +49,8 @@
|
|||||||
= form_tag administration_update_path(conference.slug, :schedule), class: 'deschedule-workshop' do
|
= form_tag administration_update_path(conference.slug, :schedule), class: 'deschedule-workshop' do
|
||||||
.status
|
.status
|
||||||
.conflict-score
|
.conflict-score
|
||||||
%span.title Conflict Score:
|
%span.title Conflicts:
|
||||||
%span.value="#{status[:conflict_score] * 100.0}%"
|
%span.value="#{status[:conflict_score]} / #{workshop.interested.size}"
|
||||||
- if status[:errors].present?
|
- if status[:errors].present?
|
||||||
.errors
|
.errors
|
||||||
- status[:errors].each do | error |
|
- status[:errors].each do | error |
|
||||||
@ -60,11 +59,6 @@
|
|||||||
= button_tag :deschedule, value: :deschedule_workshop, class: [:delete, :small]
|
= button_tag :deschedule, value: :deschedule_workshop, class: [:delete, :small]
|
||||||
- elsif @can_edit
|
- elsif @can_edit
|
||||||
.title="Block #{time_data[:item][:block] + 1}"
|
.title="Block #{time_data[:item][:block] + 1}"
|
||||||
%td.status{rowspan: rowspan}
|
|
||||||
- if time_data[:status].present? && time_data[:status][:errors].present?
|
|
||||||
%ul.errors
|
|
||||||
- time_data[:status][:errors].each do | error |
|
|
||||||
%li=error.to_json.to_s
|
|
||||||
- elsif time_data[:type] != :nil
|
- elsif time_data[:type] != :nil
|
||||||
%td{class: time_data[:type], rowspan: rowspan, colspan: data[:locations].present? ? data[:locations].size : 1}
|
%td{class: time_data[:type], rowspan: rowspan, colspan: data[:locations].present? ? data[:locations].size : 1}
|
||||||
- case time_data[:type]
|
- case time_data[:type]
|
||||||
@ -92,7 +86,6 @@
|
|||||||
= time_data[:item].event_location.title + _!(': ')
|
= time_data[:item].event_location.title + _!(': ')
|
||||||
= location_link time_data[:item].event_location
|
= location_link time_data[:item].event_location
|
||||||
= richtext time_data[:item][:info], 1
|
= richtext time_data[:item][:info], 1
|
||||||
%td.status{rowspan: rowspan}
|
|
||||||
- if @entire_page
|
- if @entire_page
|
||||||
#workshop-selector
|
#workshop-selector
|
||||||
= form_tag administration_update_path(@this_conference.slug, :schedule), class: 'workshop-dlg', id: 'workshop-table-form' do
|
= form_tag administration_update_path(@this_conference.slug, :schedule), class: 'workshop-dlg', id: 'workshop-table-form' do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user