Split conference list current, future, past
This commit is contained in:
parent
0fa6a2cdda
commit
e1540d9bfe
2 changed files with 35 additions and 24 deletions
|
|
@ -12,9 +12,29 @@
|
|||
.grid-item {
|
||||
/* Additional styling for grid items can go here */
|
||||
}
|
||||
|
||||
.heading {
|
||||
grid-column: 1 / 7; /* Spans from the 1st line to the 7th line */
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% macro row(item) %}
|
||||
<div class="grid-item text-end">{{ item.start.strftime("%a, %d %b %Y") }}</div>
|
||||
<div class="grid-item text-end">{{ item.end.strftime("%a, %d %b") }}</div>
|
||||
<div class="grid-item">{{ item.name }}</div>
|
||||
<div class="grid-item">{{ item.topic }}</div>
|
||||
<div class="grid-item">{{ item.location }}</div>
|
||||
<div class="grid-item"><a href="{{ item.url }}">{{ item.url }}</a></div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro section(heading, item_list) %}
|
||||
{% if item_list %}
|
||||
<div class="heading"><h2>{{heading}}</h2></div>
|
||||
{% for item in item_list %}{{ row(item) }}{% endfor %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="container-fluid mt-2">
|
||||
|
|
@ -30,26 +50,10 @@
|
|||
</p>
|
||||
|
||||
<div class="grid-container">
|
||||
{% for item in item_list %}
|
||||
{% if item == "today" %}
|
||||
{% set bg="bg-warning-subtle" %}
|
||||
<div class="grid-item text-end {{ bg }}">{{ today.strftime("%a, %d %b %Y") }}</div>
|
||||
<div class="{{ bg }}"></div>
|
||||
<div class="{{ bg }}">today</div>
|
||||
<div class="{{ bg }}"></div>
|
||||
<div class="{{ bg }}"></div>
|
||||
<div class="{{ bg }}"></div>
|
||||
{% else %}
|
||||
<div class="grid-item text-end">{{ item.start.strftime("%a, %d %b %Y") }}</div>
|
||||
<div class="grid-item text-end">{{ item.end.strftime("%a, %d %b") }}</div>
|
||||
<div class="grid-item">{{ item.name }}</div>
|
||||
<div class="grid-item">{{ item.topic }}</div>
|
||||
<div class="grid-item">{{ item.location }}</div>
|
||||
<div class="grid-item"><a href="{{ item.url }}">{{ item.url }}</a></div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{{ section("Current", current) }}
|
||||
{{ section("Future", future) }}
|
||||
{{ section("Past", past|reverse) }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue