Files
netbox/netbox/templates/users/userkey.html
Robin Schneider 0ad9b83623 Closes #5503: ISO 8601 date in UI and alternative format as tooltip
With this commit all dates in the UI are now consistently displayed.

I changed the long date format as suggested by @xkilian and confirmed by my own
research.

* DATETIME_FORMAT
 * Before July 20, 2020 4:52 p.m.
 * Now 20th July, 2020 16:52

"20th July, 2020" would be spoken as "the 20th of July, 2020" but the "the" and
"of" are never written.

The only exception is `object_list.html`. I tried it but there it does not
work so easily because the dates are passed to Jinja as SafeString.
2021-07-02 22:22:37 +02:00

57 lines
2.2 KiB
HTML

{% extends 'users/base.html' %}
{% load helpers %}
{% block title %}User Key{% endblock %}
{% block usercontent %}
{% if object %}
<div class="pull-right noprint">
<a href="{% url 'user:userkey_edit' %}" class="btn btn-warning">
<span class="mdi mdi-pencil" aria-hidden="true"></span>
Edit user key
</a>
</div>
<h4>
Your user key is:
{% if object.is_active %}
<span class="label label-success">Active</span>
{% else %}
<span class="label label-danger">Inactive</span>
{% endif %}
</h4>
<p>
<small class="text-muted">
Created {{ object.created|annotated_date }} &middot;
Updated <span title="{{ object.last_updated|date:'SHORT_DATETIME_FORMAT' }} ({{ object.last_updated|date:'DATETIME_FORMAT' }})">{{ object.last_updated|timesince }}</span> ago
</p>
{% if not object.is_active %}
<div class="alert alert-warning" role="alert">
<i class="mdi mdi-alert"></i>
Your user key is inactive. Ask an administrator to enable it for you.
</div>
{% endif %}
<pre>{{ object.public_key }}</pre>
<hr />
{% if object.session_key %}
<div class="pull-right noprint">
<a href="{% url 'user:sessionkey_delete' %}" class="btn btn-danger">
<span class="mdi mdi-trash-can-outline" aria-hidden="true"></span>
Delete session key
</a>
</div>
<h4>Session key: <span class="label label-success">Active</span></h4>
<small class="text-muted">Created {{ object.session_key.created|annotated_date }}</small>
{% else %}
<h4>No active session key</h4>
{% endif %}
{% else %}
<p>You don't have a user key on file.</p>
<p>
<a href="{% url 'user:userkey_edit' %}" class="btn btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span>
Create a User Key
</a>
</p>
{% endif %}
{% endblock %}