diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-11-29 09:35:27 +0100 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-11-29 09:35:27 +0100 |
commit | 3afcaef927391db23fe23c6c8c26b8960e8dae32 (patch) | |
tree | 143b9f6df9e8c795c8c6ed901bffdc7119f40df1 /views/village.twig | |
parent | c4ce3e884a6aa527bcc138771617215cf03265a4 (diff) |
intermediate commit
Diffstat (limited to 'views/village.twig')
-rw-r--r-- | views/village.twig | 52 |
1 files changed, 39 insertions, 13 deletions
diff --git a/views/village.twig b/views/village.twig index ea6635c..b843ef4 100644 --- a/views/village.twig +++ b/views/village.twig @@ -49,7 +49,7 @@ <h3 align="center">Storage Config</h3> <form method="post" action="/village/{{ village.x }}/{{ village.y }}/storage/config"> <label> - Wood: + <i class="icon icon-wood"></i> <input type="text" name="wood" value="{{ village.getStorageConfig(village.id).wood }}"> </label> <label> @@ -86,12 +86,12 @@ <tbody> {% for event in events['UpgradeBuilding'] %} <tr> - <td>{{ event.data.building }}</td> + <td>{{ event.data.type }}</td> <td class="timer"> {% include 'components/timer.twig' with { 'time': event.event.time|date('c') } %} </td> <td> - <a class="btn" href="/village/{{ village.x }}/{{ village.y }}/building/{{ event.data.building }}/build/cancel"> + <a class="btn" href="/village/{{ village.x }}/{{ village.y }}/building/{{ event.data.type }}/build/cancel"> Cancel </a> </td> @@ -119,7 +119,7 @@ {% include 'components/timer.twig' with { 'time': event.event.time|date('c') } %} </td> <td> - <a class="btn" href="/village/{{ village.x }}/{{ village.y }}/unit/{{ event.data.type }}/train/cancel"> + <a class="btn" href="/village/{{ village.x }}/{{ village.y }}/unit/train/cancel"> Cancel </a> </td> @@ -155,9 +155,15 @@ {% include 'components/timer.twig' with { 'time': event.event.time|date('c') } %} </td> <td> - <a class="btn" href="/village/{{ village.x }}/{{ village.y }}/unit/{{ event.data.type }}/train/cancel"> - Cancel - </a> + {% if event.data.cancel %} + 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 %} @@ -180,10 +186,10 @@ </tr> </thead> <tbody> - {% for building in village.getBuildings(village.id) %} + {% for building in buildings %} <tr class="village__buildings__row"> - <td>{{ building.type }}</td> - <td>{{ building.level }}</td> + <td>{{ building.type | default(type) }}</td> + <td>{{ building.level | default(0) }}</td> <td>{{ building.getBuildTime() | buildTime }}</td> <td class="resources"> <span> @@ -225,7 +231,7 @@ </tr> </thead> <tbody> - {% for unit in village.getUnits(village.id, 1) %} + {% for unit in village.getUnits(village.id, 1, 3) %} <tr> <td>{{ unit.type }}</td> <td>{{ unit.amount }}</td> @@ -256,7 +262,7 @@ <td> <form action="/village/{{ village.x }}/{{ village.y }}/unit/{{ unit.type }}/create" method="post" class="inline"> <input type="number" min="0" name="amount" placeholder="Amount"> - <input type="submit" value="Train"> + <input type="submit" value="Train" {{ village.canTrain(village, unit, 1) ? '' : 'disabled' }}> </form> </td> </tr> @@ -311,15 +317,35 @@ <option>{{ unit.type }}</option> {% endfor %} </select> + <input type="number" min="1" name="amount" placeholder="Amount" required> <select name="village"> {% for v in villages %} <option value="{{ v.id }}">{{ v.name }}</option> {% endfor %} </select> - <input type="number" min="1" name="amount" placeholder="Amount" required> + <select name="type"> + <option>Borrow</option> + <option>Gift</option> + </select> <button>Send</button> </form> </div> + + {% if village.getBuilding(village.id, 'Marketplace') %} + <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> + <select name="village"> + {% for v in villages %} + <option value="{{ v.id }}">{{ v.name }}</option> + {% endfor %} + </select> + <button>Send</button> + </form> + {% endif %} </div> </div> {% endblock %} |