private
def required_new_report_params_present?
- create_new_report_params['reportable_id'].present? && create_new_report_params['reportable_type'].present?
+ create_new_report_params["reportable_id"].present? && create_new_report_params["reportable_type"].present?
end
def create_new_report_params
--- /dev/null
+module ReportsHelper
+ def report_link(name, reportable)
+ link_to name, new_report_url(:reportable_id => reportable.id, :reportable_type => reportable.class.name)
+ end
+end
<br/>
<%= note_event(@note.status, @note.closed_at, @note_comments.last.author) %>
<% end %>
- <% if current_user && current_user != @note.author %>
- <%= link_to new_report_url(reportable_id: @note.id, reportable_type: @note.class.name), :title => t('browse.note.report') do %>
- ⚐
- <% end %>
- <% end %>
</div>
<% if @note_comments.find { |comment| comment.author.nil? } -%>
<p class='warning'><%= t "javascripts.notes.show.anonymous_warning" %></p>
<% end -%>
+ <% if current_user && current_user != @note.author %>
+ <p class="deemphasize"><%= report_link(t(".report"), @note) %></p>
+ <% end %>
+
<% if @note_comments.length > 1 %>
<div class='note-comments'>
<ul>
<%= user_thumbnail diary_comment.user %>
<p class="deemphasize comment-heading" id="comment<%= diary_comment.id %>"><%= raw(t('diary_entry.diary_comment.comment_from', :link_user => (link_to h(diary_comment.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_comment.user.display_name), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}"))) %>
<% if current_user and diary_comment.user.id != current_user.id %>
- <%= link_to new_report_url(reportable_id: diary_comment.id, reportable_type: diary_comment.class.name), :title => t('diary_entry.diary_comment.report') do %>
- ⚐
- <% end %>
+ | <%= report_link(t(".report"), diary_comment) %>
<% end %>
</p>
<h2><%= link_to h(diary_entry.title), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id %></h2>
- <% if current_user and diary_entry.user != current_user %>
- <%= link_to new_report_url(reportable_id: diary_entry.id, reportable_type: diary_entry.class.name), :title => t('diary_entry.diary_entry.report') do %>
- ⚐
- <% end %>
- <% end %>
-
<small class='deemphasize'>
<%= raw(t 'diary_entry.diary_entry.posted_by', :link_user => (link_to h(diary_entry.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_entry.user.display_name), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to h(diary_entry.language.name), :controller => 'diary_entry', :action => 'list', :display_name => nil, :language => diary_entry.language_code)) %>
</small>
<%= link_to t('diary_entry.diary_entry.edit_link'), :action => 'edit', :display_name => diary_entry.user.display_name, :id => diary_entry.id %>
<% end %>
+ <% if current_user and diary_entry.user != current_user %>
+ <li>
+ <%= report_link(t(".report"), diary_entry) %>
+ </li>
+ <% end %>
+
<%= if_administrator(:li) do %>
<%= link_to t('diary_entry.diary_entry.hide_link'), hide_diary_entry_path(:display_name => diary_entry.user.display_name, :id => diary_entry.id), :method => :post, :data => { :confirm => t('diary_entry.diary_entry.confirm') } %>
<% end %>
<% if current_user and @this_user.id != current_user.id %>
<li>
- <%= link_to new_report_url(reportable_id: @this_user.id, reportable_type: @this_user.class.name), :title => t('user.view.report') do %>
- ⚐
- <% end %>
+ <%= report_link(t(".report"), @this_user) %>
</li>
<% end %>
</ul>
reopened_by: "Reactivated by %{user} <abbr title='%{exact_time}'>%{when} ago</abbr>"
reopened_by_anonymous: "Reactivated by anonymous <abbr title='%{exact_time}'>%{when} ago</abbr>"
hidden_by: "Hidden by %{user} <abbr title='%{exact_time}'>%{when} ago</abbr>"
- report: Report this note?
+ report: Report this note
query:
title: "Query Features"
introduction: "Click on the map to find nearby features."
edit_link: Edit this entry
hide_link: Hide this entry
confirm: Confirm
- report: Report this entry?
+ report: Report this entry
diary_comment:
comment_from: "Comment from %{link_user} on %{comment_created_at}"
hide_link: Hide this comment
confirm: Confirm
- report: Report this comment?
+ report: Report this comment
location:
location: "Location:"
view: "View"
friends_diaries: "friends' diary entries"
nearby_changesets: "nearby user changesets"
nearby_diaries: "nearby user diary entries"
- report: "Report this user?"
+ report: Report this User
popup:
your location: "Your location"
nearby mapper: "Nearby mapper"