summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-25 10:21:22 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-25 12:37:02 +0200
commit3052e6f608c0c825c209c66e7bd2c7da995b66ab (patch)
treea8e6d59315daa576f9f7885ea2db3655f155b1d6
parentc935deeb2db88ed766f8e296000eef34c74d7508 (diff)
downloadgitlab-ce-improve-abuse-reports-stable.tar.gz
Merge branch 'improve-abuse-reports' into 'master'improve-abuse-reports-stable
Improve abuse reports management * Link to user profile instead of user admin page * One button for remove user and report * Remove user and report without page reloading Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> See merge request !1196
-rw-r--r--CHANGELOG17
-rw-r--r--app/assets/javascripts/application.js.coffee6
-rw-r--r--app/controllers/admin/abuse_reports_controller.rb9
-rw-r--r--app/views/admin/abuse_reports/_abuse_report.html.haml13
-rw-r--r--app/views/admin/abuse_reports/index.html.haml2
5 files changed, 39 insertions, 8 deletions
diff --git a/CHANGELOG b/CHANGELOG
index a37a52e2cde..e963d8f76dd 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,23 @@
Please view this file on the master branch, on stable branches it's out of date.
v 7.14.1
+v 8.0.0 (unreleased)
+ - Upgrade browser gem to 1.0.0 to avoid warning in IE11 compatibilty mode (Stan Hu)
+ - Remove user OAuth tokens from the database and request new tokens each session (Stan Hu)
+ - Only show recent push event if the branch still exists or a recent merge request has not been created (Stan Hu)
+ - Remove satellites
+ - Better performance for web editor (switched from satellites to rugged)
+ - Faster merge
+ - Ability to fetch merge requests from refs/merge-requests/:id
+ - Allow displaying of archived projects in the admin interface (Artem Sidorenko)
+ - Allow configuration of import sources for new projects (Artem Sidorenko)
+ - Search for comments should be case insensetive
+ - Create cross-reference for closing references on commits pushed to non-default branches (Maƫl Valais)
+ - Ability to search milestones
+ - Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries (Stan Hu)
+ - Improve abuse reports management from admin area
+
+v 7.14.1 (unreleased)
- Only include base URL in OmniAuth full_host parameter (Stan Hu)
- Fix Error 500 in API when accessing a group that has an avatar (Stan Hu)
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee
index bb0a0c51fd4..c263912b7ea 100644
--- a/app/assets/javascripts/application.js.coffee
+++ b/app/assets/javascripts/application.js.coffee
@@ -116,6 +116,12 @@ $ ->
$('.remove-row').bind 'ajax:success', ->
$(this).closest('li').fadeOut()
+ $('.js-remove-tr').bind 'ajax:before', ->
+ $(this).hide()
+
+ $('.js-remove-tr').bind 'ajax:success', ->
+ $(this).closest('tr').fadeOut()
+
# Initialize select2 selects
$('select.select2').select2(width: 'resolve', dropdownAutoWidth: true)
diff --git a/app/controllers/admin/abuse_reports_controller.rb b/app/controllers/admin/abuse_reports_controller.rb
index 34f37bca4ad..38a5a9fca08 100644
--- a/app/controllers/admin/abuse_reports_controller.rb
+++ b/app/controllers/admin/abuse_reports_controller.rb
@@ -4,8 +4,13 @@ class Admin::AbuseReportsController < Admin::ApplicationController
end
def destroy
- AbuseReport.find(params[:id]).destroy
+ abuse_report = AbuseReport.find(params[:id])
- redirect_to admin_abuse_reports_path, notice: 'Report was removed'
+ if params[:remove_user]
+ abuse_report.user.destroy
+ end
+
+ abuse_report.destroy
+ render nothing: true
end
end
diff --git a/app/views/admin/abuse_reports/_abuse_report.html.haml b/app/views/admin/abuse_reports/_abuse_report.html.haml
index 4449721ae38..d3afc658cd6 100644
--- a/app/views/admin/abuse_reports/_abuse_report.html.haml
+++ b/app/views/admin/abuse_reports/_abuse_report.html.haml
@@ -3,7 +3,7 @@
%tr
%td
- if reporter
- = link_to reporter.name, [:admin, reporter]
+ = link_to reporter.name, reporter
- else
(removed)
%td
@@ -12,12 +12,15 @@
= abuse_report.message
%td
- if user
- = link_to user.name, [:admin, user]
+ = link_to user.name, user
- else
(removed)
%td
- if user
- = link_to 'Block', block_admin_user_path(user), data: {confirm: 'USER WILL BE BLOCKED! Are you sure?'}, method: :put, class: "btn btn-xs btn-warning"
- = link_to 'Remove user', [:admin, user], data: { confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?" }, method: :delete, class: "btn btn-xs btn-remove"
+ = link_to 'Remove user & report', admin_abuse_report_path(abuse_report, remove_user: true),
+ data: { confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?" }, remote: true, method: :delete, class: "btn btn-xs btn-remove js-remove-tr"
+
%td
- = link_to 'Remove report', [:admin, abuse_report], method: :delete, class: "btn btn-xs btn-close"
+ - if user
+ = link_to 'Block user', block_admin_user_path(user), data: {confirm: 'USER WILL BE BLOCKED! Are you sure?'}, method: :put, class: "btn btn-xs"
+ = link_to 'Remove report', [:admin, abuse_report], remote: true, method: :delete, class: "btn btn-xs btn-close js-remove-tr"
diff --git a/app/views/admin/abuse_reports/index.html.haml b/app/views/admin/abuse_reports/index.html.haml
index 4a25848f156..2e8746146d1 100644
--- a/app/views/admin/abuse_reports/index.html.haml
+++ b/app/views/admin/abuse_reports/index.html.haml
@@ -9,7 +9,7 @@
%th Reported at
%th Message
%th User
- %th
+ %th Primary action
%th
= render @abuse_reports
= paginate @abuse_reports