Skip to content
Permalink
Browse files

Update layout templates for Bulma

  • Loading branch information...
decke committed Aug 30, 2019
1 parent 1974fc8 commit 6caccf9e845bdccf078beb15d8f00088cea7fc2d
Showing with 141 additions and 74 deletions.
  1. +0 −1 templates/_header.html
  2. +29 −2 templates/index.html
  3. +20 −18 templates/locations.html
  4. +92 −53 templates/user/home.html
@@ -46,7 +46,6 @@
</div>
{% else %}
<div class="buttons">
<a class="button is-link" href="/login">Login</a>
<a class="button is-primary" href="/register">Register</a>
</div>
{% endif %}
@@ -14,8 +14,35 @@
</div>
{% endfor %}

<h1 class="title is-2">{{ config.get('title') }}</h1>
{% if not session.isAuthenticated() %}
<div class="column is-6 is-offset-3">
<div class="card">
<div class="card-content">
<p class="title is-2">Login</p>

<form action="/login" method="post">
<div class="field">
<label class="label">EMail</label>
<div class="control">
<input type="text" name="email" class="input" value="{{ data['email'] }}">
</div>
</div>

<div class="field">
<label class="label">Password</label>
<div class="control">
<input type="password" name="password" class="input">
</div>
</div>
<div class="control">
<button class="button is-primary">Sign in</button>
</div>
</form>

</div>
</div>
</div>
{% endif %}
</div>

{{ include('_footer.html') }}
{% include('_footer.html') %}
@@ -4,7 +4,7 @@

<h1 class="title is-2">Locations</h1>

<table class="table table-striped">
<table class="table is-striped is-bordered is-hoverable is-fullwidth">
<thead>
<tr>
<th>Name</th>
@@ -13,23 +13,25 @@ <h1 class="title is-2">Locations</h1>
<th></th>
</tr>
</thead>

{% for loc in locations %}
<tr>
<td><a href="/location/{{ loc.locationid }}/">{{ loc.name }}</a></td>
<td>
{{ loc.address }}
</td>
<td>
<img src="/images/tower-{{ loc.status }}.svg" style="height: 2em" alt="{{ loc.status }}">
</td>
<td>
<a href="/map?lat={{ loc.latitude }}&lng={{ loc.longitude }}" class="button is-link is-outlined is-small">Map</a>
<a href="/location/{{ loc.locationid }}" class="button is-primary is-small">Show</a>
</td>
</tr>
{% endfor %}

<tbody>
{% for loc in locations %}
<tr>
<td>
<a href="/location/{{ loc.locationid }}/">{{ loc.name }}</a>
</td>
<td>
{{ loc.address }}
</td>
<td>
<img src="/images/tower-{{ loc.status }}.svg" style="height: 2em" alt="{{ loc.status }}">
</td>
<td>
<a href="/map?lat={{ loc.latitude }}&lng={{ loc.longitude }}" class="button is-link is-outlined is-small">Map</a>
<a href="/location/{{ loc.locationid }}" class="button is-primary is-small">Show</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>

</div>
@@ -1,75 +1,114 @@
{% include('_header.html') %}

<div class="container">
<div class="container">
<div class="columns is-marginless">
<div class="column is-6">

<div class="row">
<div class="col-sm-6">
<div class="card">
<div class="card-header"><h5>User Details</h5></div>
<div class="card-body">
<div class="row">
<div class="col-3"><strong>E-Mail:</strong></div>
<div class="col">{{ user.email }}</div>
<div class="card">
<header class="card-header">
<p class="card-header-title">
Account Details
</p>
</header>
<div class="card-content">
<div class="content">
<div class="columns">
<div class="column">
<strong>E-Mail</strong>
</div>
<div class="row">
<div class="col-3"><strong>Name:</strong></div>
<div class="col">{{ user.firstname }} {{ user.lastname }}</div>
<div class="column">
<a href="mailto:{{ user.email }}">{{ user.email }}</a>
</div>
<div class="row">
<div class="col-3"><strong>Phone:</strong></div>
<div class="col">{{ user.phone }}</div>
</div>
<div class="columns">
<div class="column">
<strong>Name</strong>
</div>
<div class="row text-right">
<div class="col">
<a href="/user/edit" class="btn btn-primary">Edit userdata</a>
<a href="/user/changepwd" class="btn btn-primary">Change password</a>
</div>
<div class="column">
{{ user.firstname }} {{ user.lastname }}
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="card">
<div class="card-header"><h5>Locations</h5></div>
<div class="card-body">
<div class="row">
<div class="col">
<a href="/location/add" class="btn btn-primary">Add Location</a>
</div>
<div class="columns">
<div class="column">
<strong>Phone</strong>
</div>
<div class="column">
{{ user.phone }}
</div>
</div>
</div>
</div>
<footer class="card-footer">
<a href="/user/edit" class="card-footer-item">Edit userdata</a>
<a href="/user/changepwd" class="card-footer-item">Change password</a>
</footer>
</div>

<br />
</div>

<h2>Your Locations</h2>
</div>

<table class="table table-striped">
<thead><tr><th>Name</th><th style="width: 60%">Address</th><th>Status</th><th></th></tr></thead>
<tbody>
<div class="columns is-marginless">
<div class="column">

{% for loc in locations %}
<tr>
<td><a href="/location/{{ loc.locationid }}/">{{ loc.name }}</a></td>
<td>{{ loc.address }} <a href="/map?lat={{ loc.latitude }}&lng={{ loc.longitude }}" class="btn btn-outline-primary btn-sm">
<span class="icon icon-map-pin" aria-hidden="true"></span>
</a>
</td>
<td><img src="/css/images/tower-{{ loc.status }}.svg" style="height: 2em" alt="{{ loc.status }}"></td>
<td>
<a href="/location/{{ loc.locationid }}" class="btn btn-primary btn-sm">Show</a>
<a href="/location/{{ loc.locationid }}/edit" class="btn btn-primary btn-sm">
<span class="icon icon-tool" aria-hidden="true"></span>
</a>
</td>
</tr>
{% endfor %}
<div class="card">
<header class="card-header">
<p class="card-header-title">
Your Locations
</p>
</header>
<div class="card-content">

</tbody>
</table>
<table class="table is-striped is-fullwidth">
<thead>
<tr>
<th>Name</th>
<th style="width: 60%">Address</th>
<th>Status</th>
<th></th>
</tr>
</thead>
<tbody>

{% for loc in locations %}
<tr>
<td>
<a href="/location/{{ loc.locationid }}/">{{ loc.name }}</a>
</td>
<td>
{{ loc.address }}
<a href="/map?lat={{ loc.latitude }}&lng={{ loc.longitude }}" class="btn btn-outline-primary btn-sm">
<span class="icon icon-map-pin" aria-hidden="true"></span>
</a>
</td>
<td>
<img src="/css/images/tower-{{ loc.status }}.svg" style="height: 2em" alt="{{ loc.status }}">
</td>
<td>
<a href="/location/{{ loc.locationid }}" class="btn btn-primary btn-sm">Show</a>
<a href="/location/{{ loc.locationid }}/edit" class="btn btn-primary btn-sm">
<span class="icon icon-tool" aria-hidden="true"></span>
</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="4">
<i>No Locations yet</i>
</td>
</tr>
{% endfor %}

</tbody>
</table>

</div>
<footer class="card-footer">
<a href="/location/add" class="card-footer-item">Add Location</a>
</footer>
</div>
</div>
</div>
</div>

{% include('_footer.html') %}

0 comments on commit 6caccf9

Please sign in to comment.
You can’t perform that action at this time.