return list[index_1:index_2]
else:
return [list[index_1]]
+
+@register.filter
+def date_year_higher_than(date, years):
+ diff = date - datetime.date.today()
+ print(diff.days)
+ return diff.days > years*365
list_display = ['person', 'get_teams', 'status', 'date_from', 'date_to']
filter_horizontal = ['organizations', 'employers', 'teams', 'projects',
'supervisors', 'phd_directors', ]
+ search_fields = ['person__title',]
+ list_filter = [ 'date_from', 'date_to',
+ 'is_permanent', 'framework', 'grade',
+ 'status', 'teams', 'projects',]
def get_teams(self, instance):
values = []
# django setup
python $manage wait-for-db
-python $manage migrate --noinput
+# python $manage migrate --noinput
# python $manage bower_install -- --allow-root
python $manage create-admin-user
# @todo searching every fixtures file in each folder
<div class="col-sm-6 col-xs-12">
- <a class="banner banner--colored banner--orange banner--dark" href="http://medias.ircam.fr/" target="_blank" style="background-image:url({% static 'img/services/resources.jpg' %});">
+ <a class="banner banner--colored banner--orange banner--light" href="http://ressources.ircam.fr/" target="_blank" style="background-image:url({% static 'img/services/resources.jpg' %});">
<div class="banner__content">
<div class="banner__title fsxxxl">
- {% trans 'IRCAM Archives' %}
+ {% trans 'IRCAM multimedia library' %}
</div>
<div class="banner__desc fss">
{% blocktrans %}Audiovisual and sound archives, a database on contemporary music (BRAHMS), a catalogue of works…{% endblocktrans %}
{% for activity in person.activities.all %}
<li>
{% if activity.function %}
- {% trans 'Functions'%} : {{ activity.function }}<br>
+ {% trans 'Function'%} : {{ activity.function }}<br>
{% endif %}
- {% with activity.teams.all as actvities %}
- {% if actvities %}
- {% trans 'Teams' %} :<br>
- {% for team in actvities %}
+ {% if activity.status %}
+ {% trans 'Status'%} : {{ activity.status }}<br>
+ {% endif %}
+ {% with activity.teams.all as teams %}
+ {% if teams %}
+ {% trans 'Team' %} :
+ {% for team in teams %}
{{ team.name }}<br>
{% endfor %}
{% endif %}
{% endwith %}
{% with activity.organizations.all as organizations %}
{% if organizations %}
- {% trans 'Organization' %} :<br>
+ {% trans 'Organization' %} :
{% for organization in organizations %}
{{ organization.name }}<br>
{% endfor %}
{% endif %}
{% endwith %}
+ {% if activity.date_from or activity.date_to %}
+ {% if not activity.date_from and not activity.date_to|date_year_higher_than:10 %}
+ {% trans 'Period' %} : {% trans 'to' %} {{ activity.date_to }}<br>
+ {% elif not activity.date_to %}
+ {% trans 'Period'%} : {% trans 'from' %} {{ activity.date_from }}<br>
+ {% else %}
+ {% trans 'Period'%} : {% trans 'from' %} {{ activity.date_from }} {% if not activity.date_to|date_year_higher_than:10 %}{% trans 'to' %} {{ activity.date_to }}{% endif %}<br>
+ {% endif %}
+ {% endif %}
+
</li>
{% endfor %}
</ul>