Skip to content

Commit

Permalink
Moved to GMail and fixed administration errors
Browse files Browse the repository at this point in the history
  • Loading branch information
G0dwin committed Feb 20, 2017
1 parent 8b9a115 commit 888f186
Show file tree
Hide file tree
Showing 18 changed files with 431 additions and 398 deletions.
87 changes: 45 additions & 42 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,34 @@ gem 'pg'
gem 'rake', '11.1.2'
gem 'ruby_dep', '1.3.1' # Lock at 1.3.1 since 1.4 requires ruby 2.5. We should unlock once we upgrade the ruby version on our server

# gem 'bcrypt-ruby', '3.0.0', require: 'bcrypt'
# gem 'bcrypt', '3.1.9'
# gem 'bcrypt', require: :ruby
gem 'rack-mini-profiler'

gem 'haml'
gem 'nokogiri', '~> 1.6.8.rc2'

if Dir.exists?('../lingua_franca')
gem 'lingua_franca', :path => '../lingua_franca'
gem 'lingua_franca', :path => '../lingua_franca'
else
gem 'lingua_franca', :git => 'git://github.com/lingua-franca/lingua_franca.git'
gem 'lingua_franca', :git => 'git://github.com/lingua-franca/lingua_franca.git'
end

gem 'tzinfo-data'
gem 'sass'
gem 'sass-rails'

if Dir.exists?('../bumbleberry')
gem 'bumbleberry', :path => "../bumbleberry"
gem 'bumbleberry', :path => "../bumbleberry"
else
gem 'bumbleberry', :git => 'git://github.com/bumbleberry/bumbleberry.git'
gem 'bumbleberry', :git => 'git://github.com/bumbleberry/bumbleberry.git'
end

if Dir.exists?('../paypal-express')
gem 'paypal-express', :path => "../paypal-express"
gem 'paypal-express', :path => "../paypal-express"
else
gem 'paypal-express', :git => 'git://github.com/bikebike/paypal-express.git'
gem 'paypal-express', :git => 'git://github.com/bikebike/paypal-express.git'
end

gem 'uglifier', '>= 1.3.0'
Expand All @@ -51,52 +54,52 @@ gem 'launchy'
gem 'to_spreadsheet', :git => 'git://github.com/glebm/to_spreadsheet.git'

group :test do
gem 'rspec'
gem 'rspec-rails'
gem 'rspec'
gem 'rspec-rails'
end

group :development do
gem 'better_errors'
gem 'binding_of_caller'
gem 'meta_request'
gem 'capistrano', '~> 3.1'
gem 'capistrano-rails', '~> 1.1'
gem 'capistrano-faster-assets', '~> 1.0'

gem 'eventmachine', :github => 'krzcho/eventmachine', :branch => 'master'
gem 'thin'# , :github => 'krzcho/thin', :branch => 'master'
gem 'better_errors'
gem 'binding_of_caller'
gem 'meta_request'
gem 'capistrano', '~> 3.1'
gem 'capistrano-rails', '~> 1.1'
gem 'capistrano-faster-assets', '~> 1.0'

gem 'eventmachine', :github => 'krzcho/eventmachine', :branch => 'master'
gem 'thin'# , :github => 'krzcho/thin', :branch => 'master'
end

group :test do
gem 'gherkin3', '>= 3.1.0'
gem 'cucumber'
gem 'cucumber-core'
gem 'cucumber-rails'

gem 'poltergeist'
gem 'guard-rspec'
gem 'factory_girl_rails'
gem 'coveralls', require: false
gem 'selenium-webdriver'
gem 'simplecov', require: false
gem 'webmock', require: false
gem 'database_cleaner'
gem 'mocha'
end

group :staging, :production, :preview do
gem 'rails_12factor'
gem 'gherkin3', '>= 3.1.0'
gem 'cucumber'
gem 'cucumber-core'
gem 'cucumber-rails'

gem 'poltergeist'
gem 'guard-rspec'
gem 'factory_girl_rails'
gem 'coveralls', require: false
gem 'selenium-webdriver'
gem 'simplecov', require: false
gem 'webmock', require: false
gem 'database_cleaner'
gem 'mocha'
end

group :production, :preview do
gem 'unicorn'
gem 'daemon-spawn'
gem 'daemons'
gem 'rails_12factor'
gem 'daemon-spawn'
gem 'daemons'

platforms :ruby do
gem 'unicorn'
end
end

