{% extends 'base.html' %}
{% load i18n %}
{% load bootstrap_toolkit %}
{% load django_bootstrap_breadcrumbs %}
{% load common_tags %}

{% block title %}{% trans "Request an API key" %}{% endblock %}

{% block breadcrumbs %}
    {{ block.super }}
    {% breadcrumb_safe 'Users' None %}
    {% breadcrumb request.user.userprofile.get_display_name 'user_page' request.user.username %}
    {% breadcrumb 'API Keys' 'user_page_api_keys' request.user.username %}
    {% breadcrumb 'Request an API key' None %}
{% endblock %}

{% block content %}
    {% if READONLY_MODE %}
        {% include 'readonly_mode.html' %}
    {% else %}
        <div class="well">
            {% blocktrans %}Thanks for your interest in using AstroBin's APIs! You need a <strong>key</strong> and a <strong>secret</strong> if you want to access AstroBin's data in your own app or website.{% endblocktrans %}
            {% blocktrans %}After you submit a request, you will receive a reply within 24 hours.{% endblocktrans %}
        </div>

        <div class="alert alert-warning">
            {% blocktrans %}Please make sure you have read the section about APIs in the <a href="https://welcome.astrobin.com/terms-of-service">Terms of Service</a>.{% endblocktrans %}
        </div>

        <form class="form-horizontal" action="" method="post" novalidate>{% csrf_token %}
            {{form|as_bootstrap}}
            <div class="form-actions">
                <button class="btn btn-primary {% button_loading_class %}" type="submit">
                    {% button_loading_indicator %}
                    {% trans "Submit" %}
                </button>
            </div>
        </form>
    {% endif %}
{% endblock %}
