summaryrefslogtreecommitdiff
path: root/views/http/village.twig
diff options
context:
space:
mode:
Diffstat (limited to 'views/http/village.twig')
-rw-r--r--views/http/village.twig88
1 files changed, 77 insertions, 11 deletions
diff --git a/views/http/village.twig b/views/http/village.twig
index c157a04..48bb16d 100644
--- a/views/http/village.twig
+++ b/views/http/village.twig
@@ -92,9 +92,11 @@
{% include 'components/timer.twig' with { 'time': event.event.time|date('c') } %}
</td>
<td>
- <a class="btn" href="/village/{{ village.x }}/{{ village.y }}/building/UpgradeBuilding/build/cancel">
- Cancel
- </a>
+ {% if event.event.villageId == village.id %}
+ <form action="/event/{{ event.event.id }}/cancel" method="post">
+ <input type="submit" value="Cancel">
+ </form>
+ {% endif %}
</td>
</tr>
{% endfor %}
@@ -121,9 +123,11 @@
{% include 'components/timer.twig' with { 'time': event.event.time|date('c') } %}
</td>
<td>
- <a class="btn" href="/village/{{ village.x }}/{{ village.y }}/unit/train/cancel">
- Cancel
- </a>
+ {% if event.event.villageId == village.id %}
+ <form action="/event/{{ event.event.id }}/cancel" method="post">
+ <input type="submit" value="Cancel">
+ </form>
+ {% endif %}
</td>
</tr>
{% endfor %}
@@ -132,7 +136,7 @@
{% endif %}
{% if events['SendUnits'] %}
- <h4>Send Resources / Units</h4>
+ <h4>Send Units</h4>
<table>
<thead>
<tr>
@@ -172,6 +176,68 @@
</tbody>
</table>
{% endif %}
+
+ {% if events['SendResources'] %}
+ <h4>Send Resources</h4>
+ <table>
+ <thead>
+ <tr>
+ <th>Source</th>
+ <th>Destination</th>
+ <th>Resources</th>
+ <th>Time</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for event in events['SendResources'] %}
+ <tr>
+ <td>{{ village.get(event.source).name }}</td>
+ <td>{{ village.get(event.destination).name }}</td>
+ <td>Resources</td>
+ <td class="timer">
+ {% include 'components/timer.twig' with { 'time': event.event.time|date('c') } %}
+ </td>
+ <td>
+ {% if event.isCanceled %}
+ Canceled
+ {% else %}
+ {% if event.event.villageId == village.id %}
+ <form action="/event/{{ event.event.id }}/cancel" method="post">
+ <input type="submit" value="Cancel">
+ </form>
+ {% endif %}
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% endif %}
+
+ {% if events['SendResourcesCarriers'] %}
+ <h4>Send Resources Carriers</h4>
+ <table>
+ <thead>
+ <tr>
+ <th>Source</th>
+ <th>Destination</th>
+ <th>Time</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for event in events['SendResourcesCarriers'] %}
+ <tr>
+ <td>{{ village.get(event.source).name }}</td>
+ <td>{{ village.get(event.destination).name }}</td>
+ <td class="timer">
+ {% include 'components/timer.twig' with { 'time': event.event.time|date('c') } %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% endif %}
</div>
<div class="village__main">
@@ -344,10 +410,10 @@
{% if village.getBuilding(village.id, 'PostOffice') %}
<h3>Send Resources</h3>
<form action="/village/{{ village.x }}/{{ village.y }}/send-resources" method="post">
- <input type="number" min="1" name="wood" placeholder="Amount Wood" required>
- <input type="number" min="1" name="clay" placeholder="Amount Clay" required>
- <input type="number" min="1" name="iron" placeholder="Amount Iron" required>
- <input type="number" min="1" name="food" placeholder="Amount Food" required>
+ <input type="number" min="0" name="wood" placeholder="Amount Wood" required>
+ <input type="number" min="0" name="clay" placeholder="Amount Clay" required>
+ <input type="number" min="0" name="iron" placeholder="Amount Iron" required>
+ <input type="number" min="0" name="food" placeholder="Amount Food" required>
<select name="village">
{% for v in villages %}
<option value="{{ v.id }}">{{ v.name }}</option>