{% extends "django_webid/provider/base.html" %}

{% load i18n %}
{% load uni_form_tags %}


{% block head_title %}{% blocktrans %}WebID Certs List{% endblocktrans %}{% endblock %}

{% block extra_head %}
{% endblock %}

{% block body %}

{% if messages %}
    <ul id="messages">
        {% for message in messages %}
        <li id="message_{{ forloop.counter }}">{{message}}</li>
        {% endfor %}
    </ul>
{% endif %}

<div class="middle_panel">
    {# FIXME move to CSS!!! #}
    {% if object.pubkey.is_active %}
    <h1 class="danger">Are you sure? Do you want to revoke this cert?</h1>
    <p class="danger">If you revoke this cert now, its public key details  will be removed from your public WebID profile, and you will not be able to use the matching cert in your browser on any site.</p>
    <form action="" method="post">
	    {% csrf_token %}
	    <input type="submit" value="Yes, I want to revoke this cert forever"/>
	    <input type="hidden" name="post" value="yes"/>
    </form>
    {% else %}
    <h1 class="error">This certificate has already been revoked.</h1>
    <p class="error">So no, you cannot revoke it again. And by the way, you also cannot use if for anything useful now.</p>
    {% endif %}
    <div class="clearfix"></div>

    <h1>{% trans "WebID Certificate Details" %}</h1>

    <p>Sha1 Fingerprint: {{ object.fingerprint_sha1 }}</p>
    <p>Valid From: {{object.valid_from}}</p>
    <p>Valid Until: {{object.expires}}</p>

    <h2>Public Key on this Certificate</h2>
    <p>Bits: {{object.pubkey.bits}}</p>
    <p>Modulus: {{object.pubkey.mod}}</p>
    <p>Exponent: {{object.pubkey.exp}}</p>
</div>

{% endblock %}

{% block extra_body %}
{% endblock %}

