comment.update_attributes(:visible => false)
redirect_to :action => "view", :display_name => comment.diary_entry.user.display_name, :id => comment.diary_entry.id
end
+
+ def comments
+ @this_user = User.active.find_by_display_name(params[:display_name])
+
+ if @this_user
+ @comment_pages, @comments = paginate(:diary_comments,
+ :conditions => { :user_id => @this_user },
+ :order => 'created_at DESC',
+ :per_page => 20)
+ @page = (params[:page] || 1).to_i
+ else
+ @title = t'diary_entry.no_such_user.title'
+ @not_found_user = params[:display_name]
+ render :action => 'no_such_user', :status => :not_found
+ end
+ end
private
##
# require that the user is a administrator, or fill out a helpful error message
--- /dev/null
+<h1><%= @title%>
+ <%= t('diary_entry.comments.has_commented_on',:display_name => @this_user.display_name) %>
+</h1>
+<p>
+<br>
+<table id="comment-list-container">
+<tr><th>Title</th><th>Date</th><th>Comment</th></tr>
+<% for comment in @comments %>
+<tr id="comment-row">
+<td><a href="/user/<%= comment.diary_entry.user.display_name %>/diary/<%= comment.diary_entry.id %>"><%= comment.diary_entry.title %></a>
+</td>
+<td>
+<span class="date"><%= comment.created_at %></span>
+</td>
+<td>
+<%= htmlize(comment.body) %></td></tr>
+<% end %>
+</table>
+<%= link_to t('diary_entry.comments.older_comments') , { :page => @comment_pages.current.next} if @comment_pages.current.next %>
+<% if @comment_pages.current.next and @comment_pages.current.previous %>
+|
+<% end %>
+<%= link_to t('diary_entry.comments.newer_comments'), { :page => @comment_pages.current.previous } if @comment_pages.current.previous %>
|
<%= link_to t('user.view.new diary entry'), :controller => 'diary_entry', :action => 'new', :display_name => @user.display_name %>
|
+ <%= link_to t('user.view.my comments' ), :controller => 'diary_entry', :action => 'comments', :display_name => @this_user.display_name %><br/>
+ |
<%= link_to t('user.view.my edits'), :controller => 'changeset', :action => 'list', :display_name => @user.display_name %>
|
<%= link_to t('user.view.my traces'), :controller => 'trace', :action=>'mine' %>
|
<%= link_to t('user.view.diary'), :controller => 'diary_entry', :action => 'list', :display_name => @this_user.display_name %>
|
+ <%= link_to t('user.view.comments'), :controller => 'diary_entry', :action => 'comments', :display_name => @this_user.display_name %>
+ |
<%= link_to t('user.view.edits'), :controller => 'changeset', :action => 'list', :display_name => @this_user.display_name %>
|
<%= link_to t('user.view.traces'), :controller => 'trace', :action => 'list', :display_name => @this_user.display_name %>
all:
title: "OpenStreetMap diary entries"
description: "Recent diary entries from users of OpenStreetMap"
+ comments:
+ has_commented_on: "%{display_name} has commented on the following diary entries"
+ newer_comments: "Newer Comments"
+ older_comments: "Older Comments"
export:
start:
area_to_export: "Area to Export"
my edits: my edits
my traces: my traces
my settings: my settings
+ my comments: my comments
oauth settings: oauth settings
blocks on me: blocks on me
blocks by me: blocks by me
moderator: "Revoke moderator access"
block_history: "view blocks received"
moderator_history: "view blocks given"
+ comments: "comments"
create_block: "block this user"
activate_user: "activate this user"
deactivate_user: "deactivate this user"
match '/user/:display_name/diary/rss' => 'diary_entry#rss', :format => :rss
match '/diary/:language/rss' => 'diary_entry#rss', :format => :rss
match '/diary/rss' => 'diary_entry#rss', :format => :rss
+ match '/user/:display_name/diary/comments/:page' => 'diary_entry#comments', :page => /\d+/
+ match '/user/:display_name/diary/comments/' => 'diary_entry#comments'
match '/user/:display_name/diary' => 'diary_entry#list'
match '/diary/:language' => 'diary_entry#list'
match '/diary' => 'diary_entry#list'