Add display name field #331

Merged
tobru merged 18 commits from 290-display-name into main 2025-12-11 15:33:00 +00:00
5 changed files with 14 additions and 8 deletions
Showing only changes of commit dbf9756ccc - Show all commits

View file

@ -123,7 +123,7 @@ class ServiceInstanceFilterForm(forms.Form):
class ServiceInstanceDeleteForm(forms.ModelForm): class ServiceInstanceDeleteForm(forms.ModelForm):
name = forms.CharField( name = forms.CharField(
label=_("Instance Name"), label=_("Resource Name"),
max_length=63, max_length=63,
widget=forms.TextInput(attrs={"class": "form-control"}), widget=forms.TextInput(attrs={"class": "form-control"}),
) )
@ -132,7 +132,7 @@ class ServiceInstanceDeleteForm(forms.ModelForm):
kwargs["initial"] = {"name": ""} kwargs["initial"] = {"name": ""}
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.fields["name"].help_text = _( self.fields["name"].help_text = _(
"To confirm deletion, please type the instance name: <strong>{instance_name}</strong>" "To confirm deletion, please type the resource name: <strong>{instance_name}</strong>"
).format(instance_name=self.instance.name) ).format(instance_name=self.instance.name)
def clean_name(self): def clean_name(self):
@ -140,7 +140,7 @@ class ServiceInstanceDeleteForm(forms.ModelForm):
if entered_name != self.instance.name: if entered_name != self.instance.name:
raise forms.ValidationError( raise forms.ValidationError(
_( _(
"The entered name does not match the instance name. Deletion not confirmed." "The entered name does not match the resource name. Deletion not confirmed."
) )
) )
return entered_name return entered_name

View file

@ -96,7 +96,7 @@
<tr> <tr>
<td> <td>
<a href="{{ instance.urls.base }}" <a href="{{ instance.urls.base }}"
class="fw-semibold text-decoration-none">{{ instance.name }}</a> class="fw-semibold text-decoration-none">{{ instance.display_name }}</a>
</td> </td>
<td> <td>
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">

View file

@ -2,7 +2,7 @@
{% load i18n static pprint_filters %} {% load i18n static pprint_filters %}
{% block html_title %} {% block html_title %}
{% block page_title %} {% block page_title %}
{{ instance.name }} {{ instance.display_name }}
{% endblock page_title %} {% endblock page_title %}
{% endblock html_title %} {% endblock html_title %}
{% block page_title_extra %} {% block page_title_extra %}
@ -39,6 +39,10 @@
</div> </div>
<div class="card-body"> <div class="card-body">
<dl class="row"> <dl class="row">
<dt class="col-sm-4">{% translate "Resource Name" %}</dt>
<dd class="col-sm-8">
<code>{{ instance.name }}</code>
</dd>
<dt class="col-sm-4">{% translate "Service" %}</dt> <dt class="col-sm-4">{% translate "Service" %}</dt>
<dd class="col-sm-8"> <dd class="col-sm-8">
{{ instance.context.service_definition.service.name }} {{ instance.context.service_definition.service.name }}

View file

@ -5,7 +5,7 @@
{% block html_title %} {% block html_title %}
{% block page_title %} {% block page_title %}
{% block title %} {% block title %}
{% blocktranslate with instance_name=instance.name organization_name=request.organization.name %}Update {{ instance_name }} in {{ organization_name }}{% endblocktranslate %} {% blocktranslate with instance_name=instance.display_name organization_name=request.organization.name %}Update {{ instance_name }} in {{ organization_name }}{% endblocktranslate %}
{% endblock %} {% endblock %}
{% endblock page_title %} {% endblock page_title %}
{% endblock html_title %} {% endblock html_title %}

View file

@ -23,6 +23,7 @@
<thead> <thead>
<tr> <tr>
<th>{% translate "Name" %}</th> <th>{% translate "Name" %}</th>
<th>{% translate "Resource Name" %}</th>
<th>{% translate "Service" %}</th> <th>{% translate "Service" %}</th>
<th>{% translate "Service Provider" %}</th> <th>{% translate "Service Provider" %}</th>
<th>{% translate "Service Provider Zone" %}</th> <th>{% translate "Service Provider Zone" %}</th>
@ -33,8 +34,9 @@
{% for instance in instances %} {% for instance in instances %}
<tr> <tr>
<td> <td>
<a href="{{ instance.urls.base }}">{{ instance.name }}</a> <a href="{{ instance.urls.base }}">{{ instance.display_name }}</a>
</td> </td>
<td><code>{{ instance.name }}</code></td>
<td>{{ instance.context.service_definition.service.name }}</td> <td>{{ instance.context.service_definition.service.name }}</td>
<td>{{ instance.context.service_offering.provider.name }}</td> <td>{{ instance.context.service_offering.provider.name }}</td>
<td>{{ instance.context.control_plane.name }}</td> <td>{{ instance.context.control_plane.name }}</td>
@ -42,7 +44,7 @@
</tr> </tr>
{% empty %} {% empty %}
<tr> <tr>
<td colspan="5">{% translate "No service instances found." %}</td> <td colspan="6">{% translate "No service instances found." %}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>