Inline user info in service offering page #250

Merged
tobru merged 4 commits from 243-service-provider-improvements into main 2025-10-27 10:15:09 +00:00
3 changed files with 37 additions and 34 deletions
Showing only changes of commit bca79be02a - Show all commits

View file

@ -102,7 +102,16 @@
</div> </div>
</div> </div>
{% endif %} {% 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> </div>
{% if instance.spec and spec_fieldsets %} {% if instance.spec and spec_fieldsets %}
<div class="col-12"> <div class="col-12">

View file

@ -7,9 +7,14 @@
{{ offering }} {{ offering }}
{% endblock page_title %} {% endblock page_title %}
{% endblock html_title %} {% endblock html_title %}
{% partialdef control-plane-info %} {% partialdef control-plane-info inline=True %}
{% if selected_plane %} {% if selected_plane and selected_plane.user_info %}
{% include "includes/control_plane_user_info.html" with control_plane=selected_plane %} <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 %} {% endif %}
{% endpartialdef %} {% endpartialdef %}
{% partialdef service-form %} {% partialdef service-form %}
@ -31,7 +36,7 @@
{% block content %} {% block content %}
<section class="section"> <section class="section">
<div class="row"> <div class="row">
<div class="col-12 col-lg-8"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-header d-flex align-items-center"> <div class="card-header d-flex align-items-center">
{% if service.logo %} {% if service.logo %}
@ -64,6 +69,13 @@
{{ select_form }} {{ select_form }}
</form> </form>
{% endif %} {% 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 %} {% if service.external_links or offering.external_links %}
<div class="row mt-3"> <div class="row mt-3">
<div class="col-12"> <div class="col-12">
@ -83,13 +95,6 @@
</div> </div>
<div id="service-form">{% partial service-form %}</div> <div id="service-form">{% partial service-form %}</div>
</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> </div>
</section> </section>
{% endblock content %} {% endblock content %}

View file

@ -1,26 +1,15 @@
{% load i18n %} {% 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 %} {% if control_plane.user_info %}
<div class="card"> <div class="table-responsive">
<div class="card-header"> <table class="table mb-0 table-lg">
<h4 class="card-title">{% translate "Service Provider Zone Information" %}</h4> <tbody>
</div> {% for key, value in control_plane.user_info.items %}
<div class="card-content"> <tr>
<div class="table-responsive"> <th>{{ key }}</th>
<table class="table mb-0 table-lg"> <td>{{ value }}</td>
<tbody> </tr>
{% for key, value in control_plane.user_info.items %} {% endfor %}
<tr> </tbody>
<th>{{ key }}</th> </table>
<td>{{ value }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div> </div>
{% endif %} {% endif %}