Commit 4de41a6b authored by Leigh B Stoller's avatar Leigh B Stoller

Fix up the foreign admin view of the extension history.

parent 088cce82
......@@ -92,6 +92,7 @@ function (_, sup, moment, marked, UriTemplate, ShowImagingModal,
registered: window.APT_OPTIONS.registered,
isadmin: window.APT_OPTIONS.isadmin,
isfadmin: window.APT_OPTIONS.isfadmin,
extensions: extensions,
errorURL: errorURL,
paniced: paniced,
project: window.APT_OPTIONS.project,
......@@ -161,11 +162,7 @@ function (_, sup, moment, marked, UriTemplate, ShowImagingModal,
$('button#extend_button').click(function (event) {
event.preventDefault();
if (isfadmin) {
if ($('#extension_history').length) {
$("#fadmin_extend_history")
.text($('#extension_history').text());
sup.ShowModal("#extend_history_modal");
}
sup.ShowModal("#extend_history_modal");
return;
}
if (isadmin) {
......
<style>
.scrollable-panel {
max-height:350px;
overflow-y:scroll;
}
.fixedsize-panel {
max-height:350px;
height:350px;
......@@ -7,6 +11,14 @@
max-height:250px;
height:250px;
}
.history-tstamp {
min-width: 100px;
width:100px;
max-width: 100px;
}
pre {
white-space: pre-wrap;
}
</style>
<div class='row'>
<div class='col-lg-6 col-lg-offset-3
......@@ -561,13 +573,43 @@
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal'
aria-hidden='true'>&times;</button>
<h5>
<a data-toggle="collapse"
href="#history">Extension History</a>
</h5>
<h5>Extension History</h5>
</div>
<div class='modal-body'>
<pre id="fadmin_extend_history"></pre>
<div class='modal-body scrollable-panel'>
<table class="table table-condensed">
<thead>
<tr>
<th>Date</th>
<th>Action</th>
<th>Wanted</th>
<th>Granted</th>
</tr>
</thead>
<tbody>
<% _.each(extensions, function(extension, idx) { %>
<tr>
<td rowspan="2" class="history-tstamp">
<%- extension.tstamp %></td>
<td>
<% if (extension.action == "request" && extension.admin == "1") { %>
admin<% } else { %><%- extension.action %><% } %>
</td>
<% if (extension.action == "request") { %>
<td><%- extension.wanted %></td>
<td><%- extension.granted %></td>
<% } else { %>
<td>n/a</td>
<td>n/a</td>
<% } %>
</tr>
<tr>
<td colspan="3">
<pre class="history-reason"><%- extension.reason %></pre>
</td>
</tr>
<% }); %>
</tbody>
</table>
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment