mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 11:23:10 +00:00
Merge branch 'del_trnoname' into 'dev'
Remplace trnoname par de meilleurs affichages See merge request federez/re2o!340
This commit is contained in:
commit
abde5cb41c
2 changed files with 6 additions and 1 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue