diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/base.twig | 2 | ||||
-rw-r--r-- | views/error.twig | 8 | ||||
-rw-r--r-- | views/login.twig | 17 | ||||
-rw-r--r-- | views/village.twig | 16 |
4 files changed, 38 insertions, 5 deletions
diff --git a/views/base.twig b/views/base.twig index 0063e31..15ddafd 100644 --- a/views/base.twig +++ b/views/base.twig @@ -5,7 +5,9 @@ <header> <nav> <a href="/villages">Overview</a> + <a href="/logout">Logout</a> </nav> + <span>Logged in as {{ session.user.username }}</span> </header> <main> diff --git a/views/error.twig b/views/error.twig new file mode 100644 index 0000000..f9d70cd --- /dev/null +++ b/views/error.twig @@ -0,0 +1,8 @@ +{% extends 'root.twig' %} + +{% block body %} +<div class="wrap"> + {{ message }} + <a href="javascript:history.back()">Back</a> +</div> +{% endblock %} diff --git a/views/login.twig b/views/login.twig new file mode 100644 index 0000000..095f53e --- /dev/null +++ b/views/login.twig @@ -0,0 +1,17 @@ +{% extends 'root.twig' %} + +{% block body %} +<div class="wrap"> + <form action="/login" method="post"> + <label> + E-Mail: + <input type="email" name="email"> + </label> + <label> + Password: + <input type="password" name="password"> + </label> + <button>Login</button> + </form> +</div> +{% endblock %} diff --git a/views/village.twig b/views/village.twig index d2b8a4e..97d65f7 100644 --- a/views/village.twig +++ b/views/village.twig @@ -84,7 +84,8 @@ </tr> </thead> <tbody> - {% for event in events['UpgradeBuilding'] %} + {% for typeEvents in events['UpgradeBuilding'] %} + {% for event in typeEvents %} <tr> <td>{{ event.type }}</td> <td class="timer"> @@ -97,6 +98,7 @@ </td> </tr> {% endfor %} + {% endfor %} </tbody> </table> {% endif %} @@ -190,21 +192,21 @@ <tr class="village__buildings__row"> <td>{{ building.type | default(type) }}</td> <td>{{ building.level | default(0) }}</td> - <td>{{ building.getBuildTime() | buildTime }}</td> + <td>{{ building.getBuildTimeForLevel(building.getEffectiveLevel() + 1) | buildTime }}</td> <td class="resources"> <span> <i class="icon icon-wood"></i> - {{ building.getResourceRequirements()['wood'] }} + {{ building.getResourceRequirementsForLevel(building.getEffectiveLevel() + 1)['wood'] }} </span> <span> <i class="icon icon-clay"></i> - {{ building.getResourceRequirements()['clay'] }} + {{ building.getResourceRequirementsForLevel(building.getEffectiveLevel() + 1)['clay'] }} </span> <span> <i class="icon icon-iron"></i> - {{ building.getResourceRequirements()['iron'] }} + {{ building.getResourceRequirementsForLevel(building.getEffectiveLevel() + 1)['iron'] }} </span> </td> <td> @@ -235,6 +237,7 @@ <tr> <td>{{ unit.type }}</td> <td>{{ unit.amount }}</td> + {% if not unit.isTraveling %} <td> {{ unit.getBuildTime(1) | buildTime }} </td> @@ -265,6 +268,9 @@ <input type="submit" value="Train" {{ village.canTrain(village, unit, 1) ? '' : 'disabled' }}> </form> </td> + {% else %} + <td>~traveling~</td> + {% endif %} </tr> {% endfor %} </tbody> |