{% extends "horizon/common/_modal.html" %}
{% load i18n %}

{% block modal-header %}{% trans "User Credentials" %}{% endblock %}

{% block modal-body %}
<div class="row-fluid view-credentials">
<form>
  {% if openrc_creds %}
  <div class="left">
  <fieldset>
    <div class="form-group">
      <label class="control-label">{% trans "User Name" %}</label>
      <input type="text" class="form-control" readonly value="{{ openrc_creds.user }}">
    </div>
    <div class="form-group">
      <label class="control-label">{% trans "Project Name" %}</label>
      <input type="text" class="form-control" readonly value="{{ openrc_creds.tenant_name }}">
    </div>
    <div class="form-group">
      <label class="control-label">{% trans "Project ID" %}</label>
      <input type="text" class="form-control" readonly value="{{ openrc_creds.tenant_id }}">
    </div>
    <div class="form-group">
      <label class="control-label">{% trans "Authentication URL" %}</label>
      <input type="text" class="form-control" readonly value="{{ openrc_creds.auth_url }}">
    </div>
  </fieldset>
  </div>
  {% endif %}
  {% if ec2_creds %}
  <div class="right">
  <fieldset>
    <div class="form-group">
      <label class="control-label">{% trans "EC2 URL" %}</label><input type="text" class="form-control" readonly value="{{ ec2_creds.ec2_endpoint }}">
    </div>
    <div class="form-group">
      <label class="control-label">{% trans "S3 URL" %}</label><input type="text" class="form-control" readonly value="{{ ec2_creds.s3_endpoint }}">
    </div>
    {% if ec2_creds.ec2_access_key %}
    <div class="form-group">
      <label class="control-label">{% trans "EC2 Access Key" %}</label>
      <input type="text" class="form-control" readonly value="{{ ec2_creds.ec2_access_key }}">
    </div>
    {%  endif %}
    {% if ec2_creds.ec2_secret_key %}
    <div class="form-group">
      <label class="control-label">{% trans "EC2 Secret Key" %}</label>
      <div>
        <input type="password" class="form-control" readonly value="{{ ec2_creds.ec2_secret_key }}">
      </div>
    </div>
    {% endif %}
  </fieldset>
  </div>
  {% endif %}
</form>
</div>
{% endblock %}

{% block modal-footer %}
  <a href="{% url 'horizon:project:access_and_security:index' %}" class="btn btn-default secondary cancel close">{% trans "Close" %}</a>
{% endblock %}
