Commit c15c0144 authored by detraz's avatar detraz

Remplace trnoname par de meilleurs affichages

parent 3b11d351
......@@ -213,6 +213,11 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model):
interface_parent__machine=self
).values_list('name', flat=True).distinct()
@cached_property
def get_name(self):
"""Return a name : user provided name or first interface name"""
return self.name or self.short_name
@cached_property
def all_complete_names(self):
"""Renvoie tous les tls complets de la machine"""
......
......@@ -52,7 +52,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td colspan="4">
{% trans "No name" as tr_no_name %}
{% trans "View the profile" as tr_view_the_profile %}
<b>{{ machine.name|default:'<i>tr_no_name</i>' }}</b> <i class="fa fa-angle-right"></i>
<b>{{ machine.get_name|default:'<i>tr_no_name</i>' }}</b> <i class="fa fa-angle-right"></i>
<a href="{% url 'users:profil' userid=machine.user.id %}" title=tr_view_the_profile>
<i class="fa fa-user"></i> {{ machine.user }}
</a>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment