upgraded to jquery 1.5.1, fixed comment voting ajax

This commit is contained in:
albert
2011-03-08 18:23:16 -05:00
parent a281bf03ed
commit 2b2be3263b
12 changed files with 122 additions and 275 deletions

View File

@@ -1,6 +1,10 @@
module PoolsHelper
def recent_updated_pools(&block)
def recent_updated_pools
pool_ids = session[:recent_pool_ids].to_s.scan(/\d+/)
Pool.where(["id IN (?)", pool_ids]).each(&block) if pool_ids.any?
if pool_ids.any?
Pool.where(["id IN (?)", pool_ids])
else
[]
end
end
end

View File

@@ -1,3 +1,5 @@
<% if @error %>
alert(<%= escape_javascript(@error.to_s) %>);
alert("<%= escape_javascript(@error.to_s) %>");
<% else %>
$("#score-for-comment-<%= @comment.id %>").html("<%= pluralize @comment.score, 'point' %>");
<% end %>

View File

@@ -1,5 +1,5 @@
<div class="comments">
<div class="index">
<div id="c-comments">
<div id="a-index">
<% @posts.each do |post| %>
<div class="post">
<div class="preview">

View File

@@ -1,9 +1,12 @@
<article data-comment-id="<%= comment.id %>">
<div class="author">
<h1><%= link_to comment.creator_name, user_path(comment.creator_id) %></h1>
<time datetime="<%= comment.created_at %>">
<%= time_ago_in_words(comment.created_at) %> ago
</time>
<p>
<time datetime="<%= comment.created_at %>">
<%= time_ago_in_words(comment.created_at) %> ago
</time>
</p>
<p><span class="comment-score" id="score-for-comment-<%= comment.id %>"><%= pluralize comment.score, "point" %></span></p>
</div>
<div class="content">
<div>

View File

@@ -31,7 +31,7 @@
<%= nav_link_to("My Account", user_path(CurrentUser.user)) %>
<% end %>
<%= nav_link_to("Posts", posts_path) %>
<%= nav_link_to("Comments", comments_path) %>
<%= nav_link_to("Comments", comments_path(:group_by => "post")) %>
<%= nav_link_to("Notes", notes_path) %>
<%= nav_link_to("Artists", artists_path(:order => "date")) %>
<%= nav_link_to("Tags", tags_path(:order => "date")) %>

View File

@@ -1,5 +1,5 @@
<div style="margin-bottom: 1em;">
<% form_tag({:action => "index"}, :method => :get) do %>
<% form_tag(tag_aliases_path, :method => :get) do %>
<%= text_field_tag "query", params[:query] %>
<%= submit_tag "Search Aliases" %>
<%= submit_tag "Search Implications" %>
@@ -12,7 +12,7 @@
<thead>
<tr>
<th width="1%"></th>
<th width="19%">Alias</th>
<th width="19%">From</th>
<th width="20%">To</th>
<th width="60%">Reason</th>
</tr>