summaryrefslogtreecommitdiff
path: root/views/http
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2025-03-24 13:28:57 +0100
committerDaniel Weipert <git@mail.dweipert.de>2025-03-24 13:28:57 +0100
commita21b030abd4d5cd88f914f79574e425c7908553a (patch)
treec4eca5ff8e3dd5b12c4a151045ebb0991b211a9b /views/http
parentd58f61770463aab2c71464c11f902f0074b49b62 (diff)
various changesHEADmain
Diffstat (limited to 'views/http')
-rw-r--r--views/http/map.twig12
-rw-r--r--views/http/village.twig16
2 files changed, 17 insertions, 11 deletions
diff --git a/views/http/map.twig b/views/http/map.twig
index 29f0294..a05fea2 100644
--- a/views/http/map.twig
+++ b/views/http/map.twig
@@ -3,13 +3,13 @@
{% block main %}
<div class="map">
<div class="map__up">
- <a href="/map/{{ x }}/{{ y - 1 }}">
+ <a href="/map/{{ x }}/{{ y - 1 }}/{{ range }}">
<i class="icon icon-arrow-up"></i>
</a>
</div>
<div>
<div class="map__left">
- <a href="/map/{{ x - 1 }}/{{ y }}">
+ <a href="/map/{{ x - 1 }}/{{ y }}/{{ range }}">
<i class="icon icon-arrow-left"></i>
</a>
</div>
@@ -17,7 +17,9 @@
{% for row in range(-range, range) %}
{% for column in range(-range, range) %}
{% set village = map[x + column][y + row] %}
- <div class="map__village">
+ <div class="map__village {% if row == 0 and column == 0 %}map__village--center{% endif %}">
+ <!-- TODO: add link to center on tile in top left -->
+ <a class="center-anchor" title="move to center" href="/map/{{ x + column }}/{{ y + row }}/{{ range }}">c</a>
{% if village %}
<a href="/village/{{ village.x }}/{{ village.y }}">
{{ map[x + column][y + row].name }}
@@ -28,13 +30,13 @@
{% endfor %}
</div>
<div class="map__right">
- <a href="/map/{{ x + 1 }}/{{ y }}">
+ <a href="/map/{{ x + 1 }}/{{ y }}/{{ range }}">
<i class="icon icon-arrow-right"></i>
</a>
</div>
</div>
<div class="map__down">
- <a href="/map/{{ x }}/{{ y + 1 }}">
+ <a href="/map/{{ x }}/{{ y + 1 }}/{{ range }}">
<i class="icon icon-arrow-down"></i>
</a>
</div>
diff --git a/views/http/village.twig b/views/http/village.twig
index a498ea6..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 %}