Inline user info in service offering page
All checks were successful
Tests / test (push) Successful in 27s

ref #243
This commit is contained in:
Tobias Kunze 2025-10-24 11:55:56 +02:00
parent 6c2795d4fa
commit bca79be02a
3 changed files with 37 additions and 34 deletions

View file

@ -102,7 +102,16 @@
</div>
</div>
{% endif %}
{% include "includes/control_plane_user_info.html" with control_plane=instance.context.control_plane %}
{% if control_plane.user_info %}
<div class="card">
<div class="card-header">
<h4 class="card-title">{% translate "Service Provider Zone Information" %}</h4>
</div>
<div class="card-content">
{% include "includes/control_plane_user_info.html" with control_plane=instance.context.control_plane %}
</div>
</div>
{% endif %}
</div>
{% if instance.spec and spec_fieldsets %}
<div class="col-12">

View file

@ -7,9 +7,14 @@
{{ offering }}
{% endblock page_title %}
{% endblock html_title %}
{% partialdef control-plane-info %}
{% if selected_plane %}
{% include "includes/control_plane_user_info.html" with control_plane=selected_plane %}
{% partialdef control-plane-info inline=True %}
{% if selected_plane and selected_plane.user_info %}
<div class="row mt-3">
<div class="col-12">
<h6 class="mb-3">{% translate "Service Provider Zone Information" %}</h6>
{% include "includes/control_plane_user_info.html" with control_plane=selected_plane %}
</div>
</div>
{% endif %}
{% endpartialdef %}
{% partialdef service-form %}
@ -31,7 +36,7 @@
{% block content %}
<section class="section">
<div class="row">
<div class="col-12 col-lg-8">
<div class="col-12">
<div class="card">
<div class="card-header d-flex align-items-center">
{% if service.logo %}
@ -64,6 +69,13 @@
{{ select_form }}
</form>
{% endif %}
{% if has_control_planes %}
<div id="control-plane-info"
hx-trigger="load, change from:form"
hx-get="{{ request.path }}?fragment=control-plane-info">
{% partial control-plane-info %}
</div>
{% endif %}
{% if service.external_links or offering.external_links %}
<div class="row mt-3">
<div class="col-12">
@ -83,13 +95,6 @@
</div>
<div id="service-form">{% partial service-form %}</div>
</div>
<div class="col-12 col-lg-4">
{% if has_control_planes %}
<div id="control-plane-info"
hx-trigger="load, change from:form"
hx-get="{{ request.path }}?fragment=control-plane-info">{% partial control-plane-info %}</div>
{% endif %}
</div>
</div>
</section>
{% endblock content %}

View file

@ -1,26 +1,15 @@
{% load i18n %}
{% comment %}
Reusable snippet for displaying ControlPlane user_info
Usage: {% include "includes/control_plane_user_info.html" with control_plane=control_plane_object %}
{% endcomment %}
{% if control_plane.user_info %}
<div class="card">
<div class="card-header">
<h4 class="card-title">{% translate "Service Provider Zone Information" %}</h4>
</div>
<div class="card-content">
<div class="table-responsive">
<table class="table mb-0 table-lg">
<tbody>
{% for key, value in control_plane.user_info.items %}
<tr>
<th>{{ key }}</th>
<td>{{ value }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="table-responsive">
<table class="table mb-0 table-lg">
<tbody>
{% for key, value in control_plane.user_info.items %}
<tr>
<th>{{ key }}</th>
<td>{{ value }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}