From d0459974cd7943839710776818daa8931da681cf Mon Sep 17 00:00:00 2001 From: joshua stein Date: Wed, 13 Feb 2013 18:50:51 -0600 Subject: [PATCH] so long whitespace --- app/assets/javascripts/application.js.erb | 6 +++--- app/controllers/comments_controller.rb | 10 +++++----- app/controllers/home_controller.rb | 2 +- app/controllers/messages_controller.rb | 2 +- app/controllers/stories_controller.rb | 8 ++++---- app/mailers/email_reply.rb | 4 ++-- app/models/keystore.rb | 2 +- app/models/story.rb | 5 +++-- app/models/user.rb | 4 ++-- app/models/vote.rb | 2 +- app/views/layouts/application.html.erb | 2 +- app/views/messages/index.html.erb | 2 +- app/views/messages/show.html.erb | 4 ++-- app/views/search/index.html.erb | 2 +- app/views/stories/edit.html.erb | 2 +- app/views/stories/new.html.erb | 4 ++-- app/views/users/show.html.erb | 4 ++-- extras/sponge.rb | 2 +- 18 files changed, 34 insertions(+), 33 deletions(-) diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index 4427d2b7..aeae5d20 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -251,7 +251,7 @@ $(document).ready(function() { var box = $(this).parents("li.comment").first().find("div.comment_reply"). first(); - + box.html($("#comment_form").clone()); box.find("ol").remove(); @@ -277,7 +277,7 @@ $(document).ready(function() { li.load("/comments/" + $(li).attr("data-shortid") + "/edit", { "edit": 1 }); }); - + $("a.comment_deletor").live("click", function() { if (confirm("Are you sure you want to delete this comment?")) { var li = $(this).parents("li.comment").first(); @@ -287,7 +287,7 @@ $(document).ready(function() { }); } }); - + $("a.comment_undeletor").live("click", function() { if (confirm("Are you sure you want to undelete this comment?")) { var li = $(this).parents("li.comment").first(); diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index eae3275e..076eedc3 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -3,7 +3,7 @@ class CommentsController < ApplicationController before_filter :require_logged_in_user_or_400, :only => [ :create, :preview, :preview_new, :upvote, :downvote, :unvote ] - + # for rss feeds, load the user's tag filters if a token is passed before_filter :find_user_from_rss_token, :only => [ :index ] @@ -57,7 +57,7 @@ class CommentsController < ApplicationController :content_type => "text/html", :locals => { :story => story, :comment => Comment.new, :show_comment => comment } end - + Countinual.count!("lobsters.comments.submitted", "+1") else comment.previewing = true @@ -69,7 +69,7 @@ class CommentsController < ApplicationController :comment => comment, :show_comment => comment } end end - + def preview_new params[:preview] = true return create @@ -178,7 +178,7 @@ class CommentsController < ApplicationController if !(comment = Comment.find_by_short_id(params[:comment_id])) return render :text => "can't find comment", :status => 400 end - + if !Vote::COMMENT_REASONS[params[:reason]] return render :text => "invalid reason", :status => 400 end @@ -270,7 +270,7 @@ if false th } end - + @comments = @threads.flatten end end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 67d80e8b..f40e9c48 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -59,7 +59,7 @@ class HomeController < ApplicationController @stories = find_stories_for_user_and_tag_and_newest_and_by_user(@user, nil, false, for_user.id) - + @heading = @title = "Newest Stories by #{for_user.username}" @cur_url = "/newest/#{for_user.username}" diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 448cfc49..d4653400 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -71,7 +71,7 @@ class MessagesController < ApplicationController if @message.author_user_id == @user.id @message.deleted_by_author = true end - + if @message.recipient_user_id == @user.id @message.deleted_by_recipient = true end diff --git a/app/controllers/stories_controller.rb b/app/controllers/stories_controller.rb index f8662a0c..e16775ef 100644 --- a/app/controllers/stories_controller.rb +++ b/app/controllers/stories_controller.rb @@ -56,13 +56,13 @@ class StoriesController < ApplicationController redirect_to @story.comments_url end - + def edit if !@story.is_editable_by_user?(@user) flash[:error] = "You cannot edit that story." return redirect_to "/" end - + @title = "Edit Story" end @@ -158,7 +158,7 @@ class StoriesController < ApplicationController end @comment = Comment.new - + load_user_votes render :action => "show" @@ -254,7 +254,7 @@ private @story.id, nil) @story.vote = v.vote end - + @votes = Vote.comment_votes_by_user_for_story_hash(@user.id, @story.id) @comments.each do |c| if @votes[c.id] diff --git a/app/mailers/email_reply.rb b/app/mailers/email_reply.rb index 3cc1fe79..cecb027a 100644 --- a/app/mailers/email_reply.rb +++ b/app/mailers/email_reply.rb @@ -2,7 +2,7 @@ class EmailReply < ActionMailer::Base default :from => "nobody@lobste.rs" def reply(comment, user) - @comment = comment + @comment = comment @user = user mail(:to => user.email, :from => "Lobsters ", @@ -11,7 +11,7 @@ class EmailReply < ActionMailer::Base end def mention(comment, user) - @comment = comment + @comment = comment @user = user mail(:to => user.email, :from => "Lobsters ", diff --git a/app/models/keystore.rb b/app/models/keystore.rb index 2cdcc890..2ffb73b4 100644 --- a/app/models/keystore.rb +++ b/app/models/keystore.rb @@ -46,7 +46,7 @@ class Keystore < ActiveRecord::Base return new_value end - + def self.decrement_value_for(key, amount = -1) self.increment_value_for(key, amount) end diff --git a/app/models/story.rb b/app/models/story.rb index 58d39462..5db75f43 100644 --- a/app/models/story.rb +++ b/app/models/story.rb @@ -183,8 +183,9 @@ class Story < ActiveRecord::Base if !self.taggings.reject{|t| t.marked_for_destruction? || t.tag.is_media? }.any? - errors.add(:base, "Must have at least one non-media (PDF, video) tag. " << - "If no tags apply to your content, it probably doesn't belong here.") + errors.add(:base, "Must have at least one non-media (PDF, video) " << + "tag. If no tags apply to your content, it probably doesn't " << + "belong here.") end end diff --git a/app/models/user.rb b/app/models/user.rb index a2bea130..04b95c55 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -95,7 +95,7 @@ class User < ActiveRecord::Base def stories_submitted_count Keystore.value_for("user:#{self.id}:stories_submitted").to_i end - + def comments_posted_count Keystore.value_for("user:#{self.id}:comments_posted").to_i end @@ -103,7 +103,7 @@ class User < ActiveRecord::Base def undeleted_received_messages received_messages.where(:deleted_by_recipient => false) end - + def undeleted_sent_messages sent_messages.where(:deleted_by_author => 0) end diff --git a/app/models/vote.rb b/app/models/vote.rb index 74895a33..439d33b7 100644 --- a/app/models/vote.rb +++ b/app/models/vote.rb @@ -43,7 +43,7 @@ class Vote < ActiveRecord::Base votes end - + def self.story_votes_by_user_for_story_ids_hash(user_id, story_ids) if !story_ids.any? return {} diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f8c6b871..4af486b0 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -93,7 +93,7 @@
- +
<% if flash[:error] %>
<%= flash[:error] %>
diff --git a/app/views/messages/index.html.erb b/app/views/messages/index.html.erb index 3ed2a8bf..1383e626 100644 --- a/app/views/messages/index.html.erb +++ b/app/views/messages/index.html.erb @@ -56,7 +56,7 @@ <%= f.text_field :recipient_username, :size => 20, :autocomplete => "off" %>
- +
<%= f.label :subject, "Subject:", :class => "required" %> <%= f.text_field :subject, :style => "width: 500px;", diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb index 32da7106..b359b80d 100644 --- a/app/views/messages/show.html.erb +++ b/app/views/messages/show.html.erb @@ -32,7 +32,7 @@ <%= submit_tag "Delete Message" %> <% end %>
- +
<%= form_tag message_url(@message.short_id) + "/keep_as_new", :method => :post do %> @@ -42,7 +42,7 @@
- +
diff --git a/app/views/search/index.html.erb b/app/views/search/index.html.erb index 2bd5e235..a6db01c2 100644 --- a/app/views/search/index.html.erb +++ b/app/views/search/index.html.erb @@ -20,7 +20,7 @@ <%= radio_button_tag "what", "stories", @search.what == "stories" %> - +   <%= radio_button_tag "what", "comments", @search.what == "comments" %> diff --git a/app/views/stories/edit.html.erb b/app/views/stories/edit.html.erb index a0906f7f..09f85f6e 100644 --- a/app/views/stories/edit.html.erb +++ b/app/views/stories/edit.html.erb @@ -19,7 +19,7 @@ <% end %>

- +
diff --git a/app/views/stories/new.html.erb b/app/views/stories/new.html.erb index 96cd4637..4141f9e2 100644 --- a/app/views/stories/new.html.erb +++ b/app/views/stories/new.html.erb @@ -24,7 +24,7 @@ Lobsters