Browse Source

Remplace trnoname par de meilleurs affichages

docker_basic_support
detraz 7 years ago
parent
commit
c15c01448a
  1. 5
      machines/models.py
  2. 2
      machines/templates/machines/aff_machines.html

5
machines/models.py

@ -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"""

2
machines/templates/machines/aff_machines.html

@ -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>

Loading…
Cancel
Save