Commit 9b240279 authored by berumuron's avatar berumuron
Browse files

Add a button to display all the project events

parent 1a84c70b
......@@ -313,8 +313,8 @@ button.button-ghost {
}
/* Events structure */
.events-by-year {
margin-bottom: 3rem;
.events-by-year + .events-by-year {
margin-top: 3rem;
}
.events-by-month {
......@@ -420,6 +420,20 @@ button.button-ghost {
content: "🗑";
}
.events .events-more {
padding: 1rem;
}
.events .events-more > .folder-toggle {
padding-left: .5rem;
padding-right: .5rem;
}
.events .events-more > .folder-toggle + .folder-container {
margin-top: 1rem;
margin-left: 1rem;
}
/* Projects structure */
.project {
margin-bottom: 3rem;
......@@ -504,7 +518,7 @@ button.button-ghost {
display: none;
}
.folder .folder-toggle {
.folder .folder-toggle:not(.keep-style) {
padding: 0;
color: inherit;
......
......@@ -90,6 +90,78 @@
{% endif %}
</li>
{% endfor %}
{% if events|count > 3 %}
<div class="events-more folder folder-folded">
<button class="folder-toggle keep-style">
Plus…
</button>
<div class="folder-container">
{% for group_by_year in events[3:]|groupby('date.year')|sort(reverse=True) %}
{% set year = group_by_year.grouper %}
<div class="events-by-year">
<h2>
{{ year }}
</h2>
<ul class="events">
{% for event in group_by_year.list|sort(attribute='date', reverse=True) %}
<li class="event {{ 'event-private' if event.is_private }} {{ 'folder folder-folded' if event.description }}">
<span class="event-date">
{% if event.date_end %}
{% if event.date.month == event.date_end.month %}
{{ event.date.strftime('%d') }}
{{ event.date_end.strftime('%d %b') }}
{% else %}
{{ event.date.strftime('%d %b') }}
{{ event.date_end.strftime('%d %b') }}
{% endif %}
{% else %}
{{ event.date.strftime('%d %b') }}
{% endif %}
</span>
{% if event.description %}
<button class="folder-toggle">
{{ event.title }}
</button>
{% else %}
{{ event.title }}
{% endif %}
{% if g.current_user %}
<div class="event-actions">
<a class="event-update" href="{{ url_for('events.update', event_id=event.id ) }}">
Modifier
</a>
<button
class="button-ghost event-delete"
data-confirm="Êtes-vous certain·e de vouloir supprimer cet évènement ?"
data-action="{{ url_for('events.delete', event_id=event.id ) }}"
data-method="delete"
>
Supprimer
</button>
</div>
{% endif %}
{% if event.description %}
<div class="event-description folder-container">
{{ event.description|markdown }}
</div>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
</div>
{% endif %}
</ul>
{% if g.current_user %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment