summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Frye <joshfng@gmail.com>2016-01-12 12:36:28 -0500
committerJosh Frye <joshfng@gmail.com>2016-01-12 12:55:13 -0500
commit62aebc8541a164e3935cdeef335659bf4dc97839 (patch)
tree96946aede7d3fb79a6a9c9e39dde7cfe058526a4
parentd047db910a7cbac7f61b74bb580df3986acb767e (diff)
downloadgitlab-ce-62aebc8541a164e3935cdeef335659bf4dc97839.tar.gz
Autofill abuse message text with user url. Closes #2838
-rw-r--r--CHANGELOG1
-rw-r--r--app/controllers/abuse_reports_controller.rb1
-rw-r--r--app/views/abuse_reports/new.html.haml2
-rw-r--r--app/views/users/show.html.haml2
4 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 7dd17251663..df1d281ce28 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -42,6 +42,7 @@ v 8.4.0 (unreleased)
- Ajax filter by message for commits page
- API: Add support for deleting a tag via the API (Robert Schilling)
- Allow subsequent validations in CI Linter
+ - Autofill referring url in message box when reporting user abuse. (Josh Frye)
v 8.3.4
- Use gitlab-workhorse 0.5.4 (fixes API routing bug)
diff --git a/app/controllers/abuse_reports_controller.rb b/app/controllers/abuse_reports_controller.rb
index 38814459f66..2eac0cabf7a 100644
--- a/app/controllers/abuse_reports_controller.rb
+++ b/app/controllers/abuse_reports_controller.rb
@@ -2,6 +2,7 @@ class AbuseReportsController < ApplicationController
def new
@abuse_report = AbuseReport.new
@abuse_report.user_id = params[:user_id]
+ @ref_url = params.fetch(:ref_url, '')
end
def create
diff --git a/app/views/abuse_reports/new.html.haml b/app/views/abuse_reports/new.html.haml
index 3e5cdd2ce4a..8d31182a3e6 100644
--- a/app/views/abuse_reports/new.html.haml
+++ b/app/views/abuse_reports/new.html.haml
@@ -16,7 +16,7 @@
.form-group
= f.label :message, class: 'control-label'
.col-sm-10
- = f.text_area :message, class: "form-control js-quick-submit", rows: 2, required: true
+ = f.text_area :message, class: "form-control js-quick-submit", rows: 2, required: true, value: @ref_url
.help-block
Explain the problem with this user. If appropriate, provide a link to the relevant issue or comment.
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index ce17fc7bca1..25e31b1ed27 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -59,7 +59,7 @@
data: { toggle: 'tooltip', placement: 'left', container: 'body' }}
= icon('exclamation-circle')
- else
- = link_to new_abuse_report_path(user_id: @user.id), class: 'btn btn-gray',
+ = link_to new_abuse_report_path(user_id: @user.id, ref_url: request.referrer), class: 'btn btn-gray',
title: 'Report abuse', data: {toggle: 'tooltip', placement: 'left', container: 'body'} do
= icon('exclamation-circle')
- if current_user