platforms 'mswin', 'mingw' do
group :test do
gem 'wdm', '>= 0.1.0'
end
group :test do
gem 'wdm', '>= 0.1.0'
end
end
4 changes: 2 additions & 2 deletions app/assets/stylesheets/bumbleberry-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"chrome": ["51"]
},
"development": {
"and_chr": ["55"],
"chrome": ["55"],
"and_chr": ["56"],
"chrome": ["56"],
"edge": ["13"],
"firefox": ["50"],
"ie": ["11"],
Expand Down
12 changes: 8 additions & 4 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,15 @@ def capture_page_info
end

def home
@workshops = Workshop.where(:conference_id => @conference.id)
@workshops = []

if @conference.workshop_schedule_published
@event_dlg = true
get_scheule_data(false)
if @conference.present?
@workshops = Workshop.where(conference_id: @conference.id)

if @conference.workshop_schedule_published
@event_dlg = true
get_scheule_data(false)
end
end
end

Expand Down
47 changes: 32 additions & 15 deletions app/controllers/conference_administration_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ def admin_update
set_flash_messages

# redirect to the step unless the method handled redirection itself
unless self.send(method_name)
case self.send(method_name)
when true
administration_step(@admin_step)
when false
redirect_to administration_step_path(@this_conference.slug, @admin_step)
end
end
Expand Down Expand Up @@ -100,6 +103,9 @@ def administrate_poster
end

def administrate_broadcast
if @this_conference.start_date.blank? || @this_conference.end_date.blank?
@warning_message = :no_date_warning
end
end

def administrate_broadcast_sent
Expand All @@ -120,6 +126,9 @@ def administrate_paypal
end

def administrate_registration_status
if @this_conference.start_date.blank? || @this_conference.end_date.blank?
@warning_message = :no_date_warning
end
end

def administrate_organizations
Expand Down Expand Up @@ -165,6 +174,11 @@ def administrate_organizations
end

def administrate_registrations
if @this_conference.start_date.blank? || @this_conference.end_date.blank?
@warning_message = :no_date_warning
return
end

get_stats(!request.format.xlsx?)

if request.format.xlsx?
Expand Down Expand Up @@ -200,6 +214,11 @@ def administrate_registrations
end

def administrate_stats
if @this_conference.start_date.blank? || @this_conference.end_date.blank?
@warning_message = :no_date_warning
return
end

get_stats(!request.format.xlsx?)

if request.format.xlsx?
Expand Down Expand Up @@ -736,7 +755,7 @@ def admin_update_administrators
end
else
do_404
return true
return nil
end

return false
Expand Down Expand Up @@ -945,7 +964,7 @@ def admin_update_registrations
do_404
end

return true
return nil
end

def admin_update_housing
Expand Down Expand Up @@ -985,7 +1004,7 @@ def admin_update_housing
do_404
end

return true
return nil
end

def admin_update_broadcast
Expand All @@ -1007,7 +1026,7 @@ def admin_update_broadcast
end
end
redirect_to administration_step_path(@this_conference.slug, :broadcast_sent)
return true
return nil
elsif params[:button] == 'preview'
@send_to_count = view_context.broadcast_to(@send_to).size
@broadcast_step = :preview
Expand All @@ -1024,7 +1043,7 @@ def admin_update_broadcast
end
@send_to_count = view_context.broadcast_to(@send_to).size
end
return false
return true
end

def admin_update_locations
Expand Down Expand Up @@ -1087,14 +1106,14 @@ def admin_update_meals
end

do_404
return true
return nil
end

def admin_update_events
case params[:button]
when 'edit'
redirect_to edit_event_path(@this_conference.slug, params[:id])
return true
return nil
when 'save'
if params[:id].present?
event = Event.find_by!(conference_id: @this_conference.id, id: params[:id])
Expand Down Expand Up @@ -1124,7 +1143,7 @@ def admin_update_events
end

do_404
return true
return nil
end

def admin_update_workshop_times
Expand All @@ -1141,7 +1160,7 @@ def admin_update_workshop_times
end

do_404
return true
return nil
end

def admin_update_schedule
Expand All @@ -1155,7 +1174,6 @@ def admin_update_schedule
@entire_page = false
get_scheule_data
render partial: 'schedule'
return true
when 'get-workshop-list'
get_scheule_data(true)

Expand All @@ -1171,7 +1189,6 @@ def admin_update_schedule
end

render partial: 'select_workshop_table'
return true
when 'set-workshop'
workshop = Workshop.find_by!(conference_id: @this_conference.id, id: params[:workshop].to_i)
workshop.event_location_id = params[:location]
Expand All @@ -1183,11 +1200,11 @@ def admin_update_schedule
get_scheule_data

render partial: 'schedule'
return true
else
do_404
end

do_404
return true
return nil
end

def admin_update_schedule
Expand Down
3 changes: 2 additions & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,8 @@ def administration_steps
def administration_sub_steps
{
location_edit: :locations,
event_edit: :events
event_edit: :events,
broadcast_sent: :broadcast
}
end

Expand Down
27 changes: 13 additions & 14 deletions app/models/event_location.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@
Geocoder::Railtie.insert

class EventLocation < ActiveRecord::Base
belongs_to :conference
geocoded_by :full_address
belongs_to :conference
geocoded_by :full_address

reverse_geocoded_by :latitude, :longitude, :address => :full_address
after_validation :geocode, if: ->(obj){ obj.address_changed? }
reverse_geocoded_by :latitude, :longitude, :address => :full_address
after_validation :geocode, if: ->(obj){ obj.address_changed? }

def full_address
l = conference.location
[address, l.city, l.territory, l.country].join(', ')
end
def full_address
[address, conference.city.city, conference.city.territory, conference.city.country].join(', ')
end

def self.all_spaces
Workshop.all_spaces + [:event_space]
end
def self.all_spaces
Workshop.all_spaces + [:event_space]
end

def self.all_amenities
Workshop.all_needs
end
def self.all_amenities
Workshop.all_needs
end
end
4 changes: 2 additions & 2 deletions app/views/application/home.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- content_for :og_image do
= @conference.poster.full.url || image_path('default_poster.jpg')
- if @conferences
= (@conference.present? ? @conference.poster.full.url : nil) || image_path('default_poster.jpg')
- if @conferences.present?
- @conferences.each do | conference |
= render 'conferences/conference', conference: conference, links: [ :read_more, :register ]
Loading

0 comments on commit 888f186

Please sign in to comment.