mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Update UserKey views to use "object" context var
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
{% block title %}User Key{% endblock %}
|
||||
|
||||
{% block usercontent %}
|
||||
{% if userkey %}
|
||||
{% 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>
|
||||
@@ -12,22 +12,22 @@
|
||||
</div>
|
||||
<h4>
|
||||
Your user key is:
|
||||
{% if userkey.is_active %}
|
||||
{% if object.is_active %}
|
||||
<span class="label label-success">Active</span>
|
||||
{% else %}
|
||||
<span class="label label-danger">Inactive</span>
|
||||
{% endif %}
|
||||
</h4>
|
||||
{% include 'inc/created_updated.html' with obj=userkey %}
|
||||
{% if not userkey.is_active %}
|
||||
{% include 'inc/created_updated.html' %}
|
||||
{% 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>{{ userkey.public_key }}</pre>
|
||||
<pre>{{ object.public_key }}</pre>
|
||||
<hr />
|
||||
{% if userkey.session_key %}
|
||||
{% 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>
|
||||
@@ -35,7 +35,7 @@
|
||||
</a>
|
||||
</div>
|
||||
<h4>Session key: <span class="label label-success">Active</span></h4>
|
||||
<small class="text-muted">Created {{ userkey.session_key.created }}</small>
|
||||
<small class="text-muted">Created {{ object.session_key.created }}</small>
|
||||
{% else %}
|
||||
<h4>No active session key</h4>
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user