# -*- coding: utf-8 -*-
+import datetime
from django.http import QueryDict
from mezzanine.pages.models import Page
from mezzanine.blog.models import BlogPost
return ActivityStatus.objects.filter(display=True)
@register.filter
-def get_team_persons(status, team):
+def get_team_persons(team, status):
persons = []
- for activity in status.activities.filter(teams__in=[team]):
+ for activity in status.activities.filter(teams__in=[team], date_to__gte=datetime.date.today()):
if not activity.person in persons:
persons.append(activity.person)
return persons
template_name='magazine/article/article_detail.html'
context_object_name = 'article'
- def get_object(self, **kwargs):
+ def get_object(self):
articles = self.model.objects.published(for_user=self.request.user).select_related()
- return get_object_or_404(articles, slug=kwargs['slug'])
+ return get_object_or_404(articles, slug=self.kwargs['slug'])
def get_context_data(self, **kwargs):
context = super(ArticleDetailView, self).get_context_data(**kwargs)
patterns='*.js;*.css;*.jpg;*.jpeg;*.gif;*.png;*.svg;*.ttf;*.eot;*.woff;*.woff2'
# Staging
-pip install xlrd
+# pip install xlrd
# pip install -U https://forge.ircam.fr/p/django-eve/source/download/dev/
# pip install https://forge.ircam.fr/p/django-prestashop/source/download/master/ --src /srv/lib
# pip install -U https://github.com/stephenmcd/grappelli-safe/archive/dynamic_stacked.zip
<div class="container">
{% activity_statuses as statuses %}
{% for status in statuses %}
- {{ status.name }} :
- {% for person in status|get_team_persons:page.teampage.team %}
- {{ person.title }}{% if not forloop.last %}, {% endif %}
- {% endfor %}
- <br/>
+ {% with page.teampage.team|get_team_persons:status as persons %}
+ {% if persons %}
+ {{ status.name }} :
+ {% for person in persons %}
+ <a href="{% url 'organization-network-person-detail' person.slug %}">{{ person.title }}</a>{% if not forloop.last %}, {% endif %}
+ {% endfor %}
+ <br/>
+ {% endif %}
+ {% endwith %}
{% endfor %}
</div>
</div>