{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}

{% block form_id %}password_instance_form{% endblock %}

{% block form_action %}{% url "horizon:project:instances:decryptpassword" instance_id keypair_name%}{% endblock %}

{% block modal_id %}password_instance_modal{% endblock %}
{% block modal-header %}{% trans "Retrieve Instance Password" %}{% endblock %}

{% block modal-body %}

<div class="left">
    <fieldset>
        {% include "horizon/common/_form_fields.html" %}
</fieldset>
</div>
<div class="right">
    <h3>{% trans "Description" %}:</h3>
    <p>{% trans "To decrypt your password you will need the private key of your key pair for this instance. Select the private key file, or copy and paste the content of your private key file into the text area below, then click Decrypt Password."%}</p>
    <p><b>{% trans "Note: " %} </b> {% trans "The private key will be only used in your browser and will not be sent to the server" %}</p>
</div>

{% endblock %}
{% block modal-footer %}

{% for f in form %}
{% if f.id_for_label|stringformat:"s" == "id_private_key" %}
<input class="btn btn-primary pull-right" type="submit" id="decryptpassword_button" value="{% trans "Decrypt Password" %}" />
{% endif %}
{% endfor %}

<a href="{% url "horizon:project:instances:index" %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}
