#237 translate the related type

This commit is contained in:
Oskar Hahn 2012-06-30 11:06:32 +02:00
parent e8e664b92e
commit b9f783e9f1
2 changed files with 10 additions and 1 deletions

View File

@ -50,6 +50,15 @@ class Item(MPTTModel, SlideMixin):
def get_releated_type(self): def get_releated_type(self):
return self.get_releated_slide().prefix return self.get_releated_slide().prefix
def print_releated_type(self):
"""
Print the type of the releated item.
For use in Template
??Why does {% trans item.print_releated_type|capfirst %} not work??
"""
return _(self.get_releated_type().capitalize())
def get_title(self): def get_title(self):
if self.releated_sid is None: if self.releated_sid is None:
return self.title return self.title

View File

@ -20,7 +20,7 @@
{% endif %} {% endif %}
<a href="{{ item.get_absolute_url }}">{{ item }}</a> <a href="{{ item.get_absolute_url }}">{{ item }}</a>
{% if item.releated_sid %} {% if item.releated_sid %}
({{ item.get_releated_type }}) ({{ item.print_releated_type }})
{% endif %} {% endif %}
</td> </td>
{% if perms.agenda.can_manage_agenda %} {% if perms.agenda.can_manage_agenda %}