{% extends "OpenBench/base.html" %}
{% load mytags %}
{% block style %}
{% load static %}
{% endblock %}
{% block scripts %}
function copy_statblock() {
var text = document.getElementById("long-statblock").innerHTML;
text = text.replace(/
/g, "\n");
text += "\n" + window.location.href;
// navigator.clipboard.writeText(text); // Optimal solution
// Suboptimal, HTTP solution
var area = document.createElement("textarea");
area.value = text;
document.body.append(area);
area.focus();
area.select();
try {
document.execCommand("copy");
document.body.removeChild(area);
}
catch (err) {
document.body.removeChild(area);
console.error("Unable to copy to Clipboard");
}
}
{% endblock %}
{% block content %}
{% if not test.approved and profile.approver and profile.user.username != test.author %}
Approve
{% elif not test.approved and request.user.is_superuser %}
Approve
{% else %}
Approve
{% endif %}
{% if test.finished and profile.approver %}
Restart
{% elif test.finished and profile.user.username == test.author %}
Restart
{% elif test.finished %}
Restart
{% endif %}
{% if not test.finished and profile.approver %}
Stop
{% elif not test.finished and profile.user.username == test.author %}
Stop
{% elif not test.finished %}
Stop
{% endif %}
{% if profile.approver or profile.user.username == test.author %}
Delete
{% else %}
Delete
{% endif %}
{{test|longStatBlock|linebreaksbr}}