Permalink
Browse files

Cleanup trailing whitespace

  • Loading branch information...
sferik committed Sep 14, 2011
1 parent e20e77f commit a39062c2a94906f4409c66802e075e9f3403a062
Showing with 215 additions and 215 deletions.
  1. +3 −3 app/controllers/application_controller.rb
  2. +3 −3 app/controllers/destinations_controller.rb
  3. +29 −29 app/controllers/groups_controller.rb
  4. +3 −3 app/controllers/registrations_controller.rb
  5. +5 −5 app/controllers/students_controller.rb
  6. +2 −2 app/controllers/users_controller.rb
  7. +1 −1 app/helpers/application_helper.rb
  8. +1 −1 app/mailers/notification_mailer.rb
  9. +1 −1 app/models/answer.rb
  10. +2 −2 app/models/checkin.rb
  11. +9 −9 app/models/destination.rb
  12. +1 −1 app/models/group.rb
  13. +4 −4 app/models/logged_message.rb
  14. +3 −3 app/models/question.rb
  15. +4 −4 app/models/student.rb
  16. +1 −1 app/stylesheets/partials/_base.scss
  17. +1 −1 app/stylesheets/partials/_colors.scss
  18. +1 −1 app/stylesheets/partials/_fonts.scss
  19. +1 −1 app/views/admins/_top_bar.html.erb
  20. +2 −2 app/views/destinations/_form.html.erb
  21. +1 −1 app/views/destinations/edit.html.erb
  22. +1 −1 app/views/destinations/responses.html.erb
  23. +1 −1 app/views/destinations/show.html.erb
  24. +1 −1 app/views/devise/confirmations/new.html.erb
  25. +4 −4 app/views/devise/confirmations/show.html.erb
  26. +1 −1 app/views/devise/passwords/edit.html.erb
  27. +1 −1 app/views/devise/passwords/new.html.erb
  28. +1 −1 app/views/devise/sessions/new.html.erb
  29. +1 −1 app/views/devise/shared/_links.erb
  30. +1 −1 app/views/devise/unlocks/new.html.erb
  31. +1 −1 app/views/groups/_ajax_membership_form.html.erb
  32. +1 −1 app/views/groups/_form.html.erb
  33. +1 −1 app/views/groups/_group_list.html.erb
  34. +4 −4 app/views/groups/_member_list.html.erb
  35. +2 −2 app/views/groups/_membership_form.html.erb
  36. +1 −1 app/views/groups/_message.html.erb
  37. +1 −1 app/views/groups/_nav.html.erb
  38. +1 −1 app/views/groups/_send_message.html.erb
  39. +1 −1 app/views/groups/_sidebar.html.erb
  40. +1 −1 app/views/groups/edit.html.erb
  41. +1 −1 app/views/groups/index.html.erb
  42. +1 −1 app/views/groups/members.html.erb
  43. +1 −1 app/views/groups/show.html.erb
  44. +1 −1 app/views/groups/update.js.erb
  45. +1 −1 app/views/layouts/_default_top_bar.html.erb
  46. +16 −16 app/views/layouts/application.html.erb
  47. +1 −1 app/views/registrations/edit_password.html.erb
  48. +7 −7 app/views/registrations/new.html.erb
  49. +1 −1 app/views/students/_form.html.erb
  50. +1 −1 app/views/students/new.html.erb
  51. +1 −1 app/views/students/show.html.erb
  52. +1 −1 app/views/students/update.js.erb
  53. +1 −1 app/views/users/_form.html.erb
  54. +1 −1 app/views/users/_top_bar.html.erb
  55. +1 −1 app/views/users/_user_list.html.erb
  56. +1 −1 app/views/users/edit.html.erb
  57. +1 −1 app/views/users/index.html.erb
  58. +1 −1 app/views/users/new.html.erb
  59. +1 −1 app/views/users/show.html.erb
  60. +1 −1 app/views/users/splash.html.erb
  61. +1 −1 config/application.rb
  62. +1 −1 config/compass.rb
  63. +1 −1 config/environment.rb
  64. +3 −3 config/environments/production.rb
  65. +1 −1 config/environments/test.rb
  66. +5 −5 config/initializers/compass.rb
  67. +2 −2 config/initializers/phone_validator.rb
  68. +1 −1 config/initializers/resque.rb
  69. +5 −5 config/locales/devise.fr.yml
  70. +1 −1 config/locales/devise.pt-BR.yml
  71. +2 −2 config/locales/rails_admin.bg.yml
  72. +2 −2 config/locales/rails_admin.da.yml
  73. +2 −2 config/locales/rails_admin.de.yml
  74. +2 −2 config/locales/rails_admin.es.yml
  75. +2 −2 config/locales/rails_admin.fi.yml
  76. +2 −2 config/locales/rails_admin.fr.yml
  77. +2 −2 config/locales/rails_admin.lt.yml
  78. +2 −2 config/locales/rails_admin.lv.yml
  79. +2 −2 config/locales/rails_admin.mn.yml
  80. +2 −2 config/locales/rails_admin.nl.yml
  81. +2 −2 config/locales/rails_admin.pl.yml
  82. +2 −2 config/locales/rails_admin.pt-BR.yml
  83. +2 −2 config/locales/rails_admin.pt-PT.yml
  84. +2 −2 config/locales/rails_admin.ru.yml
  85. +2 −2 config/locales/rails_admin.sv.yml
  86. +2 −2 config/locales/rails_admin.tr.yml
  87. +2 −2 config/locales/rails_admin.uk.yml
  88. +1 −1 config/locales/rails_admin.zh_cn.yml
  89. +1 −1 config/routes.rb
  90. BIN db/development.sqlite3.backup
  91. +3 −3 db/migrate/20110720040241_add_question_and_answers.rb
  92. +1 −1 db/migrate/20110720043316_add_checkin_to_student.rb
  93. +1 −1 db/seeds.rb
  94. +2 −2 doc/sign_in_process
  95. +2 −2 lib/google_translate.rb
  96. +1 −1 lib/phone_validator.rb
  97. +1 −1 lib/tasks/resque.rake
  98. +2 −2 test/fixtures/students.yml
