Browse Source

Moved to GMail and fixed administration errors

development
Godwin 8 years ago
parent
commit
888f186a34
  1. 13
      Gemfile
  2. 4
      app/assets/stylesheets/bumbleberry-settings.json
  3. 6
      app/controllers/application_controller.rb
  4. 47
      app/controllers/conference_administration_controller.rb
  5. 3
      app/helpers/application_helper.rb
  6. 3
      app/models/event_location.rb
  7. 4
      app/views/application/home.html.haml
  8. 6
      app/views/conference_administration/_broadcast.html.haml
  9. 6
      app/views/conference_administration/_registration_status.html.haml
  10. 8
      app/views/conference_administration/_registrations.html.haml
  11. 6
      app/views/conference_administration/_stats.html.haml
  12. 2
      app/views/conference_administration/administration_step.html.haml
  13. 0
      app/views/conference_administration/stats.html.haml
  14. 0
      app/views/conference_administration/stats.xlsx.haml
  15. 9
      config/environments/preview.rb
  16. 9
      config/environments/production.rb
  17. 4
      config/locales/en.yml
  18. 9
      db/schema.rb

13
Gemfile

@ -5,6 +5,9 @@ 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'
@ -85,14 +88,14 @@ group :test do
gem 'mocha'
end
group :staging, :production, :preview do
gem 'rails_12factor'
end
group :production, :preview do
gem 'unicorn'
gem 'rails_12factor'
gem 'daemon-spawn'
gem 'daemons'
platforms :ruby do
gem 'unicorn'
end
end
platforms 'mswin', 'mingw' do

4
app/assets/stylesheets/bumbleberry-settings.json

@ -5,8 +5,8 @@
"chrome": ["51"]
},
"development": {
"and_chr": ["55"],
"chrome": ["55"],
"and_chr": ["56"],
"chrome": ["56"],
"edge": ["13"],
"firefox": ["50"],
"ie": ["11"],

6
app/controllers/application_controller.rb

@ -78,13 +78,17 @@ class ApplicationController < LinguaFrancaApplicationController
end
def home
@workshops = Workshop.where(:conference_id => @conference.id)
@workshops = []
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
def policy
@is_policy_page = true

47
app/controllers/conference_administration_controller.rb

@ -62,7 +62,10 @@ class ConferenceAdministrationController < ApplicationController
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
@ -100,6 +103,9 @@ class ConferenceAdministrationController < ApplicationController
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
@ -120,6 +126,9 @@ class ConferenceAdministrationController < ApplicationController
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
@ -165,6 +174,11 @@ class ConferenceAdministrationController < ApplicationController
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?
@ -200,6 +214,11 @@ class ConferenceAdministrationController < ApplicationController
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?
@ -736,7 +755,7 @@ class ConferenceAdministrationController < ApplicationController
end
else
do_404
return true
return nil
end
return false
@ -945,7 +964,7 @@ class ConferenceAdministrationController < ApplicationController
do_404
end
return true
return nil
end
def admin_update_housing
@ -985,7 +1004,7 @@ class ConferenceAdministrationController < ApplicationController
do_404
end
return true
return nil
end
def admin_update_broadcast
@ -1007,7 +1026,7 @@ class ConferenceAdministrationController < ApplicationController
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
@ -1024,7 +1043,7 @@ class ConferenceAdministrationController < ApplicationController
end
@send_to_count = view_context.broadcast_to(@send_to).size
end
return false
return true
end
def admin_update_locations
@ -1087,14 +1106,14 @@ class ConferenceAdministrationController < ApplicationController
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])
@ -1124,7 +1143,7 @@ class ConferenceAdministrationController < ApplicationController
end
do_404
return true
return nil
end
def admin_update_workshop_times
@ -1141,7 +1160,7 @@ class ConferenceAdministrationController < ApplicationController
end
do_404
return true
return nil
end
def admin_update_schedule
@ -1155,7 +1174,6 @@ class ConferenceAdministrationController < ApplicationController
@entire_page = false
get_scheule_data
render partial: 'schedule'
return true
when 'get-workshop-list'
get_scheule_data(true)
@ -1171,7 +1189,6 @@ class ConferenceAdministrationController < ApplicationController
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]
@ -1183,11 +1200,11 @@ class ConferenceAdministrationController < ApplicationController
get_scheule_data
render partial: 'schedule'
return true
else
do_404
end
do_404
return true
return nil
end
def admin_update_schedule

3
app/helpers/application_helper.rb

@ -991,7 +991,8 @@ module ApplicationHelper
def administration_sub_steps
{
location_edit: :locations,
event_edit: :events
event_edit: :events,
broadcast_sent: :broadcast
}
end

3
app/models/event_location.rb

@ -11,8 +11,7 @@ class EventLocation < ActiveRecord::Base
after_validation :geocode, if: ->(obj){ obj.address_changed? }
def full_address
l = conference.location
[address, l.city, l.territory, l.country].join(', ')
[address, conference.city.city, conference.city.territory, conference.city.country].join(', ')
end
def self.all_spaces

