diff --git a/app/controllers/favorites_controller.rb b/app/controllers/favorites_controller.rb
index 8a155f5a2..7bba9dc16 100644
--- a/app/controllers/favorites_controller.rb
+++ b/app/controllers/favorites_controller.rb
@@ -9,11 +9,9 @@ class FavoritesController < ApplicationController
def create
Post.find(params[:id]).add_favorite(CurrentUser.user)
- render :nothing => true
end
def destroy
Post.find(params[:id]).remove_favorite(CurrentUser.user)
- render :nothing => true
end
end
diff --git a/app/controllers/tag_aliases_controller.rb b/app/controllers/tag_aliases_controller.rb
index 25fb9e3a7..d1823c5f6 100644
--- a/app/controllers/tag_aliases_controller.rb
+++ b/app/controllers/tag_aliases_controller.rb
@@ -1,17 +1,12 @@
class TagAliasesController < ApplicationController
- before_filter :admin_only, :only => [:new, :edit, :create, :update, :destroy]
- respond_to :html, :xml, :json
+ before_filter :admin_only, :only => [:new, :create, :destroy]
+ respond_to :html, :xml, :json, :js
def new
@tag_alias = TagAlias.new(params[:tag_alias])
respond_with(@tag_alias)
end
- def edit
- @tag_alias = TagAlias.find(params[:id])
- respond_with(@tag_alias)
- end
-
def index
@search = TagAlias.search(params[:search])
@tag_aliases = @search.paginate(:page => params[:page])
@@ -20,19 +15,13 @@ class TagAliasesController < ApplicationController
def create
@tag_alias = TagAlias.create(params[:tag_alias])
- respond_with(@tag_alias)
- end
-
- def update
- @tag_alias = TagAlias.find(params[:id])
- @tag_alias.update_attributes(params[:tag_alias])
- respond_with(@tag_alias)
+ respond_with(@tag_alias, :location => tag_aliases_path(:search => {:id_eq => @tag_alias.id}))
end
def destroy
@tag_alias = TagAlias.find(params[:id])
@tag_alias.destroy
- respond_with(@tag_alias)
+ respond_with(@tag_alias, :location => tag_aliases_path)
end
def cache
diff --git a/app/controllers/tag_implications_controller.rb b/app/controllers/tag_implications_controller.rb
index 32630d1d4..67e5cdbe4 100644
--- a/app/controllers/tag_implications_controller.rb
+++ b/app/controllers/tag_implications_controller.rb
@@ -1,32 +1,21 @@
class TagImplicationsController < ApplicationController
- before_filter :admin_only, :only => [:new, :edit, :create, :update, :destroy]
- respond_to :html, :xml, :json
+ before_filter :admin_only, :only => [:new, :create, :destroy]
+ respond_to :html, :xml, :json, :js
def new
@tag_implication = TagImplication.new
respond_with(@tag_implication)
end
- def edit
- @tag_implication = TagImplication.find(params[:id])
- respond_with(@tag_implication)
- end
-
def index
@search = TagImplication.search(params[:search])
- @tag_implicationes = @search.paginate(:page => params[:page])
+ @tag_implications = @search.paginate(:page => params[:page])
respond_with(@tag_implicationes)
end
def create
@tag_implication = TagImplication.create(params[:tag_implication])
- respond_with(@tag_implication)
- end
-
- def update
- @tag_implication = TagImplication.find(params[:id])
- @tag_implication.update_attributes(params[:tag_implication])
- respond_with(@tag_implication)
+ respond_with(@tag_implication, :location => tag_implications_path(:search => {:id_eq => @tag_implication.id}))
end
def destroy
diff --git a/app/models/janitor_trial.rb b/app/models/janitor_trial.rb
index 63b2f3e7a..4e50c9446 100644
--- a/app/models/janitor_trial.rb
+++ b/app/models/janitor_trial.rb
@@ -10,6 +10,10 @@ class JanitorTrial < ActiveRecord::Base
self.creator_id = CurrentUser.id
end
+ def user_name=(name)
+ self.user_id = User.name_to_id(name)
+ end
+
def send_dmail
body = "You have been selected as a test janitor. You can now approve pending posts and have access to the moderation interface.\n\nOver the next several weeks your approvals will be monitored. If the majority of them are quality uploads, then you will be promoted to full janitor status which grants you the ability to delete and undelete posts, ban users, and revert tag changes from vandals. If you fail the trial period, you will be demoted back to your original level and you'll receive a negative user record indicating you previously attempted and failed a test janitor trial.\n\nThere is a minimum quota of 5 approvals a week to indicate that you are being active. Remember, the goal isn't to approve as much as possible. It's to filter out borderline-quality art.\n\nIf you have any questions please respond to this message."
diff --git a/app/views/comment_votes/create.js.erb b/app/views/comment_votes/create.js.erb
index f7d5baf61..740da5aa5 100644
--- a/app/views/comment_votes/create.js.erb
+++ b/app/views/comment_votes/create.js.erb
@@ -1,5 +1,3 @@
<% if @error %>
alert("<%= escape_javascript(@error.to_s) %>");
-<% else %>
- $("#score-for-comment-<%= @comment.id %>").html("<%= pluralize @comment.score, 'point' %>");
<% end %>
diff --git a/app/views/comments/partials/show/_comment.html.erb b/app/views/comments/partials/show/_comment.html.erb
index e2221d948..1dfc9f80c 100644
--- a/app/views/comments/partials/show/_comment.html.erb
+++ b/app/views/comments/partials/show/_comment.html.erb
@@ -6,13 +6,12 @@
<%= time_ago_in_words(comment.created_at) %> ago