Commit f760f0d6 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Address Mike nits in issue #284 ...

parent 8ab4519f
...@@ -359,14 +359,16 @@ $(function () ...@@ -359,14 +359,16 @@ $(function ()
{ {
var modified = 0; var modified = 0;
// Panel starts out collapsed and read only. When it is expanded, // Panel starts out collapsed.
// change the button to edit.
$('#adminnotes-collapse').on('show.bs.collapse', function () { $('#adminnotes-collapse').on('show.bs.collapse', function () {
$('#adminnotes-row .toggle').html('Hide'); $('#adminnotes-row .toggle').html('Hide');
}); });
$('#adminnotes-collapse').on('hide.bs.collapse', function () { $('#adminnotes-collapse').on('hide.bs.collapse', function () {
$('#adminnotes-row .toggle').html('View'); var label = "View";
if ($("#adminnotes-collapse textarea").val() == "") {
label = "Add";
}
$('#adminnotes-row .toggle').html(label);
}); });
$("#adminnotes-collapse textarea") $("#adminnotes-collapse textarea")
.on("change input paste keyup", function() { .on("change input paste keyup", function() {
......
...@@ -105,6 +105,7 @@ $(function () ...@@ -105,6 +105,7 @@ $(function ()
repourl: window.APT_OPTIONS.repourl, repourl: window.APT_OPTIONS.repourl,
reporef: window.APT_OPTIONS.reporef, reporef: window.APT_OPTIONS.reporef,
repohash: window.APT_OPTIONS.repohash, repohash: window.APT_OPTIONS.repohash,
hasnotes: window.APT_OPTIONS.hasnotes,
}; };
var status_html = statusTemplate(template_args); var status_html = statusTemplate(template_args);
$('#status-body').html(status_html); $('#status-body').html(status_html);
......
...@@ -280,6 +280,8 @@ if (isset($maxextend) && $maxextend != "") { ...@@ -280,6 +280,8 @@ if (isset($maxextend) && $maxextend != "") {
else { else {
echo " window.APT_OPTIONS.MAXEXTEND = null;\n"; echo " window.APT_OPTIONS.MAXEXTEND = null;\n";
} }
echo " window.APT_OPTIONS.hasnotes = " .
($instance->admin_notes() && $instance->admin_notes() != "" ? 1 : 0) . ";\n";
if ($instance->repourl()) { if ($instance->repourl()) {
echo " window.APT_OPTIONS.repourl = '" . $instance->repourl() . "';\n"; echo " window.APT_OPTIONS.repourl = '" . $instance->repourl() . "';\n";
if ($instance->reporef()) { if ($instance->reporef()) {
......
...@@ -130,7 +130,9 @@ ...@@ -130,7 +130,9 @@
<a class='btn btn-primary btn-xs pull-right toggle' <a class='btn btn-primary btn-xs pull-right toggle'
href="#adminnotes-collapse" href="#adminnotes-collapse"
data-toggle="collapse" data-toggle="collapse"
type='button'>View</a> type='button'>
<% if (expinfo.admin_notes == "") { %>Add<% } else { %>View<% } %>
</a>
<a class='btn btn-danger btn-xs pull-right hidden' hidden <a class='btn btn-danger btn-xs pull-right hidden' hidden
style="margin-right: 10px;" style="margin-right: 10px;"
id="adminnotes-save-button" id="adminnotes-save-button"
...@@ -141,7 +143,7 @@ ...@@ -141,7 +143,7 @@
class="panel-collapse collapse"> class="panel-collapse collapse">
<div class='panel-body'> <div class='panel-body'>
<textarea style="width: 100%;" rows="3" <textarea style="width: 100%;" rows="3"
placeholder="Click Edit to add/change admin notes" placeholder="Put admin notes here and click Save"
><%= expinfo.admin_notes %></textarea> ><%= expinfo.admin_notes %></textarea>
</div> </div>
</div> </div>
......
...@@ -276,6 +276,14 @@ pre { ...@@ -276,6 +276,14 @@ pre {
<span <% if (paniced) { %>class="text-danger"<% } %> > <span <% if (paniced) { %>class="text-danger"<% } %> >
Quarantined</span></label> Quarantined</span></label>
</div> </div>
<div class='pull-left
<% if (!hasnotes) { %>hidden<% } %>'
data-toggle='popover'
data-delay='{"hide":500, "show":500}'
data-content="This experiment has admin notes">
<a target="_blank"
href='adminextend.php?uuid=<%= uuid %>'>Admin Notes</a>
</div>
<% } %> <% } %>
</div> </div>
</div> </div>
......
Supports Markdown
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