{% extends "base.html" %}
{% comment %}
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
{% endcomment %}

{% load bootstrap %}
{% load i18n %}

{% block content %}

  <h2>{% trans "Monkeysphere" %}</h2>

  <table class="table table-bordered table-condensed table-striped">
    <tbody>
      <tr>
        <td>{% trans "OpenPGP Fingerprint" %}</td>
        <td>{{ key.openpgp_fingerprint }}</td>
      </tr>
      <tr>
        <td>{% trans "OpenPGP User IDs" %}</td>
        <td>{{ key.uids|join:', ' }}</td>
      </tr>
      <tr>
        <td>{% trans "Key Import Date" %}</td>
        <td>{{ key.date }}</td>
      </tr>
      <tr>
        <td>{% trans "SSH Key Type" %}</td>
        <td>{{ key.ssh_key_type }}</td>
      </tr>
      <tr>
        <td>{% trans "SSH Key Size" %}</td>
        <td>{{ key.ssh_key_size }}</td>
      </tr>
      <tr>
        <td>{% trans "SSH Fingerprint" %}</td>
        <td>{{ key.ssh_fingerprint }}</td>
      </tr>
      <tr>
        <td>{% trans "Service" %}</td>
        <td>
          {% if key.service == 'ssh' %}
            {% trans "Secure Shell" %}
          {% elif key.service == 'https' %}
            {% trans "Web Server" %}
          {% else %}
            {% trans "Other" %}
          {% endif %}
        </td>
      </tr>
      <tr>
        <td>{% trans "Key File" %}</td>
        <td>{{ key.key_file }}</td>
      </tr>
      <tr>
        <td>{% trans "Available Domains" %}</td>
        <td>{{ key.available_domains|join:', ' }}</td>
      </tr>
      <tr>
        <td>{% trans "Added Domains" %}</td>
        <td>{{ key.imported_domains|join:', ' }}</td>
      </tr>
    </tbody>
  </table>

  <p>
    {% blocktrans trimmed %}
      After this key is published to the keyservers, it can be signed using
      <a href="https://www.gnupg.org/">GnuPG</a> with the following commands:
    {% endblocktrans %}
  </p>
  <pre>
# {% trans "Download the key" %}
gpg --recv-key {{ key.openpgp_fingerprint }}

# {% trans "Sign the key" %}
gpg --sign-key {{ key.openpgp_fingerprint }}

# {% trans "Send the key back to the keyservers" %}
gpg --send-key {{ key.openpgp_fingerprint }}
</pre>

{% endblock %}
