{% extends '_base.html' %}
{% load form_helpers %}

{% block title %}User Key{% endblock %}

{% block content %}
<div class="row">
    <div class="col-md-8 col-md-offset-2">
        <h1>User Key</h1>
    </div>
</div>
<div class="row">
    <div class="col-md-2 col-md-offset-2">
        {% include 'users/inc/profile_nav.html' with active_tab="userkey" %}
    </div>
	<div class="col-md-6">
        {% if userkey %}
            <h4>
                Your user key is:
                {% if userkey.is_active %}
                    <span class="label label-success">Active</span>
                {% else %}
                    <span class="label label-danger">Inactive</span>
                {% endif %}
            </h4>
            <p>Your public key is below.</p>
            <pre>{{ userkey.public_key }}</pre>
            <div class="pull-right">
                <a href="{% url 'users:userkey_edit' %}" class="btn btn-warning">
                    <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
                    Edit user key
                </a>
            </div>
        {% else %}
            <p>You don't have a user key on file.</p>
            <p>
                <a href="{% url 'users:userkey_edit' %}" class="btn btn-primary">
                    <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
                    Create a User Key
                </a>
            </p>
        {% endif %}
	</div>
</div>
{% endblock %}
