#175 #176 buttons downlaod json

This commit is contained in:
Cayo Puigdefabregas 2024-03-11 12:12:40 +01:00
parent 76b6e1c837
commit 5f454f139c
2 changed files with 24 additions and 27 deletions

View File

@ -11,6 +11,7 @@
</div> </div>
<div class="col text-end"> <div class="col text-end">
{% if object.get_status == 'Issued' %} {% if object.get_status == 'Issued' %}
<a class="btn btn-green-admin me-2" href="{% url 'idhub:admin_credential_json' object.id %}">{% trans 'Download as JSON' %}</a>
<a class="btn btn-yellow" class="btn btn-orange" data-bs-toggle="modal" data-bs-target="#confirm-revoke" href="javascript:void()">{% trans 'Revoke' %}</a> <a class="btn btn-yellow" class="btn btn-orange" data-bs-toggle="modal" data-bs-target="#confirm-revoke" href="javascript:void()">{% trans 'Revoke' %}</a>
{% endif %} {% endif %}
{% if object.get_status == 'Enabled' %} {% if object.get_status == 'Enabled' %}
@ -48,13 +49,6 @@
{{ object.get_status}} {{ object.get_status}}
</div> </div>
</div> </div>
{% if object.issued_on %}
<div class="row mt-3">
<div class="col text-center">
<a class="btn btn-green-admin" href="{% url 'idhub:admin_credential_json' object.id %}">{% trans 'Download in JSON format' %}</a>
</div>
</div>
{% endif %}
</div> </div>
</div> </div>
<!-- Modal Revoke --> <!-- Modal Revoke -->

View File

@ -2,10 +2,29 @@
{% load i18n %} {% load i18n %}
{% block content %} {% block content %}
<h3> <div class="row">
<i class="{{ icon }}"></i> <div class="col">
{{ subtitle }} <h3>
</h3> <i class="{{ icon }}"></i>
{{ subtitle }}
</h3>
</div>
<div class="col text-end">
{% if object.get_status == 'Issued' %}
<div class="col">
{% if object.eidas1_did and admin_validated %}
<a class="btn btn-green-user me-2" href="{% url 'idhub:user_credential_pdf' object.id %}">{% trans 'Download as PDF' %}</a>
{% endif %}
<a class="btn btn-green-user" href="{% url 'idhub:user_credential_json' object.id %}">{% trans 'Download as JSON' %}</a>
</div>
{% endif %}
{% if object.get_status == 'Enabled' %}
<div class="col">
<a class="btn btn-green-user" href="{% url 'idhub:user_credentials_request' %}">{% trans 'Request credential' %}</a>
</div>
{% endif %}
</div>
</div>
<div class="row"> <div class="row">
<div class="col-3"> <div class="col-3">
</div> </div>
@ -38,21 +57,5 @@
</div> </div>
</div> </div>
</div> </div>
{% if object.get_status == 'Issued' %}
<div class="row mt-3">
{% if object.eidas1_did and admin_validated %}
<div class="col text-center">
<a class="btn btn-green-user" href="{% url 'idhub:user_credential_pdf' object.id %}">{% trans 'Sign credential in PDF format' %}</a>
</div>
{% endif %}
<div class="col text-center">
<a class="btn btn-green-user" href="{% url 'idhub:user_credential_json' object.id %}">{% trans 'Download credential in JSON format' %}</a>
</div>
{% endif %}
{% if object.get_status == 'Enabled' %}
<div class="col text-center">
<a class="btn btn-green-user" href="{% url 'idhub:user_credentials_request' %}">{% trans 'Request credential' %}</a>
</div>
{% endif %}
</div> </div>
{% endblock %} {% endblock %}