From e8d16b2b33fef0858e6693dccb1a838633e5c2b7 Mon Sep 17 00:00:00 2001 From: albert Date: Tue, 13 Sep 2011 18:08:38 -0400 Subject: [PATCH] fixes #25: Voting on posts does not have any effect (also added to post/show) --- app/assets/javascripts/utility.js | 4 ++-- app/assets/stylesheets/application.css.scss | 4 ++++ app/views/comments/partials/index/_header.html.erb | 4 ++-- app/views/post_votes/create.js.erb | 4 ++-- app/views/posts/partials/show/_information.html.erb | 1 + 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/utility.js b/app/assets/javascripts/utility.js index d93a858d0..361cc91b6 100644 --- a/app/assets/javascripts/utility.js +++ b/app/assets/javascripts/utility.js @@ -8,7 +8,7 @@ } Danbooru.j_alert = function(title, msg) { - $('
').html(msg).dialog(); + $('
').html(msg).dialog({modal: true}); } Danbooru.j_error = function(msg) { @@ -16,7 +16,7 @@ } Danbooru.ajax_start = function(target) { - $(target).after(' '); + $(target).after(''); } Danbooru.ajax_stop = function(target) { diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 1f9deb973..0e153a9df 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -170,6 +170,10 @@ img { vertical-align: middle; } +img.wait { + margin-left: 5px; +} + input[type=text], input[type=password], input[type=url], textarea, button { /* border: 1px solid #AAA;*/ font-size: 1em; diff --git a/app/views/comments/partials/index/_header.html.erb b/app/views/comments/partials/index/_header.html.erb index d8b92abf0..33fe40457 100644 --- a/app/views/comments/partials/index/_header.html.erb +++ b/app/views/comments/partials/index/_header.html.erb @@ -14,8 +14,8 @@ Score - - <%= post.score %> + + <%= post.score %> <% if CurrentUser.user.is_privileged? %> (vote <%= link_to("up", post_votes_path(:score => "up", :post_id => post.id), :remote => true, :method => :post) %>/<%= link_to("down", post_votes_path(:score => "down", :post_id => post.id), :remote => true, :method => :post) %>) <% end %> diff --git a/app/views/post_votes/create.js.erb b/app/views/post_votes/create.js.erb index 50b16779c..6eda5336d 100644 --- a/app/views/post_votes/create.js.erb +++ b/app/views/post_votes/create.js.erb @@ -1,5 +1,5 @@ <% if @error %> - alert("<%= escape_javascript @error.to_s %>"); + Danbooru.j_error("<%= j @error.to_s %>"); <% else %> - $("#score-for-post-<%= @post.id %> span").text(<%= @post.score %>); + $("#score-for-post-<%= @post.id %>").html(<%= @post.score %>); <% end %> diff --git a/app/views/posts/partials/show/_information.html.erb b/app/views/posts/partials/show/_information.html.erb index a21af6e06..07085b5e8 100644 --- a/app/views/posts/partials/show/_information.html.erb +++ b/app/views/posts/partials/show/_information.html.erb @@ -11,6 +11,7 @@ (<%= post.image_width %>x<%= post.image_height %>) <% end %> +
  • Score: <%= post.score %> (vote <%= link_to "up", post_votes_path(:post_id => post.id, :score => "up"), :remote => true, :method => :post %>/<%= link_to "down", post_votes_path(:post_id => post.id, :score => "down"), :remote => true, :method => :post %>)
  • Status: <% if post.is_pending? %>