Grey out illegal buttons in viewTest

This commit is contained in:
AndyGrant committed 2019-10-24 04:26:12 -04:00
1 parent 0090b64510
commit 41422d0b32
3 files changed
+60 -17

No files matched your search

+52 -15
View File
@@ -87,14 +87,47 @@
<div id="actions">
<h2>Actions</h2>
<!-- Approve Button: For Admins, or Cross-approvers -->
{% if not test.approved and profile.approver and profile.user.username is not test.author %}
<a class="anchorbutton" id="approvebutton" href="/approveTest/{{test.id}}/">Approve</a>
{% elif not test.approved and request.user.is_superuser %}
<a class="anchorbutton" id="approvebutton" href="/approveTest/{{test.id}}/">Approve</a>
{% if test.finished %}
<a class="anchorbutton" id="restartbutton" href="/restartTest/{{test.id}}/">Restart</a>
{% else %}
<a class="anchorbutton" id="stopbutton" href="/stopTest/{{test.id}}/">Stop</a>
<a class="anchorbutton deadbutton">Approve</a>
{% endif %}
<!-- Restart Button: For Approvers or Test Authors of finished tests -->
{% if test.finished and profile.approver %}
<a class="anchorbutton" id="stopbutton" href="/restartTest/{{test.id}}/">Restart</a>
{% elif test.finished and profile.user.username is test.author %}
<a class="anchorbutton" id="stopbutton" href="/restartTest/{{test.id}}/">Restart</a>
{% elif test.finished %}
<a class="anchorbutton deadbutton">Restart</a>
{% endif %}
<!-- Stop Button: For Approvers or Test Authors of active tests -->
{% if not test.finished and profile.approver %}
<a class="anchorbutton" id="restartbutton" href="/stopTest/{{test.id}}/">Stop</a>
{% elif not test.finished and profile.user.username is test.author %}
<a class="anchorbutton" id="restartbutton" href="/stopTest/{{test.id}}/">Stop</a>
{% elif not test.finished %}
<a class="anchorbutton deadbutton">Stop</a>
{% endif %}
<!-- Delete Button: For Approvers or Test Authors -->
{% if profile.approver or profile.user.username is test.author %}
<a class="anchorbutton" id="deletebutton" href="/deleteTest/{{test.id}}/">Delete</a>
<h4>{{test.dev.name}} vs {{test.base.name}} <a href="{{test|gitDiffLink}}">DIFF</a></h4>
{% else %}
<a class="anchorbutton deadbutton">Delete</a>
{% endif %}
<!-- Dev vs Base [Git Diff Link] -->
<h4>{{test.dev.name}} vs {{test.base.name}}
<a href="{{test|gitDiffLink}}">DIFF</a>
</h4>
<!-- ELO, SPRT, LLR, Games -->
<pre>{{test|longStatBlock|linebreaksbr}}</pre>
<form method="POST" action="/editTest/{{test.id}}/">
@@ -103,7 +136,11 @@
<input value="{{test.priority}}" name="priority"></br>
<label>Throughput</label>
<input value="{{test.throughput}}" name="throughput"></br>
{% if profile.approver or profile.user.username is test.author %}
<input type="submit" name="submit" value="Modify">
{% else %}
<input class="deadbutton" type="submit" name="submit" value="Modify">
{% endif %}
</form>
</div>
<br>
@@ -121,17 +158,17 @@
<th>Time</th>
</tr>
{% for result in results %}
<tr>
<td>{{result.machine.owner}}</td>
<td>{{result.machine.osname}}</td>
<td>{{result.updated|date:'Y-m-d H:i'}}</td>
<td class="numeric">{{result.games}}</td>
<td class="numeric">{{result.wins}}</td>
<td class="numeric">{{result.losses}}</td>
<td class="numeric">{{result.draws}}</td>
<td class="numeric">{{result.crashes}}</td>
<td class="numeric">{{result.timeloss}}</td>
</tr>
<tr>
<td>{{result.machine.owner}}</td>
<td>{{result.machine.osname}}</td>
<td>{{result.updated|date:'Y-m-d H:i'}}</td>
<td class="numeric">{{result.games}}</td>
<td class="numeric">{{result.wins}}</td>
<td class="numeric">{{result.losses}}</td>
<td class="numeric">{{result.draws}}</td>
<td class="numeric">{{result.crashes}}</td>
<td class="numeric">{{result.timeloss}}</td>
</tr>
{% endfor %}
</table>
</div>