allow cancelling of training queues
[browser-rts.git] / src / render / unit-training.ts
index a1bd4b8756bef6a275f1c07b9609229bf510ce90..9e64c9c454337b1823c4b4794bd961a8399fd200 100644 (file)
@@ -117,7 +117,7 @@ export function renderUnitTraining(city: CityWithLocation, units: Unit[], traini
     <tr>
     <th align="left">Unit Type</th>
     <th align="left">Amount Expected</th>
-    <th>Progress</th>
+    <th colspan="2">Progress</th>
     </tr>
     ${sortedTrainingQueue.map(queue => {
       if(queue.unit_type === 'empty') {
@@ -135,10 +135,9 @@ export function renderUnitTraining(city: CityWithLocation, units: Unit[], traini
         <tr>
         <td>${queue.display}</td>
         <td>${queue.amount}</td>
-        <td>
-        <span title="${Math.ceil(due.diff(created).as('minutes')).toLocaleString()} minutes remaining">
-        ${progressBar(now, duration)}<br>
-        </span>
+        <td>${progressBar(now, duration)}</td>
+        <td width="50">
+        <a href="#" hx-post="/training/${queue.id}/cancel" hx-trigger="click" class="danger-text close" title="Cancel Unit Training">&times;</a>
         </td>
         </tr>
         `;