4
app/views/application/home.html.haml

@ -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 ]

6
app/views/conference_administration/_broadcast.html.haml

@ -1,4 +1,8 @@
= columns(medium: 12) do
- if @warning_message
= columns(medium: 12) do
.warning-info=_"articles.admin.registrations.#{@warning_message}"
- else
= columns(medium: 12) do
= admin_update_form do
- if @broadcast_step == :preview || @broadcast_step == :test
= hidden_field_tag :subject, @subject

6
app/views/conference_administration/_registration_status.html.haml

@ -1,4 +1,8 @@
= columns(medium: 12) do
- if @warning_message
= columns(medium: 12) do
.warning-info=_"articles.admin.registrations.#{@warning_message}"
- else
= columns(medium: 12) do
= form_tag administration_update_path(@this_conference.slug, @admin_step) do
= selectfield :registration_status, @this_conference.registration_status || 'closed', registration_status_options_list, inline_label: true
.actions.left

8
app/views/conference_administration/_registrations.html.haml

@ -1,5 +1,9 @@
- add_inline_script :registrations
= columns(medium: 12) do
- if @warning_message
= columns(medium: 12) do
.warning-info=_"articles.admin.registrations.#{@warning_message}"
- else
- add_inline_script :registrations
= columns(medium: 12) do
.goes-fullscreen#registrations-table
.flex-column
= searchfield :search, nil, big: true, stretch: true

6
app/views/conference_administration/_stats.html.haml

@ -1,4 +1,8 @@
= columns(medium: 12) do
- if @warning_message
= columns(medium: 12) do
.warning-info=_"articles.admin.registrations.#{@warning_message}"
- else
= columns(medium: 12) do
.details
= data_set(:h3, 'articles.admin.stats.headings.completed_registrations') do
= (@completed_registrations || 0).to_s

2
app/views/conference_administration/administration_step.html.haml

@ -35,4 +35,4 @@
= columns(medium: 12) do
%p=((_"articles.admin.#{@admin_group}.descriptions.#{@admin_step}", :s)) unless @hide_description === true
= row do
= render @admin_step
= render @admin_step.to_s

0
app/views/conferences/stats.html.haml → app/views/conference_administration/stats.html.haml

0
app/views/conferences/stats.xlsx.haml → app/views/conference_administration/stats.xlsx.haml

9
config/environments/preview.rb

@ -87,14 +87,13 @@ BikeBike::Application.configure do
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'mail.bikebike.org',
:domain => 'preview.bikebike.org',
:address => 'smtp.gmail.com',
:domain => 'localhost:3000',
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true,
:openssl_verify_mode => 'none',
:user_name => 'info@preview.bikebike.org',
:password => 'test'
:user_name => ENV['MAILER_USER'],
:password => ENV['MAILER_PASSWORD']
}
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true

9
config/environments/production.rb

@ -88,14 +88,13 @@ BikeBike::Application.configure do
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'mail.bikebike.org',
:domain => 'preview.bikebike.org',
:address => 'smtp.gmail.com',
:domain => 'localhost:3000',
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true,
:openssl_verify_mode => 'none',
:user_name => 'info@preview.bikebike.org',
:password => 'test'
:user_name => ENV['MAILER_USER'],
:password => ENV['MAILER_PASSWORD']
}
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true

4
config/locales/en.yml

@ -961,6 +961,8 @@ en:
completed_registrations: Number of registrations
incomplete_registrations: Incomplete registrations
Registrations: Registrations
registrations:
no_date_warning: Before users can register, you must first set your conference start and end dates.
meals:
description: On this page you can schedule the meals that you will be serving.
no_locations_warning: Before you can add meals, you must first add locations.
@ -1054,12 +1056,14 @@ en:
stats: Statistics
registrations: Modify Registrations
broadcast: Contact Users
broadcast_sent: You email has been dispatched
description: Open or close registration, view registration statistics, modify information subbmitted by registratnts and contact users.
descriptions:
registration_status: Open or close registration to your conference.
stats: View a breakdown of statictics, how many users have registered, how much money have been collected, etc.
registrations: View and edit all data collected through the registration process.
broadcast: Send emails to targeted subsets of users.
broadcast_sent: Your email has been queued to send, depending on the number of users you have sent to, it may take several hours to send to everyone.
broadcast:
heading: Broadcast
description: The broadcast tool is used to contact users through email. You can send messages en masse to select groups of users.

9
db/schema.rb

@ -16,15 +16,6 @@ ActiveRecord::Schema.define(version: 20170111172147) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "applications", force: :cascade do |t|
t.string "slug"
t.string "name"
t.string "path"
t.string "url"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "authentications", force: :cascade do |t|
t.integer "user_id", null: false
t.string "provider", null: false

Loading…
Cancel
Save