From 4160a180ed922523d5e109401c6b5b16cfdaa808 Mon Sep 17 00:00:00 2001 From: "Gun.io Whitespace Robot" Date: Tue, 31 Jan 2012 14:45:58 -0500 Subject: [PATCH] Remove whitespace [WhitespaceBot] --- README | 12 +- app/controllers/application_controller.rb | 64 ++++---- app/controllers/comments_controller.rb | 8 +- app/controllers/feedback_controller.rb | 8 +- app/controllers/followers_controller.rb | 10 +- app/controllers/group_members_controller.rb | 10 +- app/controllers/groups_controller.rb | 16 +- app/controllers/sessions_controller.rb | 4 +- app/controllers/users_controller.rb | 36 ++--- app/controllers/votes_controller.rb | 18 +-- app/controllers/water_points_controller.rb | 42 +++--- app/controllers/welcome_controller.rb | 20 +-- app/helpers/application_helper.rb | 6 +- app/helpers/users_helper.rb | 10 +- app/helpers/water_points_helper.rb | 10 +- app/models/avatar.rb | 10 +- app/models/comment.rb | 6 +- app/models/comment_mailer.rb | 8 +- app/models/feedback_mailer.rb | 8 +- app/models/group.rb | 2 +- app/models/group_mailer.rb | 12 +- app/models/group_member.rb | 2 +- app/models/photo.rb | 26 ++-- app/models/user.rb | 4 +- app/models/user_mailer.rb | 14 +- app/models/user_observer.rb | 4 +- app/models/user_service.rb | 22 +-- app/models/vote.rb | 18 +-- app/models/water_point.rb | 26 ++-- app/models/water_point_service.rb | 20 +-- app/stylesheets/iphone.sass | 8 +- app/stylesheets/print.sass | 2 +- app/stylesheets/site2.sass | 34 ++--- .../comment_notification.text.plain.erb | 6 +- app/views/comments/create.js.rjs | 4 +- .../message_to_group.text.plain.erb | 6 +- app/views/group_members/toggle.js.rjs | 2 +- app/views/groups/message.js.rjs | 2 +- app/views/layouts/fullscreen.html.haml | 8 +- app/views/layouts/main.html.haml | 22 +-- app/views/layouts/main.iphone.haml | 24 +-- app/views/sessions/new.haml | 2 +- app/views/shared/sidebox/_mapsearch.haml | 1 - .../shared/sidebox/_mapsearchconfirm.haml | 1 - .../user_mailer/activation.text.plain.erb | 8 +- .../user_mailer/new_password.text.plain.erb | 10 +- .../signup_notification.text.plain.erb | 10 +- app/views/users/_user_bar.haml | 8 +- app/views/users/_user_bar.iphone.haml | 8 +- app/views/votes/_vote.haml | 8 +- app/views/votes/toggle.js.rjs | 2 +- app/views/welcome/index.haml | 2 +- app/views/welcome/index.iphone.haml | 2 +- config/backup.rb | 6 +- config/deploy.rb | 10 +- config/environments/profile.rb | 2 +- config/initializers/inflections.rb | 2 +- config/locales/en.yml | 36 ++--- config/locales/en.yml.terms | 32 ++-- config/routes.rb | 12 +- db/migrate/20091201165648_create_comments.rb | 2 +- .../20091202173526_create_group_members.rb | 2 +- ...0091204133747_create_water_point_photos.rb | 2 +- db/migrate/20091205142340_create_users.rb | 2 +- db/migrate/20091205181242_create_avatars.rb | 2 +- db/migrate/20100613162817_batch_support.rb | 10 +- doc/README_FOR_APP | 2 +- features/language.feature | 7 +- .../step_definitions/water_point_steps.rb | 6 +- features/step_definitions/web_steps.rb | 14 +- features/support/env.rb | 12 +- features/support/paths.rb | 4 +- features/water_point.feature | 6 +- lib/authenticated_system.rb | 16 +- lib/authenticated_test_helper.rb | 2 +- lib/tasks/cucumber.rake | 4 +- public/.htaccess | 8 +- public/home.html | 54 +++---- public/images/layouts.new/it-3.yml | 1 - public/javascripts/application.js | 48 +++--- public/javascripts/clusterer.js | 22 +-- public/javascripts/effects.js | 2 +- public/javascripts/geoRssOverlay.js | 20 +-- public/javascripts/iui.js | 56 +++---- public/javascripts/lightbox.js | 138 +++++++++--------- public/javascripts/markermanager.js | 66 ++++----- public/javascripts/mm/markermanager.js | 82 +++++------ public/javascripts/wms-gs.js | 8 +- public/stylesheets/iui.css | 4 +- script/import/batch_dripplets.rb | 32 ++-- spec/factories/user.rb | 2 +- test/fixtures/users.yml | 12 +- test/functional/sessions_controller_test.rb | 4 +- test/functional/users_controller_test.rb | 6 +- test/profile_test_helper.rb | 2 +- test/test_helper.rb | 2 +- 96 files changed, 697 insertions(+), 701 deletions(-) diff --git a/README b/README index 37ec8ea..de67c4f 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ == Welcome to Rails -Rails is a web-application framework that includes everything needed to create -database-backed web applications according to the Model-View-Control pattern. +Rails is a web-application framework that includes everything needed to create +database-backed web applications according to the Model-View-Control pattern. This pattern splits the view (also called the presentation) into "dumb" templates that are primarily responsible for inserting pre-built data in between HTML tags. @@ -57,14 +57,14 @@ Options +FollowSymLinks +ExecCGI # If you don't want Rails to look in certain directories, # use the following rewrite rules so that Apache won't rewrite certain requests -# +# # Example: # RewriteCond %{REQUEST_URI} ^/notrails.* # RewriteRule .* - [L] # Redirect all requests not available on the filesystem to Rails # By default the cgi dispatcher is used which is very slow -# +# # For better performance replace the dispatcher with the fastcgi one # # Example: @@ -85,7 +85,7 @@ RewriteRule ^(.*)$ dispatch.cgi [QSA,L] # In case Rails experiences terminal errors # Instead of displaying this message you can supply a file here which will be rendered instead -# +# # Example: # ErrorDocument 500 /500.html @@ -132,7 +132,7 @@ and also on programming in general. Debugger support is available through the debugger command when you start your Mongrel or Webrick server with --debugger. This means that you can break out of execution at any point -in the code, investigate and change the model, AND then resume execution! +in the code, investigate and change the model, AND then resume execution! You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug' Example: diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e5ce4a3..4bcb9a7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -7,10 +7,10 @@ class ApplicationController < ActionController::Base include AuthenticatedSystem - + # Scrub sensitive parameters from your log filter_parameter_logging :password, :confirm_password - + before_filter :host_check if ENV["RAILS_ENV"] == 'production' before_filter :session_user_agent_check before_filter :set_locale @@ -18,7 +18,7 @@ class ApplicationController < ActionController::Base #move this to different class? def make_map(type='detail',satellite=false,world=false) - # Create a new map object, also defining the div ("map") + # Create a new map object, also defining the div ("map") # where the map will be rendered in the view @map_type = type.to_sym case @map_type @@ -47,7 +47,7 @@ def make_map(type='detail',satellite=false,world=false) :height => 200 } end - + @map = {}; # ym4r/gm plugin api: http://ym4r.rubyforge.org/ym4r_gm-doc/ @@ -56,21 +56,21 @@ def make_map(type='detail',satellite=false,world=false) @map['zoom'] = 4 else @map['zoom'] = 18 - + end @map['zoom'] = 11 if world - + if !@water_point.blank? && !@water_point.lat.blank? && !@water_point.lng.blank? @map['lat'] = @water_point.lat @map['lng'] = @water_point.lng @map['zoom'] = 18 - + if (@map_type == :detail) or (@map_type == :search) # @map.global_init(@map.enable_google_bar()) #note = @water_point.note.to_s.mb_chars.length > 160 ? @water_point.note.to_s.mb_chars[0,160].to_s+'...' : @water_point.note; note = @water_point.note - + if @map_type == :detail @map['marker_info'] = "#{@water_point.title}
#{note}" else @@ -78,22 +78,22 @@ def make_map(type='detail',satellite=false,world=false) photo = @template.photo_for(@water_point, :large) @map['marker_info'] = "
#{@water_point.title}
#{photo}
"+t('thanks_to')+" #{@water_point.posted_by.login}
" end - - + + @map['marker_title'] = @water_point.title ### Bug in GM library? The following line should work, but instead generates an error: #@map.icon_global_init(GIcon.new(:image => "/images/markers/lightblue.png"), "detail_icon") - ### instead need to specify these other attribs as well, even though gmaps api doesn't require them! - + ### instead need to specify these other attribs as well, even though gmaps api doesn't require them! + + - #@map.icon_global_init(GIcon.new(:image => "/images/markers/lightblue.png", :icon_size => GSize.new(16,16),:icon_anchor => GPoint.new(8.0,8.0),:info_window_anchor => GPoint.new(8.0,8.0),:shadow => "/images/markers/shadow.png", :shadowSize => GSize.new(25.0,16.0)),"detail_icon") #detail_icon = Variable.new("detail_icon") - #marker = GMarker.new([@water_point.lat,@water_point.lng], + #marker = GMarker.new([@water_point.lat,@water_point.lng], # :title=> @water_point.title, # :icon=> detail_icon # ) - #@map.declare_init(marker, "marker") #THANK YOU to this post: http://blog.odeley.com/?p=40 + #@map.declare_init(marker, "marker") #THANK YOU to this post: http://blog.odeley.com/?p=40 #@map.overlay_init(marker) ###@map.record_init 'window.alert("foo "+detail_icon.image+" typeof "+typeof detail_icon+" mic "+marker.getIcon().image);' @@ -104,7 +104,7 @@ def make_map(type='detail',satellite=false,world=false) end else # Default center location. no auto open marker. - #@map.center_zoom_init([41.898,12.518],zoom) + #@map.center_zoom_init([41.898,12.518],zoom) @map['lat'] = 41.898 @map['lng'] = 12.518 end @@ -114,11 +114,11 @@ def make_map(type='detail',satellite=false,world=false) #@map.record_init "window.WH_mgr = new MarkerManager(map);"#,:managed_markers => [managed_markers1,managed_markers2,managed_markers3]) # @map.declare_init(mm,"mgr") - + @map['skip_id'] = @water_point.blank? ? '' : @water_point.id - + #@map.record_init "WH_LoadMarkerFeed(map,window.WH_mgr,'all'"+skip_id+");" - + # Thank you: http://www.daftlogic.com/sandbox-google-maps-centre-crosshairs.htm crosshair_js = < 'en' @@ -174,11 +174,11 @@ def set_locale WillPaginate::ViewHelpers.pagination_options[:previous_label] = I18n.translate('previous') WillPaginate::ViewHelpers.pagination_options[:next_label] = I18n.translate('next') end - + def is_megatron? request.user_agent =~ /\b(Baidu|Gigabot|Googlebot|libwww-perl|lwp-trivial|msnbot|SiteUptime|Slurp|WordPress|ZIBB|ZyBorg)\b/i - end - + end + def session_user_agent_check ################################################## #If user agent matches bot pattern @@ -214,22 +214,22 @@ def admin_required def adjust_format_for_iphone # iPhone sub-comain request # request.format = :iphone if iphone_subdomain? - + # Detect from iPhone user-agent # html and js (or whatever gets generated via xhr by iui OK. json no.) request.format = :iphone if iphone_user_agent? and (request.format != :json) end - + def iphone_user_agent? request.env["HTTP_USER_AGENT"] && request.env["HTTP_USER_AGENT"][/(Mobile\/.+Safari)/] && !request.env["HTTP_USER_AGENT"][/Ipad/] end - + def choose_layout 'main' end - + def choose_layout_OLD if request.format == 'iphone' #debugger @@ -244,8 +244,8 @@ def choose_layout_OLD 'minimal' end else - 'main' - end + 'main' + end end - + end diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index a5e986c..0bb9c28 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -1,9 +1,9 @@ class CommentsController < ApplicationController layout :choose_layout - - before_filter :login_required, :except => [ :index, :show, ] - + + before_filter :login_required, :except => [ :index, :show, ] + # GET /comments # GET /comments.xml def index @@ -55,7 +55,7 @@ def create if @comment.save flash[:notice] = 'Comment was successfully created.' unless request.xhr? #format.html { redirect_to(@comment) } - format.any(:html,:iphone) { if request.xhr? + format.any(:html,:iphone) { if request.xhr? render :partial => 'shared/comment', :locals => {:comment => @comment} else #remove this? diff --git a/app/controllers/feedback_controller.rb b/app/controllers/feedback_controller.rb index e64d72d..401eaff 100644 --- a/app/controllers/feedback_controller.rb +++ b/app/controllers/feedback_controller.rb @@ -1,12 +1,12 @@ class FeedbackController < ApplicationController layout :choose_layout - + def report if params[:ref].blank? params[:ref] = request.referrer end end - + def deliver comment = params[:comment] email = params[:email] @@ -26,9 +26,9 @@ def deliver end end end - + def thanks - + end end diff --git a/app/controllers/followers_controller.rb b/app/controllers/followers_controller.rb index 91bff5a..c70fc19 100644 --- a/app/controllers/followers_controller.rb +++ b/app/controllers/followers_controller.rb @@ -1,10 +1,10 @@ class FollowersController < ApplicationController - before_filter :login_required, :except => [ :index, :show, ] + before_filter :login_required, :except => [ :index, :show, ] def toggle - + #Check whether already subscribed params[:follower][:user_id] = @current_user.id @follower = Follower.find_by_user_id_and_water_point_id(@current_user.id, params[:follower][:water_point_id]) @@ -25,14 +25,14 @@ def toggle if save_attempt format.any(:html,:iphone) { redirect_to('/') } #where to send? format.xml { head :ok } - format.js { head :ok } + format.js { head :ok } else format.any(:html,:iphone) { redirect_to('/') } #where to send? format.xml { render :xml => @follower.errors, :status => :unprocessable_entity } - format.js if request.xhr? { head :unprocessable_entity } + format.js if request.xhr? { head :unprocessable_entity } end end - + end end diff --git a/app/controllers/group_members_controller.rb b/app/controllers/group_members_controller.rb index a26450a..e4b27a8 100644 --- a/app/controllers/group_members_controller.rb +++ b/app/controllers/group_members_controller.rb @@ -1,9 +1,9 @@ class GroupMembersController < ApplicationController - before_filter :login_required, :except => [ :index, :show ] + before_filter :login_required, :except => [ :index, :show ] def toggle - + #Check whether already subscribed params[:group_member][:user_id] = @current_user.id @member = GroupMember.find_by_user_id_and_group_id(@current_user.id, params[:group_member][:group_id]) @@ -29,13 +29,13 @@ def toggle format.js { #get list of members. rjs template needs them. @group = Group.find(params[:group_member][:group_id]) - }#{ head :ok } + }#{ head :ok } else format.any(:html,:iphone) { redirect_to('/') } # error msg? format.xml { render :xml => @member.errors, :status => :unprocessable_entity } - format.js if request.xhr? { head :unprocessable_entity } + format.js if request.xhr? { head :unprocessable_entity } end end - + end end diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 871bf7a..010925a 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -1,7 +1,7 @@ class GroupsController < ApplicationController layout :choose_layout - + before_filter :login_required, :except => [ :index, :show ] before_filter :admin_required, :only => [ :destroy ] # GET /groups @@ -50,7 +50,7 @@ def create - + def message @group = Group.find(params[:id]) # send message to all members. @@ -72,8 +72,8 @@ def message format.js #groups/message.rjs.js end end - - + + ##############The following methods are currently NOT USED. moved them to private so ##############that they cannot be accessed by accident. Once final page flow is confirmed, @@ -108,12 +108,12 @@ def update format.xml { render :xml => @group.errors, :status => :unprocessable_entity } end end - end - - + end + + # GET /groups/1/edit def edit @group = Group.find(params[:id]) end - + end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index a75b8cf..573d5d8 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,10 +1,10 @@ -# This controller handles the login/logout function of the site. +# This controller handles the login/logout function of the site. class SessionsController < ApplicationController layout :choose_layout # render new.rhtml def new - respond_to(:html,:iphone) + respond_to(:html,:iphone) end def create diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 97e88b1..14ec1fd 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -4,11 +4,11 @@ class UsersController < ApplicationController # Protect these actions behind an admin login before_filter :admin_required, :only => [:suspend, :unsuspend, :destroy, :purge] before_filter :find_user, :only => [:suspend, :unsuspend, :destroy, :purge] - - before_filter :login_required, :only => [ :edit, :update ] + + before_filter :login_required, :only => [ :edit, :update ] + - # render new.rhtml def new @user = User.new @@ -19,13 +19,13 @@ def forgot @user = User.new respond_to(:html,:iphone) end - + def forgot_check @user = User.find_by_login_and_email(params[:login],params[:email]) if @user flash[:notice] = t('flash.notice.forgot') #"Please check your email. We have sent you a new password." @user.send_new_password - redirect_back_or_default('/') + redirect_back_or_default('/') else flash.now[:error] = t('flash.error.forgot') #"We couldn't find any account matching that data. Please try again." @login = params[:login] @@ -33,7 +33,7 @@ def forgot_check render :action => 'forgot' end end - + def create logout_keeping_session! params[:user][:locale] ||= @locale @@ -56,7 +56,7 @@ def create render :action => 'new' #@user.errors.push "You must accept the terms of service" end - + end def activate @@ -70,19 +70,19 @@ def activate when params[:activation_code].blank? flash[:error] = t('flash.error.activation.blank') #"The activation code was missing. Please follow the URL from your email." redirect_back_or_default(root_path) - else + else flash[:error] = t('flash.error.activation.invalid') #"We couldn't find a user with that activation code -- check your email? Or maybe you've already activated -- try signing in." redirect_back_or_default(root_path) end end def suspend - @user.suspend! + @user.suspend! redirect_to users_path end def unsuspend - @user.unsuspend! + @user.unsuspend! redirect_to users_path end @@ -97,7 +97,7 @@ def purge @user.destroy redirect_to users_path end - + # There's no page here to update or destroy a user. If you add those, be # smart -- make sure you check that the visitor is authorized to do so, that they # supply their old password along with a new one to update it, etc. @@ -122,7 +122,7 @@ def index when :date {:order=>"created_at DESC"} #most recent end - conditions[:include] = :avatar + conditions[:include] = :avatar conditions[:page] = params[:page] || 1 conditions[:per_page] = 6 @conditions = conditions @@ -143,10 +143,10 @@ def show if @user.state != 'active' or @user.login == 'admin' return redirect_to users_path end - + @page_ancestors = [{:name=>'Community', :url=> users_path}] @bc_title = 'User Profile' - + respond_to do |format| format.html # show.html.erb format.iphone @@ -167,9 +167,9 @@ def edit def update @user = current_user @avatar = @user.avatar - + @service = UserService.new(@user, @avatar) - + params[:user][:last_ip] = request.env['REMOTE_ADDR'] respond_to do |format| if @service.update_attributes(params[:user], params[:avatar_file]) ###@user.update_attributes(params[:user]) @@ -185,12 +185,12 @@ def update end ##################### END methods copied over from previously generated user mode - + protected def find_user @user = User.find(params[:id]) end - + def admin_required unless (logged_in? && @current_user && @current_user.login == 'admin') flash[:error] = t('flash.error.not_allowed') #"Action not allowed." diff --git a/app/controllers/votes_controller.rb b/app/controllers/votes_controller.rb index 111ebd4..fa74f65 100644 --- a/app/controllers/votes_controller.rb +++ b/app/controllers/votes_controller.rb @@ -2,7 +2,7 @@ class VotesController < ApplicationController layout :choose_layout - before_filter :login_required, :except => [ :index, :show, ] + before_filter :login_required, :except => [ :index, :show, ] # GET /votes # GET /votes.xml @@ -50,31 +50,31 @@ def toggle @vote = Vote.new(params[:vote]) save_attempt = @vote.save end - + # Do lookups to populate rjs partial. NB these are similar to water_points_controller#show They should be refactored. @water_point = @vote.water_point @current_vote = current_user && Vote.find_by_user_id_and_water_point_id(@current_user.id, @water_point.id) @subscribed = current_user && Follower.find_by_user_id_and_water_point_id(@current_user.id, @water_point.id) - - + + respond_to do |format| if save_attempt - #format.js { head :ok } - format.any(:html,:iphone) { + #format.js { head :ok } + format.any(:html,:iphone) { if request.xhr? render :partial=>'votes/vote' else - redirect_to(@vote) + redirect_to(@vote) end } #where to send? format.xml { head :ok } else - format.js if request.xhr? { head :unprocessable_entity } + format.js if request.xhr? { head :unprocessable_entity } format.any(:html,:iphone) { render :action => "new" } format.xml { render :xml => @vote.errors, :status => :unprocessable_entity } end end - + end # GET /votes/1/edit diff --git a/app/controllers/water_points_controller.rb b/app/controllers/water_points_controller.rb index 20d4ae5..0eaa4c1 100644 --- a/app/controllers/water_points_controller.rb +++ b/app/controllers/water_points_controller.rb @@ -12,8 +12,8 @@ class WaterPointsController < ApplicationController def index =begin -list of water points, paginated. - filter by up_score (default), commented, recent. +list of water points, paginated. + filter by up_score (default), commented, recent. up_score, commented: pagination only while num is greater than zero -------- @@ -49,13 +49,13 @@ def index if request.format.to_sym == :json {:order=>"visits DESC, created_at DESC", :conditions=>"visits > 0"} else - {:order=>"visits DESC, created_at DESC"} + {:order=>"visits DESC, created_at DESC"} end when :score if request.format.to_sym == :json {:order=>"up_score DESC, created_at DESC", :conditions=>"up_score > 0"} else - {:order=>"up_score DESC, created_at DESC"} + {:order=>"up_score DESC, created_at DESC"} end when :date {:order=>"created_at DESC"} @@ -73,9 +73,9 @@ def index conditions[:bounds] = b end @water_points = WaterPoint.visible.all(conditions) - + # limit based on location? - + else #avoid doing individual select for each result... conditions[:include] = :photo @@ -102,10 +102,10 @@ def show @subscribed = current_user && Follower.find_by_user_id_and_water_point_id(@current_user.id, @water_point.id) make_map('detail') - + @page_ancestors = [{:name=>'Dripplets', :url=> water_points_path}] @bc_title = 'Dripplet' - + respond_to(:html,:iphone) end @@ -116,7 +116,7 @@ def new @water_point = WaterPoint.new respond_to(:html,:iphone) - + end # GET /water_points/1/edit @@ -176,14 +176,14 @@ def create # PUT /water_points/1 # PUT /water_points/1.xml - def update - + def update + @water_point = WaterPoint.find_by_id_and_user_id(params[:id], @current_user.id) -####Begin: adjust for an update +####Begin: adjust for an update #@user = current_user - @photo = @water_point.photo #default is whatever photo (if any) already exists - + @photo = @water_point.photo #default is whatever photo (if any) already exists + if params[:photo_file] && !params[:photo_file].blank? @photo = Photo.new(:uploaded_data => params[:photo_file]) @coords = @photo.getGPS @@ -194,7 +194,7 @@ def update params[:water_point][:lng] = @coords[1] end @service = WaterPointService.new(@water_point, @photo) - save_attempt = @service.update_attributes(params[:water_point], params[:photo_file]) + save_attempt = @service.update_attributes(params[:water_point], params[:photo_file]) else save_attempt = @water_point.update_attributes(params[:water_point]) end @@ -205,11 +205,11 @@ def update flash[:prompt] = t('flash.prompt.wp') #'WaterPoint loaded. Please confirm location to publish.' #format.html { redirect_to(@water_point) } format.any(:html,:iphone) { redirect_to(:action=>:edit,:id=>@water_point.id) } - format.xml { render :xml => @water_point, :status => :created, :location => @water_point } + format.xml { render :xml => @water_point, :status => :created, :location => @water_point } else flash[:notice] = t('flash.notice.wp') #'WaterPoint published.' format.any(:html,:iphone) { redirect_to(@water_point) } - format.xml { head :ok } + format.xml { head :ok } end else format.any(:html,:iphone) { render :action => "edit" } @@ -240,9 +240,9 @@ def disable format.xml { head :ok } end end - + protected - + def log_visit #debugger if session[:user_agent_and_session_ok] @@ -259,7 +259,7 @@ def log_visit end end end - - + + end diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index cc2bf14..1239252 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -1,12 +1,12 @@ class WelcomeController < ApplicationController layout :choose_layout - + # TODO: rename controller. welcome doesn't really fit... def index - @count = WaterPoint.visible.all.count - + @count = WaterPoint.visible.all.count + #get last published water point #@water_point = WaterPoint.visible.last @@ -15,33 +15,33 @@ def index @bc_title = 'Home' respond_to(:html,:iphone) end - + def map @water_point = WaterPoint.visible.with_photo.last make_map('search', nil, true) #centered on latest wp with photo, using special detail view. - + respond_to(:html,:iphone) end - + def links respond_to(:html,:iphone) end - + def terms respond_to(:html,:iphone) end - + def story respond_to(:html,:iphone) end - + def credits respond_to(:html,:iphone) end - + def netiquette respond_to(:html,:iphone) end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index db2356e..3079a2f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -5,11 +5,11 @@ module ApplicationHelper def vote_up(water_point) vote(water_point,1,'upvote','downvote') end - + def vote_down(water_point) vote(water_point,-1,'downvote','upvote') end - + def vote(water_point,rating,which_on,which_off) remote_function(:url => "/#{@locale}/votes/toggle", :method => :post, @@ -38,5 +38,5 @@ def deferred(&block) @deferred_content ||= "" @deferred_content << capture(&block) end - + end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index bdb4617..07afadd 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -1,5 +1,5 @@ module UsersHelper - + # # Use this to wrap view elements that the user can't access. # !! Note: this is an *interface*, not *security* feature !! @@ -8,7 +8,7 @@ module UsersHelper # Example: # <%= if_authorized?(:index, User) do link_to('List all users', users_path) end %> | # <%= if_authorized?(:edit, @user) do link_to('Edit this user', edit_user_path) end %> | - # <%= if_authorized?(:destroy, @user) do link_to 'Destroy', @user, :confirm => 'Are you sure?', :method => :delete end %> + # <%= if_authorized?(:destroy, @user) do link_to 'Destroy', @user, :confirm => 'Are you sure?', :method => :delete end %> # # def if_authorized?(action, resource, &block) @@ -55,7 +55,7 @@ def link_to_user(user, options={}) # # Link to login page using remote ip address as link content # - # The :title (and thus, tooltip) is set to the IP address + # The :title (and thus, tooltip) is set to the IP address # # Examples: # link_to_login_with_IP @@ -85,7 +85,7 @@ def link_to_current_user(options={}) else content_text = options.delete(:content_text) || 'not signed in' # kill ignored options from link_to_user - [:content_method, :title_method].each{|opt| options.delete(opt)} + [:content_method, :title_method].each{|opt| options.delete(opt)} link_to_login_with_IP content_text, options end end @@ -94,7 +94,7 @@ def link_to_current_user(options={}) # attachment_fu helper. avatar pic # def avatar_for(user, size = :medium) - if user.avatar + if user.avatar photo_image = user.avatar.public_filename(size) link_to image_tag(photo_image, :class=>'avatar'), user.avatar.public_filename, :rel=>'lightbox', :title=>(h user.login) else diff --git a/app/helpers/water_points_helper.rb b/app/helpers/water_points_helper.rb index f927c88..ce77711 100644 --- a/app/helpers/water_points_helper.rb +++ b/app/helpers/water_points_helper.rb @@ -1,17 +1,17 @@ module WaterPointsHelper def photo_for(water_point, size = :medium) - if water_point.photo + if water_point.photo photo_image = water_point.photo.public_filename(size) link_to image_tag(photo_image, :class=>'photo'), water_point.photo.public_filename, :rel=>'lightbox', :title=>(h water_point.title) elsif water_point.photo_url - link_to image_tag(water_point.photo_url, :class=>'photo', - :width=>Photo.attachment_options[:thumbnails][size].split('x')[0]), + link_to image_tag(water_point.photo_url, :class=>'photo', + :width=>Photo.attachment_options[:thumbnails][size].split('x')[0]), water_point.photo_url, :rel=>'lightbox', :title=>(h water_point.title) else image_tag("blank-photo-#{size}.png", :class=>'photo') end end - + def remove_comment(comment) remote_function(:url => url_for(comment), :method => :put, @@ -19,6 +19,6 @@ def remove_comment(comment) :complete => "Element.hide('comment-#{comment.id}')", :with => "'comment[enabled]=0'") end - + end diff --git a/app/models/avatar.rb b/app/models/avatar.rb index 1809078..33d1f10 100644 --- a/app/models/avatar.rb +++ b/app/models/avatar.rb @@ -18,15 +18,15 @@ class Avatar < ActiveRecord::Base belongs_to :user - - has_attachment :content_type => :image, - :storage => :file_system, + + has_attachment :content_type => :image, + :storage => :file_system, :max_size => 2.megabytes, :resize_to => '384x384', - :thumbnails => { + :thumbnails => { :large => '96x96', :medium => '64x64', - :small => '32x32' + :small => '32x32' } validates_as_attachment diff --git a/app/models/comment.rb b/app/models/comment.rb index 93b4685..0b2b1cf 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -16,11 +16,11 @@ class Comment < ActiveRecord::Base belongs_to :water_point #water_points.comments_count filled via update_comment_count() method below belongs_to :author, :class_name => 'User', :foreign_key => "user_id" - + validates_presence_of :text validates_presence_of :water_point_id validates_presence_of :user_id - + named_scope :visible, :conditions => {:enabled => true } after_save :update_comment_count @@ -31,5 +31,5 @@ def update_comment_count #credit for this approach: http://blog.eldoy.com/posts/14-Custom-counter-cache-column self.water_point.update_attributes :comments_count => self.water_point.comments.visible.count end - + end diff --git a/app/models/comment_mailer.rb b/app/models/comment_mailer.rb index af26c8e..2d45c51 100644 --- a/app/models/comment_mailer.rb +++ b/app/models/comment_mailer.rb @@ -1,17 +1,17 @@ class CommentMailer < ActionMailer::Base layout 'mailer' #use mailer.text.(html|plain).erb as the layout - + # call once per follower (do offline if need to scale. use delayed_job's "send_later") def comment_notification(comment, water_point, follower) setup_email(comment, water_point, follower) @subject += I18n.t 'mailer.comment_notify.subject' - + @body[:url] = "http://www.dripplet.com/#{@locale}/water_points/#{water_point.id}" - + end - + protected def setup_email(comment, water_point, follower) @recipients = "#{follower.user.email}" diff --git a/app/models/feedback_mailer.rb b/app/models/feedback_mailer.rb index 9b45acf..ad98244 100644 --- a/app/models/feedback_mailer.rb +++ b/app/models/feedback_mailer.rb @@ -1,16 +1,16 @@ class FeedbackMailer < ActionMailer::Base layout 'mailer' #use mailer.text.(html|plain).erb as the layout - + # call once per follower (do offline if need to scale. use delayed_job's "send_later") def feedback(comment, email, reason, ref) setup_email(comment, email, reason) @subject += reason - + @body[:url] = ref - + end - + protected def setup_email(comment, email, reason) @recipients = "info@madeintomorrow.com" diff --git a/app/models/group.rb b/app/models/group.rb index b8c36e9..af8735f 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -22,5 +22,5 @@ class Group < ActiveRecord::Base def before_save self.lowercase_title = self.title.mb_chars.downcase end - + end diff --git a/app/models/group_mailer.rb b/app/models/group_mailer.rb index 1c1fe9f..757fc33 100644 --- a/app/models/group_mailer.rb +++ b/app/models/group_mailer.rb @@ -1,18 +1,18 @@ class GroupMailer < ActionMailer::Base - + layout 'mailer' #use mailer.text.(html|plain).erb as the layout # call once per member (do offline if need to scale. use delayed_job's "send_later") def message_to_group(message, group, member, sender) setup_email(message, group, member, sender) - - @subject += I18n.t 'mailer.group_notify.subject', :title=>group.title, :from=>sender.login + + @subject += I18n.t 'mailer.group_notify.subject', :title=>group.title, :from=>sender.login #@subject += 'Message to group '+group.title+' from '+sender.login - + @body[:url] = "http://www.dripplet.com/#{@locale}/groups/#{group.id}" - + end - + protected def setup_email(message, group, member, sender) @recipients = "#{member.user.email}" diff --git a/app/models/group_member.rb b/app/models/group_member.rb index 4502472..3b534eb 100644 --- a/app/models/group_member.rb +++ b/app/models/group_member.rb @@ -13,5 +13,5 @@ class GroupMember < ActiveRecord::Base belongs_to :group belongs_to :user - + end diff --git a/app/models/photo.rb b/app/models/photo.rb index 1b50c48..35e63aa 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -19,30 +19,30 @@ #--- # Excerpted from "Advanced Rails Recipes", # published by The Pragmatic Bookshelf. -# Copyrights apply to this code. It may not be used to create training material, +# Copyrights apply to this code. It may not be used to create training material, # courses, books, articles, and the like. Contact us if you are in doubt. -# We make no guarantees that this code is fit for any purpose. +# We make no guarantees that this code is fit for any purpose. # Visit http://www.pragmaticprogrammer.com/titles/fr_arr for more book information. #--- class Photo < ActiveRecord::Base belongs_to :water_point - - has_attachment :content_type => :image, - :storage => :file_system, + + has_attachment :content_type => :image, + :storage => :file_system, :max_size => 2.megabytes, :resize_to => '640x480>', - :thumbnails => { + :thumbnails => { :large => '96x96>', :medium => '64x64>', - :small => '48x48>' + :small => '48x48>' } validates_as_attachment require 'exifr' require 'flt' include Flt - + def getGPS logger.info("getGPS begin") # EXIFR::JPEG.new('public/images/foto.jpg').gps_latitude @@ -63,24 +63,24 @@ def getGPS [latdec, londec] end end - + end =begin - validate :attachment_valid? + validate :attachment_valid? def attachment_valid? unless self.filename - errors.add_to_base("No cover image file was selected") + errors.add_to_base("No cover image file was selected") end - + content_type = attachment_options[:content_type] unless content_type.nil? || content_type.include?(self.content_type) errors.add_to_base("Cover image content type must an image") end - + size = attachment_options[:size] unless size.nil? || size.include?(self.size) errors.add_to_base("Cover image must be 500-KB or less") diff --git a/app/models/user.rb b/app/models/user.rb index 20151d5..b65d252 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -72,7 +72,7 @@ class User < ActiveRecord::Base # Authenticates a user by their login name and unencrypted password. Returns the user or nil. # - # uff. this is really an authorization, not authentication routine. + # uff. this is really an authorization, not authentication routine. # We really need a Dispatch Chain here or something. # This will also let us return a human error message. # @@ -109,7 +109,7 @@ def send_new_password protected - + def make_activation_code self.deleted_at = nil self.activation_code = self.class.make_token diff --git a/app/models/user_mailer.rb b/app/models/user_mailer.rb index 555342c..0c5da5f 100644 --- a/app/models/user_mailer.rb +++ b/app/models/user_mailer.rb @@ -5,26 +5,26 @@ class UserMailer < ActionMailer::Base def signup_notification(user) setup_email(user) @subject += I18n.t 'mailer.signup.subject' - + @body[:url] = "http://www.dripplet.com/#{user.locale}/activate/#{user.activation_code}" - + end - + def activation(user) setup_email(user) @subject += I18n.t 'mailer.activated.subject' @body[:url] = "http://www.dripplet.com/#{user.locale}" - + end - + def new_password(user,pass) - logger.info("user_mailer.send_new_password called") + logger.info("user_mailer.send_new_password called") setup_email(user) @subject += I18n.t 'mailer.forgot_password.subject' @body[:pass] = pass @body[:url] = "http://www.dripplet.com/#{user.locale}/login" end - + protected def setup_email(user) @recipients = "#{user.email}" diff --git a/app/models/user_observer.rb b/app/models/user_observer.rb index 1b5dddd..399e203 100644 --- a/app/models/user_observer.rb +++ b/app/models/user_observer.rb @@ -5,8 +5,8 @@ def after_create(user) end def after_save(user) - user.reload + user.reload UserMailer.deliver_activation(user) if user.recently_activated? and user.batch_id.nil? - + end end diff --git a/app/models/user_service.rb b/app/models/user_service.rb index 095bc35..d558b71 100644 --- a/app/models/user_service.rb +++ b/app/models/user_service.rb @@ -1,21 +1,21 @@ #--- # Excerpted from "Advanced Rails Recipes", # published by The Pragmatic Bookshelf. -# Copyrights apply to this code. It may not be used to create training material, +# Copyrights apply to this code. It may not be used to create training material, # courses, books, articles, and the like. Contact us if you are in doubt. -# We make no guarantees that this code is fit for any purpose. +# We make no guarantees that this code is fit for any purpose. # Visit http://www.pragmaticprogrammer.com/titles/fr_arr for more book information. #--- class UserService - + attr_reader :user, :avatar - + def initialize(user, avatar) @user = user @avatar = avatar end - + def save return false unless valid? begin @@ -33,12 +33,12 @@ def save end end - def valid? + def valid? @user.valid? && @avatar && @avatar.valid? end - - - + + + def update_attributes(user_attributes, avatar_file) @user.attributes = user_attributes unless avatar_file.blank? @@ -46,8 +46,8 @@ def update_attributes(user_attributes, avatar_file) end save end - - + + end diff --git a/app/models/vote.rb b/app/models/vote.rb index 90f45b8..327ae40 100644 --- a/app/models/vote.rb +++ b/app/models/vote.rb @@ -14,33 +14,33 @@ class Vote < ActiveRecord::Base belongs_to :user belongs_to :water_point - + validates_presence_of :rating validates_presence_of :water_point_id validates_presence_of :user_id - + named_scope :up, :conditions => {:rating => 1} named_scope :down, :conditions => {:rating => -1} - + after_save :update_vote_count after_destroy :update_vote_count before_save :prevent_vote_for_self - - + + def update_vote_count #credit for this approach: http://blog.eldoy.com/posts/14-Custom-counter-cache-column self.water_point.update_attributes :up_score => self.water_point.votes.up.count self.water_point.update_attributes :down_score => self.water_point.votes.down.count self.water_point.reload - self.water_point.posted_by.update_attribute(:up_scores, self.water_point.posted_by.calculate_up_scores) + self.water_point.posted_by.update_attribute(:up_scores, self.water_point.posted_by.calculate_up_scores) end - + protected def prevent_vote_for_self if self.water_point.posted_by.id == self.user_id raise "Can't vote for one's own waterpoint." end - + end - + end diff --git a/app/models/water_point.rb b/app/models/water_point.rb index da904aa..8c2ab90 100644 --- a/app/models/water_point.rb +++ b/app/models/water_point.rb @@ -22,16 +22,16 @@ # class WaterPoint < ActiveRecord::Base - + acts_as_mappable - + has_many :comments, :dependent => :destroy has_many :votes, :dependent => :destroy has_many :followers, :dependent => :destroy has_one :photo, :dependent => :destroy - belongs_to :posted_by, :class_name => 'User', :foreign_key => "user_id" - - ###### Easier to just delegate this to app flow. creation: lat/lng empty. confirm: provided from map. + belongs_to :posted_by, :class_name => 'User', :foreign_key => "user_id" + + ###### Easier to just delegate this to app flow. creation: lat/lng empty. confirm: provided from map. # validates_presence_of :lat # validates_numericality_of :lat # validates_presence_of :lng @@ -39,11 +39,11 @@ class WaterPoint < ActiveRecord::Base validates_presence_of :title validates_presence_of :user_id - - named_scope :visible, :conditions => {:confirmed => true, :state => "active" } + + named_scope :visible, :conditions => {:confirmed => true, :state => "active" } named_scope :filo, :order => "created_at DESC" named_scope :with_photo, {:joins => :photo} - + after_save :update_wp_count after_destroy :update_wp_count @@ -52,16 +52,16 @@ class WaterPoint < ActiveRecord::Base # u.water_points_count = u.water_points.visible.count # u.save # end - + def update_wp_count #credit for this approach: http://blog.eldoy.com/posts/14-Custom-counter-cache-column self.posted_by.update_attribute :water_points_count, self.posted_by.water_points.visible.count end - + def delete! self.update_attribute :state, "deleted" end - + def addr=(address) if address.nil? or address.length < 3 #do nothing @@ -71,10 +71,10 @@ def addr=(address) self.lat, self.lng = geo.lat, geo.lng if geo.success end end - + def addr #this method added for now just so csv-mapper won't complain. could add a reverse geocode call if this were ever needed. nil end - + end diff --git a/app/models/water_point_service.rb b/app/models/water_point_service.rb index e98c568..172d757 100644 --- a/app/models/water_point_service.rb +++ b/app/models/water_point_service.rb @@ -1,21 +1,21 @@ #--- # Excerpted from "Advanced Rails Recipes", # published by The Pragmatic Bookshelf. -# Copyrights apply to this code. It may not be used to create training material, +# Copyrights apply to this code. It may not be used to create training material, # courses, books, articles, and the like. Contact us if you are in doubt. -# We make no guarantees that this code is fit for any purpose. +# We make no guarantees that this code is fit for any purpose. # Visit http://www.pragmaticprogrammer.com/titles/fr_arr for more book information. #--- class WaterPointService - + attr_reader :water_point, :photo - + def initialize(water_point, photo) @water_point = water_point @photo = photo end - + def save return false unless valid? begin @@ -36,9 +36,9 @@ def save def valid? @water_point.valid? && @photo && @photo.valid? end - - - + + + def update_attributes(water_point_attributes, photo_file) @water_point.attributes = water_point_attributes unless photo_file.blank? @@ -46,8 +46,8 @@ def update_attributes(water_point_attributes, photo_file) end save end - - + + end diff --git a/app/stylesheets/iphone.sass b/app/stylesheets/iphone.sass index 319a209..03fa886 100644 --- a/app/stylesheets/iphone.sass +++ b/app/stylesheets/iphone.sass @@ -12,7 +12,7 @@ -moz-border-radius: $radius -webkit-border-radius: $radius border-radius: $radius - + //my colors $bgcolor: #ccc $pagecolor: #fff @@ -114,7 +114,7 @@ a //float: left display: none //too large to fit. need new image... - width: 360px + width: 360px height: 80px a display: block @@ -132,7 +132,7 @@ input[type = 'text'], input[type = 'file'] textarea /* nothing - + /* form error handling .fieldWithErrors input @@ -162,7 +162,7 @@ textarea .summary color: #999 - + diff --git a/app/stylesheets/print.sass b/app/stylesheets/print.sass index 34991ca..ef3e4b4 100644 --- a/app/stylesheets/print.sass +++ b/app/stylesheets/print.sass @@ -2,5 +2,5 @@ Welcome to Compass. Use this file to define print styles. Import this file using the following HTML or equivalent: - + diff --git a/app/stylesheets/site2.sass b/app/stylesheets/site2.sass index 8c0a122..cfb0ff5 100644 --- a/app/stylesheets/site2.sass +++ b/app/stylesheets/site2.sass @@ -12,7 +12,7 @@ -moz-border-radius: $radius -webkit-border-radius: $radius border-radius: $radius - + //my colors $bgcolor: #ccc $pagecolor: #fff @@ -73,7 +73,7 @@ $error_right_gutter: 0px //*/ -/* +/* +grid(24, 24) +alpha +omega @@ -94,7 +94,7 @@ $error_right_gutter: 0px background-color: $pagecolor border: none //need to specify border-color for IE 6 and 7... - border-color: $pagecolor + border-color: $pagecolor +rounded-corners-nohtc(11px) #controls +grid(11,24) @@ -130,7 +130,7 @@ $error_right_gutter: 0px #logos +grid(12,24) +alpha - padding-left: $left_gutter + padding-left: $left_gutter width: auto #logo display: inline @@ -223,7 +223,7 @@ $error_right_gutter: 0px margin-bottom: 20px form margin: 20px 0 - input + input /* paypal image input... width: 160px height: 47px @@ -260,7 +260,7 @@ $error_right_gutter: 0px margin-left: 20px #footer_right +grid(9,24) - /* leave room for margins... + /* leave room for margins... +omega text-align: right margin-right: 20px @@ -428,7 +428,7 @@ textarea padding-top: 34px padding-bottom: 10px padding-right: $summary_right_gutter - + #errorExplanation margin-right: $error_right_gutter width: auto @@ -936,7 +936,7 @@ label +alpha color: #000 font-size: 14px - font-weight: normal + font-weight: normal .notify, .upload, .hint, .hint p color: #000 font-size: 14px @@ -992,12 +992,12 @@ label .wpdetailwrapper /* column 1 bgcolor - /* background-color: #d8d8d8 + /* background-color: #d8d8d8 /* commented out for IE7... width: 100% position: relative float: left - /* right: 50% + /* right: 50% right: 80% /* what is the correct width to set? /* padding-top: 4px @@ -1011,11 +1011,11 @@ label /*otherwise layout breaks with long descriptions... background-color: #eeeeee /* display: block - /* width: 46% + /* width: 46% width: 80% /* what is the correct width? - /* left: 52% - left: 80% + /* left: 52% + left: 80% /* what is the correct width? position: relative overflow: hidden @@ -1044,14 +1044,14 @@ label position: relative overflow: hidden /* width: 46% - width: 20% + width: 20% /* what is the correct width? - /* left: 56% + /* left: 56% left: 80% /* what is the correct width? float: left /* height: 90px - + .wpinner margin: 6px @@ -1301,7 +1301,7 @@ form.new_group input, input.subscription .promo_one, .promo_two margin-top: 30px -/* infowindow popup (maps) +/* infowindow popup (maps) #popup overflow: auto min-height: 100px diff --git a/app/views/comment_mailer/comment_notification.text.plain.erb b/app/views/comment_mailer/comment_notification.text.plain.erb index 68e7ce1..b9e3f2d 100644 --- a/app/views/comment_mailer/comment_notification.text.plain.erb +++ b/app/views/comment_mailer/comment_notification.text.plain.erb @@ -1,6 +1,6 @@ -<%= I18n.t 'mailer.comment_notify.text', +<%= I18n.t 'mailer.comment_notify.text', :author => @comment.author.login, :text => @comment.text, - :link => @url, - :url => @url + :link => @url, + :url => @url %> diff --git a/app/views/comments/create.js.rjs b/app/views/comments/create.js.rjs index 458e34b..8138f7b 100644 --- a/app/views/comments/create.js.rjs +++ b/app/views/comments/create.js.rjs @@ -2,5 +2,5 @@ page.insert_html :bottom, :comments, :partial => 'shared/comment', :locals => {: #page.visual_effect(:fade, 'add_comment', :duration => 0.5) page[:add_comment_text].value = '' #page[:add_comment_form].reset -page.visual_effect(:slide_down, 'thanks', :duration => 2.0) -#page.visual_effect(:slide_up, 'thanks', :duration => 2.0) \ No newline at end of file +page.visual_effect(:slide_down, 'thanks', :duration => 2.0) +#page.visual_effect(:slide_up, 'thanks', :duration => 2.0) \ No newline at end of file diff --git a/app/views/group_mailer/message_to_group.text.plain.erb b/app/views/group_mailer/message_to_group.text.plain.erb index 19e0aa1..e56fec8 100644 --- a/app/views/group_mailer/message_to_group.text.plain.erb +++ b/app/views/group_mailer/message_to_group.text.plain.erb @@ -1,7 +1,7 @@ -<%= I18n.t 'mailer.group_notify.text', +<%= I18n.t 'mailer.group_notify.text', :author => (h @sender), :text => (h @message), :title => (h @group.title), - :link => @url, - :url => @url + :link => @url, + :url => @url %> \ No newline at end of file diff --git a/app/views/group_members/toggle.js.rjs b/app/views/group_members/toggle.js.rjs index c701ebe..aed2bc6 100644 --- a/app/views/group_members/toggle.js.rjs +++ b/app/views/group_members/toggle.js.rjs @@ -1,2 +1,2 @@ page.replace_html :members, :partial => 'groups/members' -page.visual_effect(:slide_down, 'memberlistupdated', :duration => 2.0) +page.visual_effect(:slide_down, 'memberlistupdated', :duration => 2.0) diff --git a/app/views/groups/message.js.rjs b/app/views/groups/message.js.rjs index 50e3183..3270a10 100644 --- a/app/views/groups/message.js.rjs +++ b/app/views/groups/message.js.rjs @@ -1,2 +1,2 @@ page[:send_message_text].value = '' -page.visual_effect(:slide_down, 'thanks', :duration => 2.0) +page.visual_effect(:slide_down, 'thanks', :duration => 2.0) diff --git a/app/views/layouts/fullscreen.html.haml b/app/views/layouts/fullscreen.html.haml index 077670b..519d4a0 100644 --- a/app/views/layouts/fullscreen.html.haml +++ b/app/views/layouts/fullscreen.html.haml @@ -5,7 +5,7 @@ %title = t('layouts.main.page_title') = stylesheet_link_tag :all, :cache => true - / Make the document body take up the full screen + / Make the document body take up the full screen :css v\:* {behavior:url(#default#VML);} html, body {width: 100%; height: 100%} @@ -37,12 +37,12 @@ #map{:style => "width:99%; height:80%; margin:0; padding:0; margin:0 auto;"} = javascript_include_tag "prototype", "effects", "builder", "dragdrop", "controls", "application", "lightbox", :cache => true - if @map - / begin map header + / begin map header :javascript var mgr; var feed_type; = GMap.header(:hl=>"#{@locale}") = @map.to_html - / end map header - / deferred javascript calls + / end map header + / deferred javascript calls = @deferred_content diff --git a/app/views/layouts/main.html.haml b/app/views/layouts/main.html.haml index 55c7620..ca9a108 100644 --- a/app/views/layouts/main.html.haml +++ b/app/views/layouts/main.html.haml @@ -22,20 +22,20 @@ = javascript_include_tag "mm/markermanager_packed" - / begin map header + / begin map header :javascript var mgr; var feed_type; var map; var id_to_skip; - :css + :css v:* { behavior:url(#default#VML);} #map { width: #{@map_conf[:width]}px; height: #{@map_conf[:height]}px; } - + :javascript var infowindow = new google.maps.InfoWindow({maxWidth: 500}); var geocoder; @@ -69,7 +69,7 @@ infowindow.open(map,marker); }); infowindow.open(map,marker); - //invoking open the auto-pan does not add vertical space for the menu the way it does on click. + //invoking open the auto-pan does not add vertical space for the menu the way it does on click. //map.panTo(marker.getPosition()); //map.panBy(0,200); @@ -116,7 +116,7 @@ #content #side #breadcrumb - = t('.breadcrumb_in') + = t('.breadcrumb_in') - # ancestors breadcrumb does not fit in layout. skip it. - if @page_ancestors and false - for page in @page_ancestors.reverse @@ -145,11 +145,11 @@ %img{:alt => "", :border => "0", :height => "1", :src => "https://www.paypal.com/it_IT/i/scr/pixel.gif", :width => "1"} .text = t('.paypal_text2') - + #main %h1= @title - / page title - / status msgs + / page title + / status msgs - if flash[:notice] #notice-msg= h flash[:notice] - elsif flash[:prompt] @@ -183,12 +183,12 @@ | \#{link_to t('.credits'), credits_path} | - %span#feedback= link_to_unless((request.params[:controller] == "feedback"), "Feedback", {:controller=>:feedback, :action=>:report, :ref=>request.url}) do |name| "#{name}" end + %span#feedback= link_to_unless((request.params[:controller] == "feedback"), "Feedback", {:controller=>:feedback, :action=>:report, :ref=>request.url}) do |name| "#{name}" end | %span= link_to_unless_current t(".nav.links"), links_path do |name| "#{name}" end - + #footer_right %span#powered= t('.powered_by',:made=>(link_to t('.madeintomorrow'), 'http://www.madeintomorrow.com')) - / deferred javascript calls + / deferred javascript calls = @deferred_content diff --git a/app/views/layouts/main.iphone.haml b/app/views/layouts/main.iphone.haml index 096e12c..404b421 100644 --- a/app/views/layouts/main.iphone.haml +++ b/app/views/layouts/main.iphone.haml @@ -9,7 +9,7 @@ - + / builder before effects, re: http://www.dotcompromotions.com.au/blog/?p=52 / skipping dragdrop and control. = javascript_include_tag "prototype", "builder", "effects", "application", :cache => true @@ -49,13 +49,13 @@ = t('.big_header') .medium = t('.medium_header') - - - # end if show_all + + - # end if show_all #content -unless @show_all #side #breadcrumb - = t('.breadcrumb_in') + = t('.breadcrumb_in') - # ancestors breadcrumb does not fit in layout. skip it. = link_to "Home", root_path > @@ -69,8 +69,8 @@ #main -unless @show_all %h1= @title - / page title - / status msgs + / page title + / status msgs - if flash[:notice] #notice-msg= h flash[:notice] - elsif flash[:prompt] @@ -110,23 +110,23 @@ | \#{link_to t('.credits'), credits_path} | - %span#feedback= link_to_unless((request.params[:controller] == "feedback"), "Feedback", {:controller=>:feedback, :action=>:report, :ref=>request.url}) do |name| "#{name}" end + %span#feedback= link_to_unless((request.params[:controller] == "feedback"), "Feedback", {:controller=>:feedback, :action=>:report, :ref=>request.url}) do |name| "#{name}" end | %span= link_to_unless_current t(".nav.links"), links_path do |name| "#{name}" end - + #footer_right %span#powered= t('.powered_by',:made=>(link_to t('.madeintomorrow'), 'http://www.madeintomorrow.com')) = #javascript_include_tag "prototype", "effects", "builder", "dragdrop", "controls", "application", :cache => true - + - if @map - / begin map header + / begin map header :javascript var mgr; var feed_type; = GMap.header(:hl=>"#{@locale}") = @map.header_width_height(@map_conf[:width],@map_conf[:height]) = @map.to_html - / end map header - / deferred javascript calls + / end map header + / deferred javascript calls = @deferred_content diff --git a/app/views/sessions/new.haml b/app/views/sessions/new.haml index fcebbe4..20aa76b 100644 --- a/app/views/sessions/new.haml +++ b/app/views/sessions/new.haml @@ -14,6 +14,6 @@ %span.submit = submit_tag t('.submit'), :id=>'commit' - + %span.forgot = link_to t('.forgot'), forgot_password_path diff --git a/app/views/shared/sidebox/_mapsearch.haml b/app/views/shared/sidebox/_mapsearch.haml index 1972f50..3d25c11 100644 --- a/app/views/shared/sidebox/_mapsearch.haml +++ b/app/views/shared/sidebox/_mapsearch.haml @@ -11,4 +11,3 @@ - deferred do :javascript WH_address_search($('q').value, true); - \ No newline at end of file diff --git a/app/views/shared/sidebox/_mapsearchconfirm.haml b/app/views/shared/sidebox/_mapsearchconfirm.haml index 1972f50..3d25c11 100644 --- a/app/views/shared/sidebox/_mapsearchconfirm.haml +++ b/app/views/shared/sidebox/_mapsearchconfirm.haml @@ -11,4 +11,3 @@ - deferred do :javascript WH_address_search($('q').value, true); - \ No newline at end of file diff --git a/app/views/user_mailer/activation.text.plain.erb b/app/views/user_mailer/activation.text.plain.erb index 29a666d..2b37b93 100644 --- a/app/views/user_mailer/activation.text.plain.erb +++ b/app/views/user_mailer/activation.text.plain.erb @@ -1,5 +1,5 @@ -<%= I18n.t 'mailer.activated.text', - :login => @user.login, - :link => @url, - :url => @url +<%= I18n.t 'mailer.activated.text', + :login => @user.login, + :link => @url, + :url => @url %> \ No newline at end of file diff --git a/app/views/user_mailer/new_password.text.plain.erb b/app/views/user_mailer/new_password.text.plain.erb index b5b7fc6..e0b2620 100644 --- a/app/views/user_mailer/new_password.text.plain.erb +++ b/app/views/user_mailer/new_password.text.plain.erb @@ -1,7 +1,7 @@ -<%= I18n.t 'mailer.forgot_password.text', - :login => @user.login, - :password => @pass, - :link => @url, - :url => @url +<%= I18n.t 'mailer.forgot_password.text', + :login => @user.login, + :password => @pass, + :link => @url, + :url => @url %> diff --git a/app/views/user_mailer/signup_notification.text.plain.erb b/app/views/user_mailer/signup_notification.text.plain.erb index 4d1e0aa..5ea98bb 100644 --- a/app/views/user_mailer/signup_notification.text.plain.erb +++ b/app/views/user_mailer/signup_notification.text.plain.erb @@ -1,6 +1,6 @@ -<%= I18n.t 'mailer.signup.text', - :login => @user.login, - :password => @user.password, - :link => @url, - :url => @url +<%= I18n.t 'mailer.signup.text', + :login => @user.login, + :password => @user.password, + :link => @url, + :url => @url %> \ No newline at end of file diff --git a/app/views/users/_user_bar.haml b/app/views/users/_user_bar.haml index f02ac39..545b74a 100644 --- a/app/views/users/_user_bar.haml +++ b/app/views/users/_user_bar.haml @@ -1,13 +1,13 @@ - if logged_in? //#user-bar-greeting = t('.logged_in_as') - %span.username= link_to_current_user :content_method => :login, :content_text=>truncate("#{h current_user.login}",:length=>16,:omission=>'...') - \| + %span.username= link_to_current_user :content_method => :login, :content_text=>truncate("#{h current_user.login}",:length=>16,:omission=>'...') + \| //#user-bar-action = link_to t('.log_out'), logout_path, { :title => t('.log_out') } - else //#user-bar-greeting - = link_to_login_with_IP t('.login'), :style => 'border: none;' - \| + = link_to_login_with_IP t('.login'), :style => 'border: none;' + \| //#user-bar-action = link_to t('.register'), signup_path, { :title => t('.register') } diff --git a/app/views/users/_user_bar.iphone.haml b/app/views/users/_user_bar.iphone.haml index 259111c..bd5e26d 100644 --- a/app/views/users/_user_bar.iphone.haml +++ b/app/views/users/_user_bar.iphone.haml @@ -1,13 +1,13 @@ - if logged_in? //#user-bar-greeting = t('.logged_in_as') - %span.username= link_to_current_user :content_method => :login, :content_text=>truncate("#{h current_user.login}",:length=>16,:omission=>'...') - \| + %span.username= link_to_current_user :content_method => :login, :content_text=>truncate("#{h current_user.login}",:length=>16,:omission=>'...') + \| //#user-bar-action = link_to t('.log_out'), logout_path, { :title => t('.log_out'), :target => '_self' } - else //#user-bar-greeting - = link_to_login_with_IP t('.login'), :style => 'border: none;' - \| + = link_to_login_with_IP t('.login'), :style => 'border: none;' + \| //#user-bar-action = link_to t('.register'), signup_path, { :title => t('.register') } diff --git a/app/views/votes/_vote.haml b/app/views/votes/_vote.haml index 7c49b3c..7277937 100644 --- a/app/views/votes/_vote.haml +++ b/app/views/votes/_vote.haml @@ -13,9 +13,9 @@ = h @water_point.up_score .vote - if @current_user && @current_user.login == @water_point.posted_by.login - / (you can't vote on your own posts) + / (you can't vote on your own posts) %a{:class=>up_class,:id=>'upvote',:href=>'javascript:void(0)',:title=>"cannot vote your own post"} - - else + - else = link_to_remote(" ", | :update=>'votebox', | :url=>"/#{@locale}/votes/toggle", | @@ -27,9 +27,9 @@ = h @water_point.down_score .vote - if @current_user && @current_user.login == @water_point.posted_by.login - / (you can't vote on your own posts) + / (you can't vote on your own posts) %a{:class=>down_class,:id=>'downvote',:href=>'javascript:void(0)',:title=>"cannot vote your own post"} - - else + - else = link_to_remote(" ", | :update=>'votebox', | :url=>"/#{@locale}/votes/toggle", | diff --git a/app/views/votes/toggle.js.rjs b/app/views/votes/toggle.js.rjs index e79103b..8022b68 100644 --- a/app/views/votes/toggle.js.rjs +++ b/app/views/votes/toggle.js.rjs @@ -2,5 +2,5 @@ page.replace_html :votebox, :partial => 'votes/vote', :locals => {:water_point = #page.visual_effect(:fade, 'add_comment', :duration => 0.5) #page[:add_comment_text].value = '' #page[:add_comment_form].reset -#page.visual_effect(:slide_down, 'thanks', :duration => 2.0) +#page.visual_effect(:slide_down, 'thanks', :duration => 2.0) #page.visual_effect(:slide_up, 'thanks', :duration => 2.0) \ No newline at end of file diff --git a/app/views/welcome/index.haml b/app/views/welcome/index.haml index 2dba53b..bba01d7 100644 --- a/app/views/welcome/index.haml +++ b/app/views/welcome/index.haml @@ -6,7 +6,7 @@ %area{:href=>"#{map_path}", :shape=>"rect", :coords=>"200,0,600,150"} %area{:href=>"#{new_water_point_path}", :shape=>"rect", :coords=>"500,280,600,350"} %img{:src=>"/images/2/hp_#{@locale}.png", :alt=>"homepage", :usemap=>"#hp_map"} - + #intro %div %h2= "Dripplet project" diff --git a/app/views/welcome/index.iphone.haml b/app/views/welcome/index.iphone.haml index f638126..3fce0e9 100644 --- a/app/views/welcome/index.iphone.haml +++ b/app/views/welcome/index.iphone.haml @@ -1,7 +1,7 @@ - @title = t('.title') + " [#{@count} #{t '.drippletcount'}]" - @side_type = :community - @show_all = true - + #intro %div %h3= "Dripplet project" diff --git a/config/backup.rb b/config/backup.rb index eeb6bac..b20e98f 100644 --- a/config/backup.rb +++ b/config/backup.rb @@ -18,7 +18,7 @@ def latest skip_tables = Array(skip_backup_tables).join(',') run "cd #{current_path}; rake db:backup:create RAILS_ENV=#{rails_env} BACKUP_DIR=#{backup_path} SKIP_TABLES=#{skip_tables}" end - + desc "Retreive a backup from the server. Gets the latest by default, set :backup_version to specify which version to copy" task :download, :roles => :db, :only => {:primary => true} do version = fetch(:backup_version, latest) @@ -29,12 +29,12 @@ def latest `tar -C backups -zxf backups/#{version}.tar.gz` `rm backups/#{version}.tar.gz` end - + desc "Creates a new remote backup and clones it to the local database" task :mirror, :roles => :db, :only => {:primary => true} do create download `rake db:backup:restore` end - + end \ No newline at end of file diff --git a/config/deploy.rb b/config/deploy.rb index 1f23a0f..47f7f18 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -41,12 +41,12 @@ rm -rf #{release_path}/public/avatars && rm -rf #{release_path}/public/photos && rm -rf #{release_path}/backups && - ln -nfs #{shared_path}/assets/avatars #{release_path}/public/avatars && + ln -nfs #{shared_path}/assets/avatars #{release_path}/public/avatars && ln -nfs #{shared_path}/assets/photos #{release_path}/public/photos && ln -nfs #{shared_path}/backups #{release_path}/backups CMD end - + task :create_dirs, :roles => :app do %w(avatars photos).each do |name| run "mkdir -p #{shared_path}/assets/#{name}" @@ -58,7 +58,7 @@ # Passenger namespace :deploy do - + desc "Restart Application" task :restart, :roles => :app do run "touch #{current_path}/tmp/restart.txt" @@ -67,11 +67,11 @@ # Not needed task :start do end - + # Not needed task :stop do end - + end after "deploy:update_code", :link_production_db diff --git a/config/environments/profile.rb b/config/environments/profile.rb index 328100b..3a0aaea 100644 --- a/config/environments/profile.rb +++ b/config/environments/profile.rb @@ -5,7 +5,7 @@ # definitely not use the production databse! -# Cache classes - otherwise your code +# Cache classes - otherwise your code # will run approximately 5 times slower and the # profiling results will be overwhelmed by Rails # dependency loading mechanism diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index d531b8b..9e8b013 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,6 +1,6 @@ # Be sure to restart your server when you modify this file. -# Add new inflection rules using the following format +# Add new inflection rules using the following format # (all these examples are active by default): # ActiveSupport::Inflector.inflections do |inflect| # inflect.plural /^(ox)$/i, '\1en' diff --git a/config/locales/en.yml b/config/locales/en.yml index 158ed40..7613fd7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,4 +1,4 @@ -# Italian translations for Ruby on Rails +# Italian translations for Ruby on Rails # by Claudio Poli (masterkain@gmail.com) # maintained by Simone Carletti (weppos@weppos.net) # @@ -31,22 +31,22 @@ en: terms: "terms of service" required: "required" thanks_to: "thanks to:" - + ######################################################## # Begin site-specific text. # 1) Do not use tabs, only spaces! # 2) All text should be in UTF8 (be sure your text editor uses that encoding) -# 3) format is: LABEL: text. -# If you need to include a ' in the text, use this format: +# 3) format is: LABEL: text. +# If you need to include a ' in the text, use this format: # LABEL: "text's got an apostrophe..." (double quotes around string) -# If you need to include a " in the text, use this format: +# If you need to include a " in the text, use this format: # LABEL: "text has \"a quote\" inside" (double quotes and backslash for embedded quotes) # Or if you want some leading/trailing whitespace in the text, use this format # LABEL: " some text that begins with some whitespace and/or ends with some whitespace " # Otherwise, no need for quotes around text. # LABEL: this is fine ######################################################## - + mailer: forgot_password: subject: "Here is your new password" @@ -68,7 +68,7 @@ en: subject: "Congratulations! Your account is now confirmed." text: "Thanks for activating your account. Welcome to Dripplet.com fellow Water Hunter! {{link}}" link_text: "{{url}}" - + groups: #/en/groups/* show: # /en/groups/1 created_by: "Created by: " @@ -95,7 +95,7 @@ en: title: "Create a group" summary: "Here you can create your group and send message to group members." submit: "Create" - + users: index: # /en/users title: "Community" @@ -135,7 +135,7 @@ en: log_out: "logout" login: "signin" register: "register" - + welcome: map: # /en/map (Explore...) title: "Explore" @@ -224,7 +224,7 @@ Your information is managed by Made in Tomorrow srl, via dei Piceni 40 -00185 Ro Thank you" credits: # /it/credits title: "Credits" - summary: "www.dripplet.com has been produced thanks to the good will and commitment of many people.
Made in Tomorrow srl has provided its infrastructure and has supported the initial costs, but all of those who have collaborated have done so for free or for amounts well below their usual rates.
In particular Made in Tomorrow thanks: Andrea Dezzi, Ben Ellis, Francesca Ferraro, Elisabetta Gagliardini, Tsuneo Kurihara, Andrea Leganza, Marta Leonori, Maurizio Lo Castro, Camilla Macro, Laura Mencuccini, Valentina Segatori" + summary: "www.dripplet.com has been produced thanks to the good will and commitment of many people.
Made in Tomorrow srl has provided its infrastructure and has supported the initial costs, but all of those who have collaborated have done so for free or for amounts well below their usual rates.
In particular Made in Tomorrow thanks: Andrea Dezzi, Ben Ellis, Francesca Ferraro, Elisabetta Gagliardini, Tsuneo Kurihara, Andrea Leganza, Marta Leonori, Maurizio Lo Castro, Camilla Macro, Laura Mencuccini, Valentina Segatori" feedback: report: # /en/feedback/report title: "Feedback" @@ -241,7 +241,7 @@ Thank you" comments: "Comments" comment_be_specific: "Please be specific. We appreciate your feedback." submit: "Send Feedback" - + water_points: index: # /en/water_points title: "Dripplets" @@ -279,8 +279,8 @@ Thank you" summary: "Enter login and password." submit: "Enter" forgot: "forgot password" - -################################## + +################################## shared: # snippets included in other pages... users: # user list on /en/users view_profile: "View {{profile}}" #inserts link @@ -291,7 +291,7 @@ Thank you" remove_comment: "Remove" groups: join: "Join or create a new group" - member_of: "Member of:" + member_of: "Member of:" sidebox: # blue sidebox in left column add: title: "Add a dripplet" @@ -316,7 +316,7 @@ Searching for water in outer space helps us to understand if there's life elsewh title: "Hello Water Hunter!" text: "If your search was successful and you want to share a new dripplet with all of us, you're in the right place!" - layouts: + layouts: main: #main layout page_title: "Dripplet.com" app_promo_title: "iPhone app corner" @@ -366,7 +366,7 @@ Easily with your iphone – iPod - iPad" #http://itunes.apple.com/WebObjects/MZS mailer: #These texts are used when the site sends email messags footer1: "We inform you that you can modify your email notification preferences accessing your account on our website." footer2: "This message has been sent to {{email}} by an automated system. Please do not reply to this email directly." - + ################### # flash messages are three types: notice, prompt, error flash: #flash messages. @@ -392,11 +392,11 @@ Easily with your iphone – iPod - iPad" #http://itunes.apple.com/WebObjects/MZS wp: "dripplet created" prompt: #messages appear in orange wp: "Dripplet loaded. If correctly located, click the confirm button." - + #pagination strings previous: "previous" next: "next" - + #breadcrumb strings, overrides for page titles where they would be too long bc: Groups: Group Listings diff --git a/config/locales/en.yml.terms b/config/locales/en.yml.terms index 768810b..587e523 100644 --- a/config/locales/en.yml.terms +++ b/config/locales/en.yml.terms @@ -1,4 +1,4 @@ -# Italian translations for Ruby on Rails +# Italian translations for Ruby on Rails # by Claudio Poli (masterkain@gmail.com) # maintained by Simone Carletti (weppos@weppos.net) # @@ -31,22 +31,22 @@ en: terms: "terms of service" required: "required" - + ######################################################## # Begin site-specific text. # 1) Do not use tabs, only spaces! # 2) All text should be in UTF8 (be sure your text editor uses that encoding) -# 3) format is: LABEL: text. -# If you need to include a ' in the text, use this format: +# 3) format is: LABEL: text. +# If you need to include a ' in the text, use this format: # LABEL: "text's got an apostrophe..." (double quotes around string) -# If you need to include a " in the text, use this format: +# If you need to include a " in the text, use this format: # LABEL: "text has \"a quote\" inside" (double quotes and backslash for embedded quotes) # Or if you want some leading/trailing whitespace in the text, use this format # LABEL: " some text that begins with some whitespace and/or ends with some whitespace " # Otherwise, no need for quotes around text. # LABEL: this is fine ######################################################## - + mailer: forgot_password: subject: "Here is your new password" @@ -68,7 +68,7 @@ en: subject: "Congratulations! Your account is now confirmed." text: "Thanks for activating your account. Welcome to Dripplet.com fellow Water Hunter! {{link}}" link_text: "{{url}}" - + groups: #/en/groups/* show: # /en/groups/1 created_by: "Created by: " @@ -95,7 +95,7 @@ en: title: "Create a group" summary: "Here you can create your group and send message to group members." submit: "Create" - + users: index: # /en/users title: "Community" @@ -135,7 +135,7 @@ en: log_out: "logout" login: "signin" register: "register" - + welcome: map: # /en/map (Explore...) title: "Explore" @@ -223,7 +223,7 @@ Your information is managed by Made in Tomorrow srl, via dei Piceni 40 -00185 Ro Thank you" credits: # /it/credits title: "Credits" - summary: "www.dripplet.com has been produced thanks to the good will and commitment of may people.
Made in Tomorrow srl has provided its infrastructure and has supported the initial costs, but all of those who have collaborated have done so for free or for amounts well below their usual rates.
In particular Made in Tomorrow thanks: Andrea Dezzi, Ben Ellis, Francesca Ferraro, Elisabetta Gagliardini, Tsuneo Kurihara, Andrea Leganza, Marta Leonori, Maurizio Lo Castro, Camilla Macro, Laura Mencuccini, Valentina Segatori" + summary: "www.dripplet.com has been produced thanks to the good will and commitment of may people.
Made in Tomorrow srl has provided its infrastructure and has supported the initial costs, but all of those who have collaborated have done so for free or for amounts well below their usual rates.
In particular Made in Tomorrow thanks: Andrea Dezzi, Ben Ellis, Francesca Ferraro, Elisabetta Gagliardini, Tsuneo Kurihara, Andrea Leganza, Marta Leonori, Maurizio Lo Castro, Camilla Macro, Laura Mencuccini, Valentina Segatori" feedback: report: # /en/feedback/report title: "Feedback" @@ -240,7 +240,7 @@ Thank you" comments: "Comments" comment_be_specific: "Please be specific. We appreciate your feedback." submit: "Send Feedback" - + water_points: index: # /en/water_points title: "Dripplets" @@ -278,8 +278,8 @@ Thank you" summary: "Enter login and password." submit: "Enter" forgot: "forgot password" - -################################## + +################################## shared: # snippets included in other pages... users: # user list on /en/users view_profile: "View {{profile}}" #inserts link @@ -312,7 +312,7 @@ Searching for water in outer space helps us to understand if there's life elsewh title: "Hello Water Hunter!" text: "If your search was successful and you want to share a new dripplet with all of us, you're in the right place!" - layouts: + layouts: main: #main layout page_title: "Dripplet.com" app_promo_title: "iPhone app corner" @@ -357,7 +357,7 @@ Easily with your iphone – iPod - iPad" #http://itunes.apple.com/WebObjects/MZS mailer: #These texts are used when the site sends email messags footer1: "We inform you that you can modify your email notification preferences accessing your account on our website." footer2: "This message has been sent to {{email}} by an automated system. Please do not reply to this email directly." - + ################### # flash messages are three types: notice, prompt, error flash: #flash messages. @@ -383,7 +383,7 @@ Easily with your iphone – iPod - iPad" #http://itunes.apple.com/WebObjects/MZS wp: "dripplet created" prompt: #messages appear in orange wp: "Dripplet loaded. If correctly located, click the confirm button." - + #pagination strings previous: "previous" next: "next" diff --git a/config/routes.rb b/config/routes.rb index 6cf94e6..cf949ed 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,9 +1,9 @@ ActionController::Routing::Routes.draw do |map| - + map.filter :locale - - + + map.logout '/logout', :controller => 'sessions', :action => 'destroy' map.login '/login', :controller => 'sessions', :action => 'new' map.register '/register', :controller => 'users', :action => 'create' @@ -16,7 +16,7 @@ map.resources :votes map.resources :comments map.resources :water_points, :member => {:disable => :delete} - + map.forgot_password 'forgot_password', :controller=>"users", :action => "forgot" map.forgot_password_check 'forgot_password_check', :controller=>"users", :action => "forgot_check", :method => 'post' @@ -49,7 +49,7 @@ # Sample resource route with sub-resources: # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller - + # Sample resource route with more complex sub-resources # map.resources :products do |products| # products.resources :comments @@ -64,7 +64,7 @@ # You can have the root of your site routed with map.root -- just remember to delete public/index.html. map.root :controller => "welcome" - + map.map '/map', :controller => "welcome", :action => "map" map.links '/links', :controller => "welcome", :action => "links" map.terms '/terms', :controller => "welcome", :action => "terms" diff --git a/db/migrate/20091201165648_create_comments.rb b/db/migrate/20091201165648_create_comments.rb index 4d9db66..eabdc5e 100644 --- a/db/migrate/20091201165648_create_comments.rb +++ b/db/migrate/20091201165648_create_comments.rb @@ -7,7 +7,7 @@ def self.up t.string :ip_addr t.boolean :enabled, :default=>true - t.timestamps + t.timestamps end add_index :comments, :user_id, :unique => false add_index :comments, :water_point_id , :unique=> false diff --git a/db/migrate/20091202173526_create_group_members.rb b/db/migrate/20091202173526_create_group_members.rb index 8a96b25..068603c 100644 --- a/db/migrate/20091202173526_create_group_members.rb +++ b/db/migrate/20091202173526_create_group_members.rb @@ -9,7 +9,7 @@ def self.up add_index :group_members, [:user_id, :group_id], :unique => true add_index :group_members, :group_id, :unique => false add_index :group_members, :user_id, :unique => false - + end def self.down diff --git a/db/migrate/20091204133747_create_water_point_photos.rb b/db/migrate/20091204133747_create_water_point_photos.rb index 500e9d9..bb058db 100644 --- a/db/migrate/20091204133747_create_water_point_photos.rb +++ b/db/migrate/20091204133747_create_water_point_photos.rb @@ -2,7 +2,7 @@ class CreateWaterPointPhotos < ActiveRecord::Migration def self.up create_table :photos do |t| t.integer :water_point_id, :parent_id, :size, :width, :height - t.string :content_type, :filename, :thumbnail + t.string :content_type, :filename, :thumbnail t.timestamps end add_index :photos, :water_point_id, :unique => false diff --git a/db/migrate/20091205142340_create_users.rb b/db/migrate/20091205142340_create_users.rb index 025178b..b755534 100644 --- a/db/migrate/20091205142340_create_users.rb +++ b/db/migrate/20091205142340_create_users.rb @@ -24,7 +24,7 @@ def self.up t.integer :water_points_count, :default=>0 #how many has user posted t.integer :up_scores, :default=>0 #sum of up_score for all water_points posted t.string :locale, :default=>'en' - + end add_index :users, :login, :unique => true add_index :users, :water_points_count, :unique => false diff --git a/db/migrate/20091205181242_create_avatars.rb b/db/migrate/20091205181242_create_avatars.rb index 06887ab..13b9f58 100644 --- a/db/migrate/20091205181242_create_avatars.rb +++ b/db/migrate/20091205181242_create_avatars.rb @@ -2,7 +2,7 @@ class CreateAvatars < ActiveRecord::Migration def self.up create_table :avatars do |t| t.integer :user_id, :parent_id, :size, :width, :height - t.string :content_type, :filename, :thumbnail + t.string :content_type, :filename, :thumbnail t.timestamps end add_index :avatars, :user_id, :unique => false diff --git a/db/migrate/20100613162817_batch_support.rb b/db/migrate/20100613162817_batch_support.rb index c3f452a..524ea9d 100644 --- a/db/migrate/20100613162817_batch_support.rb +++ b/db/migrate/20100613162817_batch_support.rb @@ -2,10 +2,10 @@ class BatchSupport < ActiveRecord::Migration def self.up add_column :users, :batch_id, :string add_index :users, :batch_id - + add_column :water_points, :batch_id, :string add_index :water_points, :batch_id - + add_column :water_points, :state, :string, :default=>"active" say_with_time "Updating water_point.state..." do WaterPoint.find(:all).each do |w| @@ -21,13 +21,13 @@ def self.up def self.down remove_column :users, :batch_id remove_index :users, :batch_id - + remove_column :water_points, :batch_id remove_index :water_points, :batch_id - + remove_column :water_points, :state remove_index :water_points, :state - + remove_column :water_points, :photo_url end end diff --git a/doc/README_FOR_APP b/doc/README_FOR_APP index 2ef914e..a2cf742 100644 --- a/doc/README_FOR_APP +++ b/doc/README_FOR_APP @@ -14,7 +14,7 @@ To Do: togliere la mappa dal homepage (0g) --> DONE. waiting on new layout from -valutare come/se ridurre il peso della mappa in generale (lasciare che il browser lo tiene in cache, +valutare come/se ridurre il peso della mappa in generale (lasciare che il browser lo tiene in cache, omettere i marker degli altri dripplet quando l'utente naviga via iphone, ecc.) rifare il layout (2gg) diff --git a/features/language.feature b/features/language.feature index 0a08945..3eefdc2 100644 --- a/features/language.feature +++ b/features/language.feature @@ -2,9 +2,9 @@ Feature: Multiple language support In order to access the site in their native language a user visiting waterhunting.com wants to indicate which language they want to use and receive messages consistently in that language. - Browsing the site, the web pages should always be served in the language the user - has currently selected. - However email messages sent from the site should always use the language associated + Browsing the site, the web pages should always be served in the language the user + has currently selected. + However email messages sent from the site should always use the language associated with the user's registration. Scenario: User has forgotten password. @@ -15,4 +15,3 @@ Feature: Multiple language support And the password reminder message is in italian But the site is in english - \ No newline at end of file diff --git a/features/step_definitions/water_point_steps.rb b/features/step_definitions/water_point_steps.rb index 6fec106..2e499b7 100644 --- a/features/step_definitions/water_point_steps.rb +++ b/features/step_definitions/water_point_steps.rb @@ -12,9 +12,9 @@ visit login_url fill_in "login", :with=>@user.login fill_in "password", :with=>'password' - begin + begin click_button "commit" - rescue + rescue save_and_open_page raise end @@ -41,7 +41,7 @@ end end -Then /^a new water point is created$/ do +Then /^a new water point is created$/ do flash[:notice].should == "WaterPoint loaded. Please confirm location to publish." end diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index 2996dd6..4f5c66e 100644 --- a/features/step_definitions/web_steps.rb +++ b/features/step_definitions/web_steps.rb @@ -1,6 +1,6 @@ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. -# It is recommended to regenerate this file in the future when you upgrade to a -# newer version of cucumber-rails. Consider adding your own code to a new file +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file # instead of editing this one. Cucumber will automatically load all features/**/*.rb # files. @@ -121,21 +121,21 @@ # Adds support for validates_attachment_content_type. Without the mime-type getting # passed to attach_file() you will get a "Photo file is not one of the allowed file types." -# error message +# error message When /^(?:|I )attach the file "([^\"]*)" to "([^\"]*)"$/ do |path, field| type = path.split(".")[1] case type when "jpg" - type = "image/jpg" + type = "image/jpg" when "jpeg" - type = "image/jpeg" + type = "image/jpeg" when "png" - type = "image/png" + type = "image/png" when "gif" type = "image/gif" end - + attach_file(field, path, type) end diff --git a/features/support/env.rb b/features/support/env.rb index ddcdc2d..caf5d49 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,6 +1,6 @@ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. -# It is recommended to regenerate this file in the future when you upgrade to a -# newer version of cucumber-rails. Consider adding your own code to a new file +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file # instead of editing this one. Cucumber will automatically load all features/**/*.rb # files. @@ -25,7 +25,7 @@ end -# If you set this to false, any error raised from within your app will bubble +# If you set this to false, any error raised from within your app will bubble # up to your step definition and out to cucumber unless you catch it somewhere # on the way. You can make Rails rescue errors and render error pages on a # per-scenario basis by tagging a scenario or feature with the @allow-rescue tag. @@ -37,15 +37,15 @@ ActionController::Base.allow_rescue = false # If you set this to true, each scenario will run in a database transaction. -# You can still turn off transactions on a per-scenario basis, simply tagging +# You can still turn off transactions on a per-scenario basis, simply tagging # a feature or scenario with the @no-txn tag. If you are using Capybara, # tagging with @culerity or @javascript will also turn transactions off. # # If you set this to false, transactions will be off for all scenarios, # regardless of whether you use @no-txn or not. # -# Beware that turning transactions off will leave data in your database -# after each scenario, which can lead to hard-to-debug failures in +# Beware that turning transactions off will leave data in your database +# after each scenario, which can lead to hard-to-debug failures in # subsequent scenarios. If you do this, we recommend you create a Before # block that will explicitly put your database in a known state. Cucumber::Rails::World.use_transactional_fixtures = true diff --git a/features/support/paths.rb b/features/support/paths.rb index 7f1dae1..cdd7cb8 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -7,7 +7,7 @@ module NavigationHelpers # def path_to(page_name) case page_name - + when /the home\s?page/ '/' when /the new frooble page/ @@ -16,7 +16,7 @@ def path_to(page_name) new_water_point_path when /the english version of the forgot password page/ '/en/forgot_password' - + # Add more mappings here. # Here is an example that pulls values out of the Regexp: # diff --git a/features/water_point.feature b/features/water_point.feature index 2d96344..bf6eb1e 100644 --- a/features/water_point.feature +++ b/features/water_point.feature @@ -2,7 +2,7 @@ Feature: Manage water points In order to share the location of water points a user visiting waterhunting.com wants to create a water point, indicating location and optionally including text and photo. - + Scenario: Register new water point with no photo Given I am signed in as a fully registered user When I am on the new water point page @@ -27,11 +27,11 @@ Feature: Manage water points Then a new water point is created And I arrive at the confirmation page And the GPS coordinates are the defaults - + Given I am signed in as a fully registered user When I am on the new water point page And I upload an invalid photo And I fill in the water point creation form and submit Then an error message warns me that the photo is invalid And I am still on the water point creation page - + diff --git a/lib/authenticated_system.rb b/lib/authenticated_system.rb index add0f83..9bc06fd 100644 --- a/lib/authenticated_system.rb +++ b/lib/authenticated_system.rb @@ -68,7 +68,7 @@ def access_denied redirect_to new_session_path end # format.any doesn't work in rails version < http://dev.rubyonrails.org/changeset/8987 - # Add any other API formats here. (Some browsers, notably IE6, send Accept: */* and trigger + # Add any other API formats here. (Some browsers, notably IE6, send Accept: */* and trigger # the 'format.any' block incorrectly. See http://bit.ly/ie6_borken or http://bit.ly/ie6_borken2 # for a workaround.) format.any(:json, :xml) do @@ -114,7 +114,7 @@ def login_from_basic_auth self.current_user = User.authenticate(login, password) end end - + # # Logout # @@ -149,7 +149,7 @@ def logout_killing_session! logout_keeping_session! reset_session end - + # # Remember_me Tokens # @@ -161,25 +161,25 @@ def logout_killing_session! def valid_remember_cookie? return nil unless @current_user - (@current_user.remember_token?) && + (@current_user.remember_token?) && (cookies[:auth_token] == @current_user.remember_token) end - + # Refresh the cookie auth token if it exists, create it otherwise def handle_remember_cookie!(new_cookie_flag) return unless @current_user case when valid_remember_cookie? then @current_user.refresh_token # keeping same expiry date - when new_cookie_flag then @current_user.remember_me + when new_cookie_flag then @current_user.remember_me else @current_user.forget_me end send_remember_cookie! end - + def kill_remember_cookie! cookies.delete :auth_token end - + def send_remember_cookie! cookies[:auth_token] = { :value => @current_user.remember_token, diff --git a/lib/authenticated_test_helper.rb b/lib/authenticated_test_helper.rb index 6b2e82b..7eaaa02 100644 --- a/lib/authenticated_test_helper.rb +++ b/lib/authenticated_test_helper.rb @@ -7,5 +7,5 @@ def login_as(user) def authorize_as(user) @request.env["HTTP_AUTHORIZATION"] = user ? ActionController::HttpAuthentication::Basic.encode_credentials(users(user).login, 'monkey') : nil end - + end diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake index ab04dc8..887e51e 100644 --- a/lib/tasks/cucumber.rake +++ b/lib/tasks/cucumber.rake @@ -1,6 +1,6 @@ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. -# It is recommended to regenerate this file in the future when you upgrade to a -# newer version of cucumber-rails. Consider adding your own code to a new file +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file # instead of editing this one. Cucumber will automatically load all features/**/*.rb # files. diff --git a/public/.htaccess b/public/.htaccess index ad8e287..000b1ce 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -10,19 +10,19 @@ FileETag None # Insert filter SetOutputFilter DEFLATE - + # Netscape 4.x has some problems... BrowserMatch ^Mozilla/4 gzip-only-text/html - + # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip - + # MSIE masquerades as Netscape, but it is fine BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # Don't compress images SetEnvIfNoCase Request_URI \ \.(?:gif|jpe?g|png)$ no-gzip dont-vary - + # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary diff --git a/public/home.html b/public/home.html index 0dd5189..bc971db 100644 --- a/public/home.html +++ b/public/home.html @@ -14,20 +14,20 @@ font-size: 13px; color: #333; } - + h1 { font-size: 28px; color: #000; } - + a {color: #03c} a:hover { background-color: #03c; color: white; text-decoration: none; } - - + + #page { background-color: #f0f0f0; width: 750px; @@ -35,7 +35,7 @@ margin-left: auto; margin-right: auto; } - + #content { float: left; background-color: white; @@ -44,7 +44,7 @@ padding: 25px; width: 500px; } - + #sidebar { float: right; width: 175px; @@ -53,7 +53,7 @@ #footer { clear: both; } - + #header, #about, #getting-started { padding-left: 75px; @@ -73,14 +73,14 @@ font-weight: normal; font-size: 16px; } - - + + #about h3 { margin: 0; margin-bottom: 10px; font-size: 14px; } - + #about-content { background-color: #ffd; border: 1px solid #fc0; @@ -99,7 +99,7 @@ } #about-content td.name {color: #555} #about-content td.value {color: #000} - + #about-content.failure { background-color: #fcc; border: 1px solid #f00; @@ -108,8 +108,8 @@ margin: 0; padding: 10px; } - - + + #getting-started { border-top: 1px solid #ccc; margin-top: 25px; @@ -145,8 +145,8 @@ color: #555; font-size: 13px; } - - + + #search { margin: 0; padding-top: 10px; @@ -158,8 +158,8 @@ margin: 2px; } #search-text {width: 170px} - - + + #sidebar ul { margin-left: 0; padding-left: 0; @@ -176,7 +176,7 @@ #sidebar ul.links li { margin-bottom: 5px; } - + @@ -189,11 +189,11 @@ onComplete: function() {new Effect.BlindDown('about-content', {duration: 0.25})} }); } else { - new Effect[Element.visible('about-content') ? + new Effect[Element.visible('about-content') ? 'BlindUp' : 'BlindDown']('about-content', {duration: 0.25}); } } - + window.onload = function() { $('search-text').value = ''; $('search').onsubmit = function() { @@ -213,7 +213,7 @@ the Rails site - +
  • Join the community

  • - +
  • Browse the documentation