further improvements to site inspector

This commit is contained in:
Kyle Drake 2015-12-29 22:48:46 -06:00
parent c6077724be
commit 0c81f212b6
2 changed files with 13 additions and 3 deletions

View file

@ -14,6 +14,7 @@ end
get '/admin/site/:username' do |username|
require_admin
@site = Site[username: username]
not_found if @site.nil?
@title = "Site Inspector - #{@site.username}"
erb :'admin/site'
end

View file

@ -7,7 +7,7 @@
<div class="content misc-page single-Col txt-Center" style="padding-top: 20px;">
<div>
<div style="float: left;">
<form action="/admin/banhammer" target="_blank" method="POST">
<%== csrf_token_input_html %>
<input type="hidden" name="username" value="<%= @site.username %>">
@ -21,6 +21,15 @@
</form>
</div>
<div style="float: right;">
<form method="GET" onsubmit="window.location.href = '/admin/site/'+$('#sitename').val(); return false">
<input id="sitename" type="text" placeholder="sitename" autocomplete="off"><br>
<input type="submit" class="btn-Action" value="Lookup">
</form>
</div>
<div style="clear: both"></div>
<h3>Site Pages</h3>
<table>
@ -49,7 +58,7 @@
<button>Ham</button>
</form>
<form action="/admin/site_files/train" target="_blank" method="POST" onsubmit="return confirm('Confirm spam train of <%= "#{@site.username}/#{site_file.path}" %>');">
<form action="/admin/site_files/train" target="_blank" method="POST">
<%== csrf_token_input_html %>
<input type="hidden" name="site_id" value="<%= @site.id %>">
<input type="hidden" name="path" value="<%= site_file.path %>">
@ -57,7 +66,7 @@
<button>Spam</button>
</form>
<form action="/admin/site_files/train" target="_blank" method="POST" onsubmit="return confirm('Confirm phishing train of <%= "#{@site.username}/#{site_file.path}" %>');">
<form action="/admin/site_files/train" target="_blank" method="POST">
<%== csrf_token_input_html %>
<input type="hidden" name="site_id" value="<%= @site.id %>">
<input type="hidden" name="path" value="<%= site_file.path %>">