-
Notifications
You must be signed in to change notification settings - Fork 167
/
Copy pathcontent_item.part.html
154 lines (138 loc) · 5.81 KB
/
content_item.part.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
{% load captureas %}
{% load thumbnail %}
{% load date %}
{% load i18n %}
{% load set %}
{% load displayable_authors %}
{% if public_content %}
{% set public_content.content as content %}
{% set True as online %}
{% else %}
{% set False as online %}
{% endif %}
{% captureas taglist %}
{% if public_content.is_opinion %}
{% url 'opinion:list' %}
{% else %}
{% url 'publication:list' %}
{% endif %}
{% endcaptureas %}
{% captureas link %}
{% if online %}
{{ public_content.get_absolute_url_online }}
{% elif type == 'beta' and content.in_beta %}
{{ content.get_absolute_url_beta }}
{% else %}
{{ content.get_absolute_url }}
{% endif %}
{% endcaptureas %}
{% captureas content_title %}
{% if public_content and online %}
{{ public_content.title }}
{% else %}
{{ content.title }}
{% endif %}
{% endcaptureas %}
{% captureas content_subtitle %}
{% if public_content and online %}
{{ public_content.description}}
{% else %}
{{ content.description }}
{% endif %}
{% endcaptureas %}
{# Authors (by X, Y and Z); can't have multiple whitespaces because of the title! #}
{% captureas authors_text %}
{% for author in content|displayable_authors:online %}{% if forloop.first %}{% trans "par" %}{% elif forloop.last %} {% trans "et" %}{% else %},{% endif %} {% if author == user %}{% trans "vous" %}{% else %}<a href="{{ author.get_absolute_url }}">{{ author.username }}</a>{% endif %}{% endfor %}
{% endcaptureas %}
{# Categories (in X, Y and Z) #}
{% captureas categories_text %}
{% if not ignore_categories %}
{% for cat in content.subcategory.all %}
{% if forloop.first %}{% trans "dans" %}{% elif forloop.last %} {% trans "et" %}{% else %},{% endif %}
{% if content.is_opinion %}
<a href="{% url 'opinion:list' %}?category={{ cat.slug }}">{{ cat.title }}</a>
{% else %}
<a href="{% url 'publication:list' %}?subcategory={{ cat.slug }}">{{ cat.title }}</a>
{% endif %}
{% endfor %}
{% endif %}
{% endcaptureas %}
<article class="content-item{% if online and show_reactions %} has-reactions{% endif %}{{ item_class }}">
<a href="{{ link }}" tabindex="-1" class="content-illu {{ content.type|lower }}-illu">
{% if content.image %}
<img src="{{ content.image.physical.content_thumb.url }}" alt="Logo de {{ content_title }}">
{% endif %}
</a>
<div class="content-info">
<header>
<h3 class="content-title" itemprop="itemListElement">
<a href="{{ link }}" title="{{ content_title }}{% if content_subtitle and show_description %} − {{ content_subtitle }}{% endif %}">
{{ content_title }}
</a>
</h3>
<p class="content-description" {% if not show_description or not content_subtitle %}aria-hidden="true"{% endif %}>
{% if content_subtitle and show_description %}
<a href="{{ link }}" title="{{ content_title }}{% if content_subtitle and show_description %} − {{ content_subtitle }}{% endif %}">
{{ content_subtitle }}
</a>
{% endif %}
</p>
</header>
<footer{% if online and show_reactions %} class="has-reactions"{% endif %}>
<div class="content-meta">
{% if content.subcategory and not ignore_categories %}
<p class="content-categories">
{{ categories_text }}
</p>
{% endif %}
{% if content.sha_public %}
<p class="content-authors">
{% if content.public_version %}
{% set content.public_version.publication_date as pubdate %}
{% else %}
{% set content.pubdate as pubdate %}
{% endif %}
{% if pubdate and not ignore_date %}
<span class="long content-pubdate">{{ pubdate|format_date|capfirst }}</span>
<span class="short content-pubdate">{{ pubdate|format_date:True|capfirst }}</span>
{% endif %}
{{ authors_text }}
</p>
{% elif content.sha_validation %}
<p class="content-state">
{% trans "En validation" %}
</p>
{% else %}
<p class="content-state">
{% trans "Brouillon" %}
</p>
{% endif %}
</div>
{% if online and show_reactions %}
{% with note_count=content.get_note_count %}
<a class="content-reactions" href="
{% if content.last_note %}
{{ content.last_read_note.get_absolute_url }}
{% else %}
{{ link }}#comments
{% endif %}"
title="{% if note_count == 0 %}{% trans "Aucune réaction" %}{% else %}{{ note_count }} {% trans "réaction" %}{{ note_count|pluralize }}{% endif %}"
>
<span>{{ note_count }}</span>
</a>
{% endwith %}
{% endif %}
</footer>
</div>
{% if content.tags.all %}
<ul class="content-tags" itemprop="keywords">
{% for tag in content.tags.all|slice:":3" %}
<li>
<a href="{{ taglist }}?tag={{ tag.slug }}">
{{ tag.title }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</article>