@@ -1,7 +1,7 @@
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :ensure_domain if Rails.env.production?
-
+
def index
if user_signed_in?
redirect_to :groups
@@ -12,11 +12,11 @@ def index
end
#render welcome page by default
end
-
+
def ensure_domain
if request.env['HTTP_HOST'] != ENV["APP_DOMAIN"]
# HTTP 301 is a "permanent" redirect
redirect_to "http://#{ENV["APP_DOMAIN"]}", :status => 301
end
end
-end
+end
@@ -3,13 +3,13 @@
class DestinationsController < ApplicationController
before_filter :authenticate_user!
before_filter :load_group
-
+
# GET /destinations
# GET /destinations.xml
def index
@destinations = Destination.all
@groups = current_user.groups
-
+
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @destinations }
@@ -125,7 +125,7 @@ def load_group
@group = Group.find(params[:destination][:group_id])
end
end
-
+
def render_csv(filename)
csv_data = CSV.generate {|csv| yield csv}
send_data csv_data, :type=> "text/csv", :filename=> filename, :disposition => "attachment"
@@ -7,7 +7,7 @@ def index
else
@page_title = "Your Groups"
@groups = current_user.groups
- @group = @groups.first #TODO: remember what the user viewed the last time they were on the page
+ @group = @groups.first #TODO: remember what the user viewed the last time they were on the page
@messages = @group.logged_messages.unique_messages.order("created_at DESC")
end
@@ -27,7 +27,7 @@ def show
format.xml { render :xml => @group }
end
end
-
+
def members
@group = current_user.groups.find(params[:id])
@page_title = @group.title
@@ -38,13 +38,13 @@ def members
format.xml { render :xml => @members }
end
end
-
+
def new
@group = current_user.groups.new
@page_title = "New Group"
@students=[Student.new]*10
-
+
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @group }
@@ -63,7 +63,7 @@ def create
@group.phone_number = get_new_phone_number
@group.destination_phone_number = get_new_phone_number
@page_title = "New Groups"
-
+
respond_to do |format|
if @group.save
format.html { redirect_to(group_path(@group), :notice => 'Group was successfully created.') }
@@ -88,7 +88,7 @@ def create
def update
@group = current_user.groups.find(params[:id])
@page_title = "#{@group.title}"
-
+
respond_to do |format|
if @group.update_attributes(params[:group])
@group.reload if @group.students.any?(&:marked_for_destruction?)
@@ -113,34 +113,34 @@ def destroy
format.xml { head :ok }
end
end
-
+
require 'csv'
def bulk_upload_students
@group = current_user.groups.find(params[:id])
-
+
if !@group
#404 or something?
#return
end
-
+
csv = CSV.parse(params[:upload][:csv].read)
-
+
#in future: these might be programatically defined, and possibly merge multiple cells.
retrieve_procs = {
:name => lambda {|row| row[0]},
:phone_number => lambda {|row| row[1]},
:email => lambda {|row| row[2]}
}
-
+
new_students=0
updated_students=0
-
+
csv.each do |row|
#hash.merge(self) accomplishes a .map, but keeps us a hash, not an array.
given = retrieve_procs.merge(retrieve_procs) {|key,value_proc| value_proc[row]}
#TODO: we should check if this is ambiguous, instead of giving priority to the first.
@student = @group.students.where("name = ? OR phone_number = ? OR email = ?",*given.values_at(:name,:phone_number,:email)).first
-
+
if @student
@student.update_attributes(given) #todo: check for errors
updated_students+=1
@@ -158,7 +158,7 @@ def send_message
@group = current_user.groups.find(params[:id])
message = @group.user.display_name+": "+params[:message][:content] #TODO: safety, parsing, whatever.
#TODO: ensure group found
-
+
if params[:commit].match /scheduled/i
time_zone = ActiveSupport::TimeZone["Eastern Time (US & Canada)"] #use eastern time for the input
scheduled_run = time_zone.local(*params[:date].values_at(*%w{year month day hour}).map(&:to_i))
@@ -196,13 +196,13 @@ def receive_message
render :text=>"sent", :status=>202
#needs to return something API-like, yo
end
-
+
#receive a POSTed email as a form from cloudmailin. figure out what to do with it.
def receive_email
-
+
from = params[:from]
body = params[:plain].gsub(/^On .* wrote:\r?$\s*(^>.*$\s*)+/,'') #strip out replies and whatnot
-
+
#if one of the to addresses matches us, use that one. todo - correctly handle mulitple emails, or correctly fail
if params[:to].match(/group\+(\d+)@/) && @group = Group.find($1)
@sender = @group.user.email==from ? @group.user : @group.students.find_by_email(from)
@@ -211,11 +211,11 @@ def receive_email
@sender = @group.user.email==from ? @group.user : @group.students.find_by_email(from)
handle_destination_message(@group,@sender,body)
end
-
-
+
+
render :text => 'success', :status => 200
end
-
+
def load_groups
@groups = current_user.groups.all
end
@@ -226,18 +226,18 @@ def get_new_phone_number
if r[:response].code == 200
return r[:response].parsed_response["href"].match(/\+1(\d{10})/)[1] rescue nil
end
-
+
return nil
end
def destroy_phone_number(num)
$outbound_flocky.destroy_phone_number_synchronous(num)
end
-
+
def handle_group_message(group,sender,message)
return unless [group,sender,message].all?(&:present?)
-
+
sent_by_admin = (sender == group.user)
-
+
case message
when /^\s*#remove[\s_]*me/
unless sent_by_admin
@@ -248,20 +248,20 @@ def handle_group_message(group,sender,message)
unless sent_by_admin
hashtag = $1
@destination = @group.destinations.find_by_hashtag(hashtag)
-
+
if @destination
@destination.checkin(sender)
else
@group.send_message("sorry, '#{hashtag}' doesn't seem to be a valid destination", nil, [sender])
end
-
+
end
else
message = (sent_by_admin ? group.user.display_name : sender.name)+": "+message
group.send_message(message,sender, sent_by_admin ? group.students : [group.user]) #if a student sent it, just send it to teacher. if teacher sent it, push to group
end
end
-
+
def handle_destination_message(group,sender,message)
return if (sender == group.user)
@@ -272,11 +272,11 @@ def handle_destination_message(group,sender,message)
@checkin = sender.active_checkin
@question = @checkin.current_question
sender.answers << Answer.new(:question=>@question, :content=>message)
-
+
@checkin.current_question_index += 1
@checkin.save
@checkin.destination.send_current_question(sender)
end
-
+
end
end
@@ -2,17 +2,17 @@ class RegistrationsController < Devise::RegistrationsController
prepend_before_filter :authenticate_scope!, :only=>[:edit,:update,:destroy,:edit_password, :dont_show_again]
def edit_password
end
-
+
def dont_show_again
current_user.update_attribute(:show_group_number_popup, false)
respond_to do |format|
format.html {redirect_to :back}
format.js {"ok".to_json}
end
end
-
+
def after_inactive_sign_up_path_for(resource)
new_user_confirmation_path
end
-
+
end
@@ -1,6 +1,6 @@
class StudentsController < ApplicationController
before_filter :load_group
-
+
# GET /students
# GET /students.xml
def index
@@ -58,7 +58,7 @@ def create
end
end
end
-
+
def create_multiple
@page_title = "#{@group.title}"
@@ -73,7 +73,7 @@ def create_multiple
format.xml { render :xml => @group.errors, :status => :unprocessable_entity }
end
end
-
+
end
# PUT /students/1
@@ -105,7 +105,7 @@ def destroy
format.xml { head :ok }
end
end
-
+
private
def load_group
if params[:group_id]
@@ -114,4 +114,4 @@ def load_group
@group = Group.find(params[:student][:group_id])
end
end
-end
+end
@@ -59,11 +59,11 @@ def bulk_create
#expects a list of email addresses, either in text or in an uploaded file
#creates users for each address
email_text = params[:upload_file].present? ? params[:upload_file] : params[:emails]
-
+
successful_creates = email_text.split("\n").map do |email|
User.create(:email=>email)
end.count(true)
-
+
if successful_creates > 0
format.html { redirect_to(users_url, :notice => "#{successful_creates} users wer successfully created.") }
else
@@ -2,7 +2,7 @@ module ApplicationHelper
def formatted_date(date)
date.strftime('%m/%d/%Y') unless date.blank?
end
-
+
def formatted_time(time)
time.strftime('%m/%d/%Y %I:%M %p') unless time.blank?
end
@@ -1,6 +1,6 @@
class NotificationMailer < ActionMailer::Base
def notification_email(message,user,group)
- mail(:to=>user.email,
+ mail(:to=>user.email,
:from=>"group+#{group.id}@mail." + ENV["APP_DOMAIN"],
:subject=>"Update from #{group.title}") do |format|
format.text {render :text=>message}
View
@@ -2,4 +2,4 @@ class Answer < ActiveRecord::Base
belongs_to :question
belongs_to :student
validates_uniqueness_of :question_id, :scope=>:student_id
-end
+end
View
@@ -2,8 +2,8 @@ class Checkin < ActiveRecord::Base
belongs_to :destination
belongs_to :student
validates_uniqueness_of :destination_id, :scope => :student_id
-
+
def current_question
destination.questions.all[current_question_index]
end
-end
+end
Oops, something went wrong.

0 comments on commit a39062c

Please sign in to comment.