Remove site reporting link.

It was 49% spam, 50% trolling, and 1% legitimate reports.
This commit is contained in:
Kyle Drake 2017-02-09 11:22:25 -08:00
parent f6550555b0
commit dc38851163
2 changed files with 1 additions and 70 deletions

View file

@ -234,39 +234,6 @@ post '/site/:username/confirm_email' do
end
end
post '/site/:username/report' do |username|
site = Site[username: username]
redirect request.referer if site.nil?
if !recaptcha_valid?
flash[:error] = 'Captcha was not filled out (or was filled out incorrectly)'
redirect request.referer
end
report = Report.new site_id: site.id, type: params[:type], comments: params[:comments]
if current_site
redirect request.referer if current_site.id == site.id
report.reporting_site_id = current_site.id
else
report.ip = request.ip
end
report.save
EmailWorker.perform_async({
from: 'web@neocities.org',
to: 'report@neocities.org',
subject: "[Neocities Report] #{site.username} has been reported for #{report.type}",
body: "Reported by #{report.reporting_site_id ? report.reporting_site.username : report.ip}: #{report.comments}"
})
flash[:success] = "Thank you for the report, we will look into it."
redirect request.referer
end
post '/site/:username/block' do |username|
require_login
site = Site[username: username]

View file

@ -107,13 +107,11 @@
<% if site != current_site %>
<div class="report">
<a href="#report" data-toggle="modal">Report</a>
<% if signed_in? %>
|
<% if current_site && current_site.is_blocking?(site) %>
<a href="#">Unblock</a>
<% else %>
<a href="#block" data-toggle="modal">Block</a>
<a href="#block" data-toggle="modal">Block Site</a>
<% end %>
<% end %>
</div>
@ -122,40 +120,6 @@
</div></div>
</div>
<div class="modal hide fade" id="report" tabindex="-1" role="dialog" aria-labelledby="reportLabel" aria-hidden="true">
<form method="POST" action="/site/<%= site.username %>/report">
<input type="hidden" value="<%= csrf_token %>" name="csrf_token">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
<h3 id="reportLabel">Report Site</h3>
</div>
<div class="modal-body">
<p>
What is the reason you are reporting this site?
<select name="type" class="input-Area">
<option value="spam">Site is spamming</option>
<option value="phishing">Site is being used for a phishing attack</option>
<option value="abusive">Site is abusive or threatening</option>
<option value="harassment">Site is harassing other sites</option>
<option value="content">Site contains inappropriate/illegal content</option>
<option value="other">Other</option>
</select>
</p>
<p>Please describe the problem:</p>
<textarea name="comments" type="text" style="width: 400px; margin-bottom: 20px;"></textarea>
<p>Please fill out the captcha so we know you're not a robot:</p>
<div class="recaptcha" style="margin-bottom: 20px">
<%== recaptcha_tag :challenge, ssl: request.ssl? %>
</div>
</div>
<div class="modal-footer">
<button class="btn cancel" data-dismiss="modal" aria-hidden="true">Cancel</button>
<button type="submit" class="btn-Action">Report</button>
</div>
</form>
</div>
<div class="modal hide fade" id="block" tabindex="-1" role="dialog" aria-labelledby="blockLabel" aria-hidden="true">
<form method="POST" action="/site/<%= site.username %>/block">
<input type="hidden" value="<%= csrf_token %>" name="csrf_token">