Amélioration de la navigation entre événement et import
This commit is contained in:
parent
4b97f8c222
commit
47b91b20fd
@ -511,6 +511,19 @@ class Event(models.Model):
|
||||
},
|
||||
)
|
||||
|
||||
def get_import_sources(self):
|
||||
if self.import_sources:
|
||||
result = []
|
||||
for s in self.import_sources:
|
||||
o_s = RecurrentImport.objects.get(source=s)
|
||||
if o_s:
|
||||
result.append((o_s.get_absolute_url(), o_s.name))
|
||||
else:
|
||||
result.append((o_s, o_s))
|
||||
return result
|
||||
else:
|
||||
return []
|
||||
|
||||
def __str__(self):
|
||||
return _date(self.start_day) + ": " + self.title
|
||||
|
||||
|
@ -19,8 +19,8 @@
|
||||
{% if object.import_sources|length > 0 %}
|
||||
<li>Sources d'import :
|
||||
<ul>
|
||||
{% for u in object.import_sources %}
|
||||
<li><a href="{{ u }}">{{ u }}</a></li>
|
||||
{% for u, t in object.get_import_sources %}
|
||||
<li><a href="{{ u }}">{{ t }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
|
Loading…
Reference in New Issue
Block a user