def set_issues
@admin_issues = %w[DiaryEntry DiaryComment User]
- @moderator_issues = %w[Changeset Note]
+ @moderator_issues = %w[Note]
end
def check_if_updated
url_for(:controller => reportable.class.name.underscore, :action => :view, :display_name => reportable.display_name)
when DiaryComment
url_for(:controller => reportable.diary_entry.class.name.underscore, :action => :view, :display_name => reportable.diary_entry.user.display_name, :id => reportable.diary_entry.id, :anchor => "comment#{reportable.id}")
- when Changeset
- url_for(:controller => :browse, :action => :changeset, :id => reportable.id)
when Note
url_for(:controller => :browse, :action => :note, :id => reportable.id)
end
reportable.display_name
when DiaryComment
"#{reportable.diary_entry.title}, Comment id ##{reportable.id}"
- when Changeset
- "Changeset ##{reportable.id}"
when Note
"Note ##{reportable.id}"
end
end
def set_default_assigned_role
- role = %w[Changeset Note].include?(reportable.class.name) ? "moderator" : "administrator"
+ role = %w[Note].include?(reportable.class.name) ? "moderator" : "administrator"
self.assigned_role = role if assigned_role.blank?
end
end
when "DiaryEntry" then %w[spam offensive threat other]
when "DiaryComment" then %w[spam offensive threat other]
when "User" then %w[spam offensive threat vandal other]
- when "Changeset" then %w[undiscussed_import mechanical_edit edit_error spam vandalism other]
when "Note" then %w[spam vandalism personal abusive other]
else %w[other]
end
<h2>
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
<%= t('browse.changeset.title', :id => @changeset.id) %>
- <% if current_user and current_user.id != @changeset.user.id %>
- <%= link_to new_report_url(reportable_id: @changeset.id, reportable_type: @changeset.class.name), :title => t('browse.changeset.report') do %>
- ⚐
- <% end %>
- <% end %>
</h2>
<div class="browse-section">
title_comment: "Changeset %{id} - %{comment}"
join_discussion: "Log in to join the discussion"
discussion: Discussion
- report: Report this changeset?
still_open: "Changeset still open - discussion will open once the changeset is closed."
node:
title: "Node: %{name}"
threat: This User profile contains a threat
vandal: This User is a vandal
other: Other
- Changeset:
- undiscussed_import: This changeset is an undiscussed import
- mechanical_edit: This changeset is a mechanical edit
- edit_error: This changeset contains a newbie or an editor error
- spam: This changeset is/contains spam
- vandalism: This changeset is/contains vandalism
- other: Other
Note:
spam: This note is spam
vandalism: This note is vandalism
def test_default_assigned_role
create(:language, :code => "en")
diary_entry = create(:diary_entry)
- changeset = create(:changeset)
+ note = create(:note_with_comments)
issue = Issue.new
issue.reportable = diary_entry
assert_equal "administrator", issue.assigned_role
issue = Issue.new
- issue.reportable = changeset
+ issue.reportable = note
issue.save!
assert_equal "moderator", issue.assigned_role