2017-03-07 23:30:53 -05:00
|
|
|
{% extends 'users/_user.html' %}
|
|
|
|
{% load helpers %}
|
|
|
|
|
|
|
|
{% block title %}API Tokens{% endblock %}
|
|
|
|
|
|
|
|
{% block usercontent %}
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
{% for token in tokens %}
|
|
|
|
<div class="panel panel-{% if token.is_expired %}danger{% else %}default{% endif %}">
|
|
|
|
<div class="panel-heading">
|
2017-03-08 11:34:47 -05:00
|
|
|
<div class="pull-right">
|
2017-03-14 12:59:10 -04:00
|
|
|
<a href="{% url 'user:token_edit' pk=token.pk %}" class="btn btn-xs btn-warning">Edit</a>
|
|
|
|
<a href="{% url 'user:token_delete' pk=token.pk %}" class="btn btn-xs btn-danger">Delete</a>
|
2017-03-08 11:34:47 -05:00
|
|
|
</div>
|
|
|
|
<i class="fa fa-key"></i> {{ token.key }}
|
2017-03-07 23:30:53 -05:00
|
|
|
{% if token.is_expired %}
|
2017-03-08 11:34:47 -05:00
|
|
|
<span class="label label-danger">Expired</span>
|
2017-03-07 23:30:53 -05:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-4">
|
2017-03-08 11:34:47 -05:00
|
|
|
<span title="{{ token.created }}">{{ token.created|date }}</span><br />
|
|
|
|
<small class="text-muted">Created</small>
|
2017-03-07 23:30:53 -05:00
|
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
2017-03-08 11:34:47 -05:00
|
|
|
{% if token.expires %}
|
|
|
|
<span title="{{ token.expires }}">{{ token.expires|date }}</span><br />
|
|
|
|
{% else %}
|
|
|
|
<span>Never</span><br />
|
|
|
|
{% endif %}
|
|
|
|
<small class="text-muted">Expires</small>
|
2017-03-07 23:30:53 -05:00
|
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
|
|
|
{% if token.write_enabled %}
|
|
|
|
<span class="label label-success">Enabled</span>
|
|
|
|
{% else %}
|
|
|
|
<span class="label label-danger">Disabled</span>
|
2017-03-08 11:34:47 -05:00
|
|
|
{% endif %}<br />
|
|
|
|
<small class="text-muted">Create/edit/delete operations</small>
|
2017-03-07 23:30:53 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% if token.description %}
|
|
|
|
<br /><span>{{ token.description }}</span>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-03-08 11:34:47 -05:00
|
|
|
{% empty %}
|
|
|
|
<p>You do not have any API tokens.</p>
|
2017-03-07 23:30:53 -05:00
|
|
|
{% endfor %}
|
2017-03-14 12:59:10 -04:00
|
|
|
<a href="{% url 'user:token_add' %}" class="btn btn-primary">
|
2017-03-08 11:34:47 -05:00
|
|
|
<span class="fa fa-plus" aria-hidden="true"></span>
|
|
|
|
Add a token
|
|
|
|
</a>
|
2017-03-07 23:30:53 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|