{% extends "gateway/base.html" %} {% block title %}{% if invalid %}Error: {% endif %}{% if adding %}Add provider{% else %}{{ provider.name }}{% endif %} · {% endblock %} {% block breadcrumbs %}
  • Overview
  • Providers
  • {% if adding %}Add provider{% else %}{{ provider.name }}{% endif %}
  • {% endblock %} {% block heading %}
    {% include "gateway/includes/icon.html" with name="Provider" %}

    {% if adding %}Add provider{% else %}{{ provider.name }}{% endif %}

    {% if adding %}Add its addresses and model names, then connect it to projects.{% elif used_by %}Used by {{ used_by|length }} project{{ used_by|pluralize }}{% if active_count %}, active for {{ active_count }}{% endif %}.{% else %}Not used by any project yet.{% endif %}{% if not can_edit %} View only: only admins can change providers, because a changed address would receive every project's API key.{% endif %}

    {% endblock %} {% block actions %} {% if can_edit and not adding %} {% endif %} {% endblock %} {% block content %} {% if can_edit %} {% include "gateway/includes/form_errors.html" %}
    {% csrf_token %}
    {% include "gateway/includes/section.html" with title="Details" %}
    {% include "gateway/includes/field.html" with field=form.name %} {% include "gateway/includes/slug_field.html" with slug=provider.slug %}
    {% include "gateway/includes/formset_table.html" with formset=endpoints title="Endpoints" text="One address per API style." add_label="Add an endpoint" %} {% include "gateway/includes/formset_table.html" with formset=aliases title="Aliases" text="Names your apps use, and this provider's model." add_label="Add an alias" %} {% url 'dashboard:providers' as cancel_url %} {% include "gateway/includes/save_bar.html" with cancel_url=cancel_url %}
    {% else %}
    {% include "gateway/includes/section.html" with title="Details" %}
    {% include "gateway/includes/value.html" with label="Name" value=provider.name %} {% include "gateway/includes/value.html" with label="Slug" value=provider.slug %}
    {% include "gateway/includes/section.html" with title="Endpoints" text="One address per API style." %} {% if endpoint_list %}
    {% for endpoint in endpoint_list %}{% endfor %}
    Schema Base URL Auth scheme
    {{ endpoint.get_schema_display }}{{ endpoint.base_url }}{{ endpoint.get_auth_scheme_display }}
    {% else %}

    No addresses yet.

    {% endif %}
    {% include "gateway/includes/section.html" with title="Aliases" text="Names your apps use, and this provider's model." %} {% if alias_list %}
    {% for alias in alias_list %}{% endfor %}
    Name Provider model
    {{ alias.name }}{{ alias.provider_model }}
    {% else %}

    No aliases.

    {% endif %}
    {% endif %} {% if used_by %}
    {% include "gateway/includes/section.html" with title="Used by" id="used-by-heading" %}
    {% for project in used_by %} {% endfor %}
    Project Calls go here Status
    {{ project.name }} {% if project.provider_id == provider.pk %} Active {% else %} Added, not active {% endif %} {% include "gateway/includes/project_status.html" %}
    {% endif %} {% endblock %} {% block dialogs %} {% if can_edit and not adding %} {% include "gateway/includes/confirm_dialog.html" %} {% endif %} {% endblock %}