Redesign workload view: card layout, labelled actions, page header
Markup-only changes around the existing Django logic; the LLR script, copy_text() targets (#long-statblock, #spsa-input, #spsa-output) and all form field ids/names are untouched. Copy actions are now real <button>s (keyboard accessible) and disabled actions are no longer fake links.
This commit is contained in:
1 parent
a506ae3b5a
commit
8969b8d4dd
1 file changed
+38
-32
@@ -187,12 +187,15 @@
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_head %}<div><h1 class="page-title">{{ type|title }} #{{ workload.id }}</h1><p class="page-sub">{{ workload.dev.name|prettyName }} · by {{ workload.author|capfirst }}</p></div><div class="page-actions">{% if workload.deleted %}<span class="badge badge-muted">Deleted</span>{% elif workload.passed %}<span class="badge badge-ok">Passed</span>{% elif workload.failed %}<span class="badge badge-bad">Failed</span>{% elif workload.finished %}<span class="badge badge-info">Finished</span>{% elif not workload.approved %}<span class="badge badge-warn">Awaiting approval</span>{% else %}<span class="badge badge-info"><i class="fa-solid fa-circle-notch fa-spin"></i> Running</span>{% endif %}</div>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="workload-container">
|
||||
|
||||
<div id="config" style="display: block; overflow-x: auto;">
|
||||
<table class="test-config left-align wrappable" style="table-layout: auto; width: 100%;">
|
||||
<div id="config" class="card">
|
||||
<header class="card-head"><h2 class="card-title">Configuration</h2></header>
|
||||
<table class="test-config left-align wrappable">
|
||||
|
||||
<tr><td class="td-label">Author</td><td>{{workload.author|capfirst}}</td></tr>
|
||||
<tr><td class="td-label">Creation</td><td class="timestamp">{{workload.creation|date:'U'}}</td></tr>
|
||||
@@ -244,52 +247,53 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="actions" class="ml-3">
|
||||
<div id="actions" class="card">
|
||||
<header class="card-head"><h2 class="card-title">Actions</h2></header>
|
||||
|
||||
<!-- Dev vs Base [Git Diff Link] -->
|
||||
<h4><a href="{{workload|gitDiffLink}}">{{workload|git_diff_text}}</a></h4>
|
||||
<a class="diff-link" href="{{workload|gitDiffLink}}"><i class="fa-solid fa-code-compare fa-fw"></i> {{workload|git_diff_text}}</a>
|
||||
|
||||
<div class="anchor-container">
|
||||
|
||||
<!-- Approve Button: For Admins, or Cross-approvers -->
|
||||
{% if not workload.approved and profile.approver and profile.user.username != workload.author %}
|
||||
<a class="anchorbutton btn-blue" href="/{{type|lower}}/{{workload.id}}/APPROVE">Approve</a>
|
||||
<a class="anchorbutton btn-blue" href="/{{type|lower}}/{{workload.id}}/APPROVE"><i class="fa-solid fa-check fa-fw"></i> Approve</a>
|
||||
{% elif not workload.approved and request.user.is_superuser %}
|
||||
<a class="anchorbutton btn-blue" href="/{{type|lower}}/{{workload.id}}/APPROVE">Approve</a>
|
||||
<a class="anchorbutton btn-blue" href="/{{type|lower}}/{{workload.id}}/APPROVE"><i class="fa-solid fa-check fa-fw"></i> Approve</a>
|
||||
{% else %}
|
||||
<a class="anchorbutton btn-disabled">Approve</a>
|
||||
<span class="anchorbutton btn-disabled" aria-disabled="true"><i class="fa-solid fa-check fa-fw"></i> Approve</span>
|
||||
{% endif %}
|
||||
|
||||
<!-- Restart Button: For Approvers or Workload Authors of finished workloads -->
|
||||
{% if workload.finished and not workload.passed and not workload.failed and profile.approver %}
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/RESTART">Restart</a>
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/RESTART"><i class="fa-solid fa-rotate-right fa-fw"></i> Restart</a>
|
||||
{% elif workload.finished and not workload.passed and not workload.failed and profile.user.username == workload.author %}
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/RESTART">Restart</a>
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/RESTART"><i class="fa-solid fa-rotate-right fa-fw"></i> Restart</a>
|
||||
{% elif workload.finished %}
|
||||
<a class="anchorbutton btn-disabled">Restart</a>
|
||||
<span class="anchorbutton btn-disabled" aria-disabled="true"><i class="fa-solid fa-rotate-right fa-fw"></i> Restart</span>
|
||||
{% endif %}
|
||||
|
||||
<!-- Stop Button: For Approvers or Workload Authors of active workloads -->
|
||||
{% if not workload.finished and profile.approver %}
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/STOP">Stop</a>
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/STOP"><i class="fa-solid fa-stop fa-fw"></i> Stop</a>
|
||||
{% elif not workload.finished and profile.user.username == workload.author %}
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/STOP">Stop</a>
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/STOP"><i class="fa-solid fa-stop fa-fw"></i> Stop</a>
|
||||
{% elif not workload.finished %}
|
||||
<a class="anchorbutton btn-disabled">Stop</a>
|
||||
<span class="anchorbutton btn-disabled" aria-disabled="true"><i class="fa-solid fa-stop fa-fw"></i> Stop</span>
|
||||
{% endif %}
|
||||
|
||||
<!-- Delete/Restore Button: For Approvers or Workload Authors -->
|
||||
{% if profile.approver or profile.user.username == workload.author %}
|
||||
{% if workload.deleted %}
|
||||
<a class="anchorbutton btn-preset" href="/{{type|lower}}/{{workload.id}}/RESTORE">Restore</a>
|
||||
<a class="anchorbutton btn-preset" href="/{{type|lower}}/{{workload.id}}/RESTORE"><i class="fa-solid fa-rotate-left fa-fw"></i> Restore</a>
|
||||
{% else %}
|
||||
<a class="anchorbutton btn-red" href="/{{type|lower}}/{{workload.id}}/DELETE">Delete</a>
|
||||
<a class="anchorbutton btn-red" href="/{{type|lower}}/{{workload.id}}/DELETE"><i class="fa-solid fa-trash-can fa-fw"></i> Delete</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if workload.deleted %}
|
||||
<a class="anchorbutton btn-disabled">Restore</a>
|
||||
<span class="anchorbutton btn-disabled" aria-disabled="true"><i class="fa-solid fa-rotate-left fa-fw"></i> Restore</span>
|
||||
{% else %}
|
||||
<a class="anchorbutton btn-disabled">Delete</a>
|
||||
<span class="anchorbutton btn-disabled" aria-disabled="true"><i class="fa-solid fa-trash-can fa-fw"></i> Delete</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -297,21 +301,21 @@
|
||||
<!-- Copy Button: Copy the current results statblock -->
|
||||
{% if type == "TEST" or type == "DATAGEN" %}
|
||||
<div class="anchor-container">
|
||||
<a class="mt-1 anchorbutton btn-blue" onclick="copy_text('long-statblock', true)">Copy Stat Block</a>
|
||||
<button type="button" class="mt-1 anchorbutton btn-start" onclick="copy_text('long-statblock', true)"><i class="fa-regular fa-copy fa-fw"></i> Copy Stat Block</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Copy Button (DC): Copy the current results statblock -->
|
||||
{% if type == "TEST" or type == "DATAGEN" %}
|
||||
<div class="anchor-container">
|
||||
<a class="mt-1 anchorbutton btn-blue" onclick="copy_text('long-statblock', true, true)">Copy Stat Block (DC Block)</a>
|
||||
<button type="button" class="mt-1 anchorbutton btn-start" onclick="copy_text('long-statblock', true, true)"><i class="fa-regular fa-copy fa-fw"></i> Copy Stat Block (DC Block)</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- PGN Download Button -->
|
||||
{% if workload.upload_pgns != "FALSE" %}
|
||||
<div class="anchor-container">
|
||||
<a class="mt-1 anchorbutton btn-blue" href="/api/pgns/{{workload.id}}/">Download PGN Archive</a>
|
||||
<a class="mt-1 anchorbutton btn-start" href="/api/pgns/{{workload.id}}/"><i class="fa-solid fa-download fa-fw"></i> Download PGN Archive</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -319,7 +323,7 @@
|
||||
{% if type == "TUNE" %}
|
||||
<div class="anchor-container">
|
||||
<pre id="spsa-input" style="display: none">{{workload|spsa_original_input}}</pre>
|
||||
<a class="mt-1 anchorbutton btn-blue" onclick="copy_text('spsa-input', false)">Copy SPSA Inputs</a>
|
||||
<button type="button" class="mt-1 anchorbutton btn-start" onclick="copy_text('spsa-input', false)"><i class="fa-regular fa-copy fa-fw"></i> Copy SPSA Inputs</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -327,7 +331,7 @@
|
||||
{% if type == "TUNE" %}
|
||||
<div class="anchor-container">
|
||||
<pre id="spsa-output" style="display: none">{{workload|spsa_optimal_values}}</pre>
|
||||
<a class="mt-1 anchorbutton btn-blue" onclick="copy_text('spsa-output', false)">Copy SPSA Outputs</a>
|
||||
<button type="button" class="mt-1 anchorbutton btn-start" onclick="copy_text('spsa-output', false)"><i class="fa-regular fa-copy fa-fw"></i> Copy SPSA Outputs</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -340,8 +344,8 @@
|
||||
<pre class="long-statblock" id="long-statblock">{{workload|longStatBlock|linebreaksbr}}</pre>
|
||||
{% endif %}
|
||||
|
||||
<!-- Forum to modify the Priority, Throughput, or (Tests only) Workload Size -->
|
||||
<form method="POST" action="/{{type|lower}}/{{workload.id}}/MODIFY">
|
||||
<h3 class="section-label">Adjust</h3>
|
||||
<form class="modify-form" method="POST" action="/{{type|lower}}/{{workload.id}}/MODIFY">
|
||||
{% csrf_token %}
|
||||
<div class="form">
|
||||
<div class="col-full">
|
||||
@@ -401,7 +405,8 @@
|
||||
|
||||
<!-- SPSA Paramater Summary, for Tunes -->
|
||||
{% if type == "TUNE" %}
|
||||
<div id="parameters" class="w-100 mt-3" style="float:left;">
|
||||
<div id="parameters" class="card">
|
||||
<header class="card-head"><h2 class="card-title">SPSA Parameters</h2></header>
|
||||
<table class="stripes wrappable">
|
||||
|
||||
<tr class="table-header">
|
||||
@@ -425,18 +430,19 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div id="results" class="w-100 mt-3" style="float:left;">
|
||||
<div id="results" class="card">
|
||||
<header class="card-head"><h2 class="card-title">Results by Machine</h2></header>
|
||||
<table class="stripes wrappable">
|
||||
<tr class="table-header">
|
||||
<th>#</th>
|
||||
<th>User</th>
|
||||
<th>Updated</th>
|
||||
<th style="width: 45px">Games</th>
|
||||
<th style="width: 45px">Won</th>
|
||||
<th style="width: 45px">Lost</th>
|
||||
<th style="width: 45px">Drawn</th>
|
||||
<th style="width: 45px">Time</th>
|
||||
<th style="width: 45px">Crash</th>
|
||||
<th class="numeric">Games</th>
|
||||
<th class="numeric">Won</th>
|
||||
<th class="numeric">Lost</th>
|
||||
<th class="numeric">Drawn</th>
|
||||
<th class="numeric">Time</th>
|
||||
<th class="numeric">Crash</th>
|
||||
</tr>
|
||||
|
||||
{% for result in results %}
|
||||
|
||||
Reference in new issue
Block a user