tracman-server/views/admin.html

89 lines
2.3 KiB
HTML
Raw Permalink Normal View History

2016-06-30 14:40:21 -06:00
{% extends 'templates/base.html' %}
2016-07-01 19:14:36 -06:00
{% block title %}{{super()}} | Admin{% endblock %}
2016-06-30 14:40:21 -06:00
2017-08-22 17:32:25 -06:00
{% block head %}
2017-06-30 14:38:30 -06:00
{{super()}}
2017-08-22 17:32:25 -06:00
<link href="/static/css/.table.min.css" rel="stylesheet">
2016-06-30 14:40:21 -06:00
{% endblock %}
{% block main %}
2017-05-08 14:53:48 -06:00
<section class='container'>
2016-06-30 14:40:21 -06:00
2017-05-08 14:53:48 -06:00
<div id='users'>
<h1 class='left'>Users</h1>
<div id='stat' class='right'>
2017-05-08 14:59:43 -06:00
<p><b>Total</b>: {{total}}</p>
2016-06-30 14:40:21 -06:00
</div>
2017-05-08 14:53:48 -06:00
<table id='users-table'>
<thead><tr>
<th>Name</th>
<th>Slug</th>
<th>Joined</th>
<th>Last login</th>
<th>Moved</th>
<th>Social</th>
<th>Edit</th>
</tr></thead>
<tbody>
{% for usr in users %}
<tr>
<td>{{usr.name}}</td>
<td><a href="/map/{{usr.slug}}">/{{usr.slug}}</a></td>
<td id='{{usr.id}}-created'></td>
<td id='{{usr.id}}-logged'></td>
<td id='{{usr.id}}-moved'></td>
<td id='{{usr.id}}-accounts'>
{% if usr.auth.google %}<a href="https://plus.google.com/{{usr.auth.google}}/">G</a>{% endif %}
{% if usr.auth.facebook %}<a href="https://facebook.com/{{usr.auth.facebook}}/">F</a>{% endif %}
{% if usr.auth.twitter %}<a href="https://twitter.com/{{usr.auth.twitter}}/">T</a>{% endif %}
</td>
<td id='{{usr.id}}-edit'>
2017-08-20 14:35:08 -06:00
<a class='btn' href="/admin/delete/{{usr.id}}">DELETE</a>
2017-05-08 14:53:48 -06:00
</td>
</tr>
{% endfor %}
</tbody>
</table>
2016-06-30 14:40:21 -06:00
</div>
2017-05-08 14:53:48 -06:00
2016-06-30 14:40:21 -06:00
</section>
2017-05-08 14:53:48 -06:00
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js" integrity="sha256-1hjUhpc44NwiNg8OwMu2QzJXhD8kcj+sJA3aCQZoUjg=" crossorigin="anonymous"></script>
2018-03-04 23:50:12 -07:00
<!-- TODO: Move this script to own file -->
<script type="application/javascript">
2016-06-30 14:40:21 -06:00
/* DATE/TIME FORMATS */ {
// Users
{% for usr in users %}
{% if usr.created %}
$('#{{usr.id}}-created').text(
moment("{{usr.created}}", "ddd MMM DD YYYY HH:mm:ss [GMT]ZZ").format('l')
);
{% endif %}
{% if usr.lastLogin %}
$('#{{usr.id}}-logged').text(
moment("{{usr.lastLogin}}", "ddd MMM DD YYYY HH:mm:ss [GMT]ZZ").fromNow()
);
{% endif %}
{% if usr.last.time %}
$('#{{usr.id}}-moved').text(
moment("{{usr.last.time}}", "ddd MMM DD YYYY HH:mm:ss [GMT]ZZ").fromNow()
);
{% else %}
$('#{{usr.id}}-moved').text("never");
{% endif %}
{% endfor %}
}
</script>
{% endblock %}