{% extends "base.html" %} {% block title %} {% if action == 'create' %} {{ _("Add New Connection") }} {% else %} {{ _("Edit Connection") }} {% endif %} {% endblock title %} {% block main %}

{% if action == 'create' %} {{ _("Add New Connection") }} {% else %} {{ _("Edit Connection") }} {% endif %}

{% if action == 'create' %} {{ _("Create a new external service connection for automated user invitations") }} {% else %} {{ _("Update the connection settings") }} {% endif %}

{{ form.hidden_tag() }}
{{ form.connection_type.label(class="block mb-2 text-sm font-medium text-gray-900 dark:text-white") }} {{ form.connection_type(class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary focus:border-primary block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary dark:focus:border-primary", onchange="this.form.submit()") }} {% if form.connection_type.errors %}
{% for error in form.connection_type.errors %}

{{ error }}

{% endfor %}
{% endif %}

{{ _("Select the type of connection to configure") }}

{{ form.name.label(class="block mb-2 text-sm font-medium " + ("text-gray-500" if form.connection_type.data == 'overseerr' else "text-gray-900 dark:text-white") ) }} {{ form.name(class="text-sm rounded-lg block w-full p-2.5 " + ("bg-gray-100 border-gray-200 text-gray-500 cursor-not-allowed dark:bg-gray-700 dark:border-gray-600 dark:text-gray-400" if form.connection_type.data == 'overseerr' else "bg-gray-50 border border-gray-300 text-gray-900 focus:ring-primary focus:border-primary dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary dark:focus:border-primary") , disabled=(form.connection_type.data == 'overseerr')) }} {% if form.name.errors %}
{% for error in form.name.errors %}

{{ error }}

{% endfor %}
{% endif %}

{{ _("A friendly name to identify this connection") }}

{{ form.media_server_id.label(class="block mb-2 text-sm font-medium " + ("text-gray-500" if form.connection_type.data == 'overseerr' else "text-gray-900 dark:text-white") ) }} {{ form.media_server_id(class="text-sm rounded-lg block w-full p-2.5 " + ("bg-gray-100 border-gray-200 text-gray-500 cursor-not-allowed dark:bg-gray-700 dark:border-gray-600 dark:text-gray-400" if form.connection_type.data == 'overseerr' else "bg-gray-50 border border-gray-300 text-gray-900 focus:ring-primary focus:border-primary dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary dark:focus:border-primary") , disabled=(form.connection_type.data == 'overseerr')) }} {% if form.media_server_id.errors %}
{% for error in form.media_server_id.errors %}

{{ error }}

{% endfor %}
{% endif %}

{{ _("Which media server should trigger invitations to this external service") }}

{% if form.connection_type.data == 'overseerr' %}

{{ _("Overseerr/Jellyseerr Information") }}

{{ _("Overseerr and Jellyseerr automatically import new users by default. No API connection is required for Wizarr integration.") }}

{{ _("To enable auto-import:") }}

  1. {{ _("Open your Overseerr/Jellyseerr admin panel") }}
  2. {{ _("Navigate to Settings → Users") }}
  3. {{ _("Enable 'Auto-approve new users'") }}
  4. {{ _("Enable 'Import Jellyfin/Plex users'") }}
{% else %}
{{ form.url.label(class="block mb-2 text-sm font-medium text-gray-900 dark:text-white") }} {{ form.url(class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary focus:border-primary block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary dark:focus:border-primary", placeholder="https://service.example.com") }} {% if form.url.errors %}
{% for error in form.url.errors %}

{{ error }}

{% endfor %}
{% endif %}

{{ _("The full URL to your external service instance") }}

{{ form.api_key.label(class="block mb-2 text-sm font-medium text-gray-900 dark:text-white") }}
{{ form.api_key(class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary focus:border-primary block w-full p-2.5 pr-10 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary dark:focus:border-primary", type="password", placeholder="Enter API key") }}
{% if form.api_key.errors %}
{% for error in form.api_key.errors %}

{{ error }}

{% endfor %}
{% endif %}

{{ _("API key from your external service settings") }}

{% endif %}
{{ _("Cancel") }}
{% endblock main %}