mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
@ -36,6 +36,24 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="birthdays">
|
||||
<div id="birthdays_title">{% trans %}Birthdays{% endtrans %}</div>
|
||||
<div id="birthdays_content">
|
||||
<ul class="birthdays_year">
|
||||
{% for d in birthdays.dates('date_of_birth', 'year', 'DESC') %}
|
||||
<li>
|
||||
{% trans age=timezone.now().year - d.year %}{{ age }} year old{% endtrans %}
|
||||
<ul>
|
||||
{% for u in birthdays.filter(date_of_birth__year=d.year) %}
|
||||
<li><a href="{{ u.get_absolute_url() }}">{{ u.get_short_name() }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -283,6 +283,10 @@ class NewsListView(CanViewMixin, ListView):
|
||||
kwargs = super(NewsListView, self).get_context_data(**kwargs)
|
||||
kwargs['NewsDate'] = NewsDate
|
||||
kwargs['timedelta'] = timedelta
|
||||
kwargs['birthdays'] = User.objects\
|
||||
.filter(date_of_birth__month=timezone.now().month, date_of_birth__day=timezone.now().day)\
|
||||
.filter(role__in=['STUDENT', 'FORMER_STUDENT'])\
|
||||
.order_by('-date_of_birth')
|
||||
return kwargs
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user