{% extends "frontend/base.html" %}
{% load i18n %}
{% load static %}
{% load partials %}
{% block html_title %}
    {% block page_title %}
        {% block title %}
            {% blocktranslate with instance_name=instance.name organization_name=request.organization.name %}Update {{ instance_name }} in {{ organization_name }}{% endblocktranslate %}
        {% endblock %}
    {% endblock page_title %}
{% endblock html_title %}
{% block page_title_extra %}
    <a href="{{ instance.urls.base }}" class="btn btn-secondary me-1 mb-1">{% translate "Back" %}</a>
{% endblock page_title_extra %}
{% partialdef service-form %}
{% if form %}
    <div class="card">
        <div class="card-header d-flex align-items-center"></div>
        <div class="card-body">
            {% if form_error %}
                <div class="alert alert-danger">
                    {% translate "Oops! Something went wrong with the service form generation. Please try again later." %}
                </div>
            {% else %}
                {% include "includes/tabbed_fieldset_form.html" with form=form %}
            {% endif %}
        </div>
    </div>
{% endif %}
{% endpartialdef %}
{% block content %}
    <section class="section">
        <div class="card">
            {% if not form %}
                <div class="alert alert-warning" role="alert">
                    {% translate "Cannot update this service instance because its details could not be retrieved from the underlying system. It might have been deleted externally." %}
                </div>
            {% else %}
                <div id="service-form">{% partial service-form %}</div>
            {% endif %}
        </div>
    </section>
{% endblock content %}
