- Show count of conferences in each section (Current/Future/Past) - Include proper pluralization (1 conference vs N conferences) - Use Jinja2 template logic for count calculation and display Fixes #195
60 lines
1.4 KiB
HTML
60 lines
1.4 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% from "macros.html" import trip_link, conference_row with context %}
|
|
|
|
{% block title %}Conferences - Edward Betts{% endblock %}
|
|
|
|
{% block style %}
|
|
{% set column_count = 9 %}
|
|
<style>
|
|
.grid-container {
|
|
display: grid;
|
|
grid-template-columns: repeat({{ column_count }}, auto); /* 7 columns for each piece of information */
|
|
gap: 10px;
|
|
justify-content: start;
|
|
}
|
|
|
|
.grid-item {
|
|
/* Additional styling for grid items can go here */
|
|
}
|
|
|
|
.heading {
|
|
grid-column: 1 / {{ column_count + 1 }}; /* Spans from the 1st line to the 7th line */
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% macro section(heading, item_list, badge) %}
|
|
{% if item_list %}
|
|
<div class="heading">
|
|
|
|
<h2>{{ heading }}</h2>
|
|
|
|
<p>
|
|
{% set item_count = item_list|length %}
|
|
{% if item_count == 1 %}{{ item_count }} conference{% else %}{{ item_count }} conferences{% endif %}
|
|
</p>
|
|
</div>
|
|
|
|
{% for item in item_list %}
|
|
{{ conference_row(item, badge) }}
|
|
<div class="grid-item">
|
|
{% if item.linked_trip %} trip: {{ trip_link(item.linked_trip) }} {% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endmacro %}
|
|
|
|
{% block content %}
|
|
|
|
<div class="container-fluid mt-2">
|
|
<h1>Conferences</h1>
|
|
<div class="grid-container">
|
|
{{ section("Current", current, "attending") }}
|
|
{{ section("Future", future, "going") }}
|
|
{{ section("Past", past|reverse|list, "went") }}
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|