Use instance name where appropriate

This commit is contained in:
Tobias Kunze 2025-12-09 09:58:42 +01:00
parent 6627916ed7
commit e102d40c09
5 changed files with 14 additions and 8 deletions

View file

@ -123,7 +123,7 @@ class ServiceInstanceFilterForm(forms.Form):
class ServiceInstanceDeleteForm(forms.ModelForm):
name = forms.CharField(
label=_("Instance Name"),
label=_("Resource Name"),
max_length=63,
widget=forms.TextInput(attrs={"class": "form-control"}),
)
@ -132,7 +132,7 @@ class ServiceInstanceDeleteForm(forms.ModelForm):
kwargs["initial"] = {"name": ""}
super().__init__(*args, **kwargs)
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)
def clean_name(self):
@ -140,7 +140,7 @@ class ServiceInstanceDeleteForm(forms.ModelForm):
if entered_name != self.instance.name:
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

View file

@ -96,7 +96,7 @@
<tr>
<td>
<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>
<div class="d-flex align-items-center">

View file

@ -2,7 +2,7 @@
{% load i18n static pprint_filters %}
{% block html_title %}
{% block page_title %}
{{ instance.name }}
{{ instance.display_name }}
{% endblock page_title %}
{% endblock html_title %}
{% block page_title_extra %}
@ -39,6 +39,10 @@
</div>
<div class="card-body">
<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>
<dd class="col-sm-8">
{{ instance.context.service_definition.service.name }}

View file

@ -5,7 +5,7 @@
{% 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 %}
{% blocktranslate with instance_name=instance.display_name organization_name=request.organization.name %}Update {{ instance_name }} in {{ organization_name }}{% endblocktranslate %}
{% endblock %}
{% endblock page_title %}
{% endblock html_title %}

View file

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