Files
OpenBench/Templates/OpenBench/test.html
T

148 lines
6.0 KiB
HTML

{% extends "OpenBench/base.html" %}
{% load mytags %}
{% block style %}
{% load static %}
{% endblock %}
{% block content %}
<div id="configuration">
<table class="datatable left-align">
<tr><th>Author</th><td>{{test.author|capfirst}}</td></tr>
<tr><th>Creation</th><td class="timestamp">{{test.creation|date:'U'}}</td></tr>
<tr><th>Engine</th><td>{{test.engine}}</td></tr>
<tr><th>Dev Branch</th><td>{{test.dev.name|prettyName}}</td></tr>
<tr><th>Dev Bench</th><td>{{test.dev.bench}}</td></tr>
<tr><th>Dev Options</th><td>{{test.devoptions}}</td></tr>
<tr><th>Dev Sha</th><td>{{test.dev.sha}}</td></tr>
{% if test.devnetwork %}
<tr>
<th>Dev Network</th>
<td><a href="{{test.devnetwork|resolveNetworkURL}}">{{test.devnetname}}</td>
</tr>
{% endif %}
<tr><th>Base Branch</th><td>{{test.base.name|prettyName}}</td></tr>
<tr><th>Base Bench</th><td>{{test.base.bench}}</td></tr>
<tr><th>Base Options</th><td>{{test.baseoptions}}</td></tr>
<tr><th>Base Sha</th><td>{{test.base.sha}}</td></tr>
{% if test.basenetwork %}
<tr>
<th>Base Network</th>
<td><a href="{{test.basenetwork|resolveNetworkURL}}">{{test.basenetname}}</td>
</tr>
{% endif %}
<tr><th>Source Repo</th><td><a href="{{test.source}}">{{test.source}}</a></td></tr>
<tr><th>Opening Book</th><td><a href="{{config.framework}}/raw/master/Books/">{{test.bookname}}</a></td></tr>
<tr><th>Syzygy WDL</th><td>{{test.syzygy_wdl}}</td></tr>
<tr><th>Syzygy ADJ.</th><td>{{test.syzygy_adj}}</td></tr>
<tr><th>Win ADJ.</th><td>{{test.win_adj}}</td></tr>
<tr><th>Draw ADJ.</th><td>{{test.draw_adj}}</td></tr>
</table>
</div>
<div id="actions">
<!-- Dev vs Base [Git Diff Link] -->
<h4><a href="{{test|gitDiffLink}}">
{{test.dev.name|prettyName}} vs {{test.base.name|prettyName}}
</a></h4>
<!-- Approve Button: For Admins, or Cross-approvers -->
{% if not test.approved and profile.approver and profile.user.username != test.author %}
<a class="anchorbutton" id="approvebutton" href="/test/{{test.id}}/APPROVE">Approve</a>
{% elif not test.approved and request.user.is_superuser %}
<a class="anchorbutton" id="approvebutton" href="/test/{{test.id}}/APPROVE">Approve</a>
{% else %}
<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="/test/{{test.id}}/RESTART">Restart</a>
{% elif test.finished and profile.user.username == test.author %}
<a class="anchorbutton" id="stopbutton" href="/test/{{test.id}}/RESTART">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="/test/{{test.id}}/STOP">Stop</a>
{% elif not test.finished and profile.user.username == test.author %}
<a class="anchorbutton" id="restartbutton" href="/test/{{test.id}}/STOP">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 == test.author %}
<a class="anchorbutton" id="deletebutton" href="/test/{{test.id}}/DELETE">Delete</a>
{% else %}
<a class="anchorbutton deadbutton">Delete</a>
{% endif %}
<!-- Elo, (SPRT/LRR if SPRT, otherwise CONF), Games -->
<pre>{{test|longStatBlock|linebreaksbr}}</pre>
<!-- Forum to modify the Priority or Throughput -->
<form method="POST" action="/test/{{test.id}}/MODIFY">
{% csrf_token %}
<label>Priority</label><input value="{{test.priority}}" name="priority"><br>
<label>Throughput</label><input value="{{test.throughput}}" name="throughput"><br>
<!-- Edit Button: For Approvers or Test Authors -->
{% if profile.approver or profile.user.username == test.author %}
<input type="submit" name="submit" value="Modify">
{% else %}
<input class="deadbutton" type="submit" name="submit" value="Modify">
{% endif %}
</form>
</div>
<br>
<div id="results">
<table class="datatable">
<tr>
<th>#</th>
<th>User</th>
<th>OS</th>
<th>Updated</th>
<th style="width: 60px">Games</th>
<th style="width: 60px">Won</th>
<th style="width: 60px">Lost</th>
<th style="width: 60px">Drawn</th>
<th style="width: 60px">Time</th>
<th style="width: 60px">Crash</th>
</tr>
{% for result in results %}
<tr>
<td>{{result.machine.id}}</td>
<td>{{result.machine.user.username|capfirst|slice:"6"}}</td>
<td>{{result.machine.osname|truncatewords:1|slice:":-2"}}</td>
<td class="timestamp">{{result.updated|date:'U'}}</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.timeloss}}</td>
<td class="numeric">{{result.crashes}}</td>
</tr>
{% endfor %}
</table>
</div>
{% endblock %}