Remove reporting of changesets

This commit is contained in:
Andy Allan 2018-02-28 14:39:40 +08:00
parent 80a241f798
commit 3006ce9713
7 changed files with 4 additions and 22 deletions

View file

@ -88,7 +88,7 @@ class IssuesController < ApplicationController
def set_issues
@admin_issues = %w[DiaryEntry DiaryComment User]
@moderator_issues = %w[Changeset Note]
@moderator_issues = %w[Note]
end
def check_if_updated

View file

@ -7,8 +7,6 @@ module IssuesHelper
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
@ -22,8 +20,6 @@ module IssuesHelper
reportable.display_name
when DiaryComment
"#{reportable.diary_entry.title}, Comment id ##{reportable.id}"
when Changeset
"Changeset ##{reportable.id}"
when Note
"Note ##{reportable.id}"
end

View file

@ -93,7 +93,7 @@ class Issue < ActiveRecord::Base
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

View file

@ -33,7 +33,6 @@ class Report < ActiveRecord::Base
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

View file

@ -3,11 +3,6 @@
<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 %>
&nbsp;&#9872;
<% end %>
<% end %>
</h2>
<div class="browse-section">

View file

@ -131,7 +131,6 @@ en:
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}"
@ -1000,13 +999,6 @@ en:
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

View file

@ -25,7 +25,7 @@ class IssueTest < ActiveSupport::TestCase
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
@ -33,7 +33,7 @@ class IssueTest < ActiveSupport::TestCase
assert_equal "administrator", issue.assigned_role
issue = Issue.new
issue.reportable = changeset
issue.reportable = note
issue.save!
assert_equal "moderator", issue.assigned_role