Skip to content

Commit

Permalink
Dedent in HTML templates
Browse files Browse the repository at this point in the history
  • Loading branch information
homeworkprod committed May 15, 2024
1 parent 811da4f commit 57d227a
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@

{% block body %}

<div class="block block--centered">
<p class="text--centered">This database covers:</p>
<div class="row row--collapsible row--center">
<div class="column text--centered">
<a href="{{ url_for('party.index') }}">
<div class="bignumber">{{ party_count }}</div>
<div class="bignumber-caption">parties</div>
</a>
</div>
<div class="column text--centered">
<a href="{{ url_for('series.index') }}">
<div class="bignumber">{{ series_count }}</div>
<div class="bignumber-caption">party series</div>
</a>
</div>
<div class="column text--centered">
<div class="bignumber">{{ country_count }}</div>
<div class="bignumber-caption">countries</div>
</div>
<div class="column text--centered">
<div class="bignumber">0</div>
<div class="bignumber-caption">organizers<br><small>(yet)</small></div>
</div>
<div class="block block--centered">
<p class="text--centered">This database covers:</p>
<div class="row row--collapsible row--center">
<div class="column text--centered">
<a href="{{ url_for('party.index') }}">
<div class="bignumber">{{ party_count }}</div>
<div class="bignumber-caption">parties</div>
</a>
</div>
</div>

<div class="block" style="margin-top: 3rem;">
<p>A bunch of people were so kind to collect and submit data:</p>
<div class="block--centered">
<a href="https://github.com/orgatalk/lanpartydb-data/contributors" class="contributors">
<img src="https://contrib.rocks/image?repo=orgatalk/lanpartydb-data&columns=5">
<div class="column text--centered">
<a href="{{ url_for('series.index') }}">
<div class="bignumber">{{ series_count }}</div>
<div class="bignumber-caption">party series</div>
</a>
</div>
<p>Check out the <a href="https://github.com/orgatalk/lanpartydb-data/blob/main/CONTRIBUTING.md">Contribution Guide</a> to see how you can help improving this database.</p>
<div class="column text--centered">
<div class="bignumber">{{ country_count }}</div>
<div class="bignumber-caption">countries</div>
</div>
<div class="column text--centered">
<div class="bignumber">0</div>
<div class="bignumber-caption">organizers<br><small>(yet)</small></div>
</div>
</div>
</div>

<div class="block" style="margin-top: 3rem;">
<p>A bunch of people were so kind to collect and submit data:</p>
<div class="block--centered">
<a href="https://github.com/orgatalk/lanpartydb-data/contributors" class="contributors">
<img src="https://contrib.rocks/image?repo=orgatalk/lanpartydb-data&columns=5">
</a>
</div>
<p>Check out the <a href="https://github.com/orgatalk/lanpartydb-data/blob/main/CONTRIBUTING.md">Contribution Guide</a> to see how you can help improving this database.</p>
</div>

{%- endblock %}
56 changes: 28 additions & 28 deletions src/lanpartydb_website/blueprints/party/templates/party/_list.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<table class="table--index table--wide">
<thead>
<tr>
<th>{{ _('Title') }}</th>
<th></th>
<th>{{ _('Start') }}</th>
<th>{{ _('End') }}</th>
<th class="number">{{ _('Seats') }}</th>
</tr>
</thead>
<tbody>
{%- for party in parties %}
<tr>
<td><a href="{{ url_for('party.view', slug=party.slug) }}">{{ party.title }}</a></td>
<td class="centered">
{%- if party.location %}
{%- with country = countries.get(alpha_2=party.location.country_code) %}
<span title="{{ country.name }}">{{ country.flag }}</span>
{%- endwith %}
{%- endif %}
</td>
<td class="nowrap">{{ party.start_on|dateformat }}</td>
<td class="nowrap">{{ party.end_on|dateformat }}</td>
<td class="number">{{ party.seats }}</td>
</tr>
{%- endfor %}
</tbody>
</table>
<table class="table--index table--wide">
<thead>
<tr>
<th>{{ _('Title') }}</th>
<th></th>
<th>{{ _('Start') }}</th>
<th>{{ _('End') }}</th>
<th class="number">{{ _('Seats') }}</th>
</tr>
</thead>
<tbody>
{%- for party in parties %}
<tr>
<td><a href="{{ url_for('party.view', slug=party.slug) }}">{{ party.title }}</a></td>
<td class="centered">
{%- if party.location %}
{%- with country = countries.get(alpha_2=party.location.country_code) %}
<span title="{{ country.name }}">{{ country.flag }}</span>
{%- endwith %}
{%- endif %}
</td>
<td class="nowrap">{{ party.start_on|dateformat }}</td>
<td class="nowrap">{{ party.end_on|dateformat }}</td>
<td class="number">{{ party.seats }}</td>
</tr>
{%- endfor %}
</tbody>
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

{% block body %}

<h1>Parties <small>{{ pagination.total }}</small></h1>
<h1>Parties <small>{{ pagination.total }}</small></h1>

<div class="block">
<div class="block">
{{ pagination.links }}
</div>
</div>

{% include 'party/_list.html' %}

<div class="block text--centered">
<div class="block text--centered">
{{ pagination.info }}
</div>
</div>

<div class="block">
<div class="block">
{{ pagination.links }}
</div>
</div>

{%- endblock %}
118 changes: 59 additions & 59 deletions src/lanpartydb_website/blueprints/party/templates/party/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,80 @@

{% block body %}

<div class="breadcrumbs"><a href="{{ url_for('.index') }}">{{ _('Parties') }}</a> /</div>
<h1>{{ party.title }}</h1>
<div class="breadcrumbs"><a href="{{ url_for('.index') }}">{{ _('Parties') }}</a> /</div>
<h1>{{ party.title }}</h1>

<div class="grid-2columns">
<div>
<div class="grid-2columns">
<div>

<div class="row" style="column-gap: 2rem;">
<div>
<div class="row" style="column-gap: 2rem;">
<div>

<div class="data-label">{{ _('Start') }}</div>
<div class="data-value">{{ party.start_on|dateformat }}</div>
<div class="data-label">{{ _('Start') }}</div>
<div class="data-value">{{ party.start_on|dateformat }}</div>

</div>
<div>
</div>
<div>

<div class="data-label">{{ _('End') }}</div>
<div class="data-value">{{ party.end_on|dateformat }}</div>
<div class="data-label">{{ _('End') }}</div>
<div class="data-value">{{ party.end_on|dateformat }}</div>

</div>
</div>

</div>
<div>

{%- if party.seats %}
<div class="data-label">{{ _('Seats') }}</div>
<div class="data-value">{{ party.seats }}</div>
{%- endif %}
</div>
<div>

</div>
<div>

{%- if party.location %}
<div class="data-label">{{ _('Location') }}</div>
<div class="data-value">
{%- with location = party.location %}
{{ location.name }}<br>
{{ location.street }}<br>
{{ location.zip_code }} {{ location.city }}<br>
{%- if country %}
{{ country.flag }} {{ country.name }}
{%- else %}
{{ location.country_code }}
{%- endif %}
{%- if location.latitude and location.longitude %}
<br>
<a href="http://www.openstreetmap.org/?lat={{ location.latitude }}&lon={{ location.longitude }}&mlat={{ location.latitude }}&mlon={{ location.longitude }}&zoom=15">View on OpenStreetMap</a>
{%- endif %}
{%- endwith %}
</div>
{%- endif %}
{%- if party.seats %}
<div class="data-label">{{ _('Seats') }}</div>
<div class="data-value">{{ party.seats }}</div>
{%- endif %}

</div>
<div>

{%- if party.location %}
<div class="data-label">{{ _('Location') }}</div>
<div class="data-value">
{%- with location = party.location %}
{{ location.name }}<br>
{{ location.street }}<br>
{{ location.zip_code }} {{ location.city }}<br>
{%- if country %}
{{ country.flag }} {{ country.name }}
{%- else %}
{{ location.country_code }}
{%- endif %}
{%- if location.latitude and location.longitude %}
<br>
<a href="http://www.openstreetmap.org/?lat={{ location.latitude }}&lon={{ location.longitude }}&mlat={{ location.latitude }}&mlon={{ location.longitude }}&zoom=15">View on OpenStreetMap</a>
{%- endif %}
{%- endwith %}
</div>
<div>

{%- if party.links and party.links.website %}
{%- with website = party.links.website %}
<div class="data-label">{{ _('Website') }}</div>
<div class="data-value">
{%- if not website.offline %}
<a href="{{ website.url }}">{{ website.url }}</a>
{%- else %}
{{ website.url }} <small class="dim">(offline)</small>
{%- endif %}
</div>
{%- endwith %}
{%- endif %}
{%- endif %}

</div>
<div>

{%- if party.links and party.links.website %}
{%- with website = party.links.website %}
<div class="data-label">{{ _('Website') }}</div>
<div class="data-value">
{%- if not website.offline %}
<a href="{{ website.url }}">{{ website.url }}</a>
{%- else %}
{{ website.url }} <small class="dim">(offline)</small>
{%- endif %}
</div>
{%- endwith %}
{%- endif %}

</div>
</div>

{%- if series %}
<div class="data-label">{{ _('Part of series') }}</div>
<div class="data-value"><a href="{{ url_for('series.view', slug=series.slug) }}">{{ series.name }}</a></div>
{%- endif %}
{%- if series %}
<div class="data-label">{{ _('Part of series') }}</div>
<div class="data-value"><a href="{{ url_for('series.view', slug=series.slug) }}">{{ series.name }}</a></div>
{%- endif %}

{%- endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

{% block body %}

<h1>Series <small>{{ series_and_party_counts|length }}</small></h1>
<h1>Series <small>{{ series_and_party_counts|length }}</small></h1>

<table class="table--index">
<thead>
<tr>
<th>{{ _('Name') }}</th>
<th class="number">{{ _('Parties') }}</th>
</tr>
</thead>
<tbody>
{%- for series, party_count in series_and_party_counts %}
<tr>
<td><a href="{{ url_for('.view', slug=series.slug) }}">{{ series.name }}</a></td>
<td class="number">{{ party_count }}</td>
</tr>
{%- endfor %}
</tbody>
</table>
<table class="table--index">
<thead>
<tr>
<th>{{ _('Name') }}</th>
<th class="number">{{ _('Parties') }}</th>
</tr>
</thead>
<tbody>
{%- for series, party_count in series_and_party_counts %}
<tr>
<td><a href="{{ url_for('.view', slug=series.slug) }}">{{ series.name }}</a></td>
<td class="number">{{ party_count }}</td>
</tr>
{%- endfor %}
</tbody>
</table>

{%- endblock %}
20 changes: 10 additions & 10 deletions src/lanpartydb_website/blueprints/series/templates/series/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

{% block body %}

<div class="breadcrumbs"><a href="{{ url_for('.index') }}">{{ _('Series') }}</a> /</div>
<h1>{{ series.name }}</h1>
<div class="breadcrumbs"><a href="{{ url_for('.index') }}">{{ _('Series') }}</a> /</div>
<h1>{{ series.name }}</h1>

{%- if series.alternative_names %}
<div class="data-label">{{ _('Alternative Names') }}</div>
<div class="data-value">{{ series.alternative_names|join(', ') }}</div>
{%- endif %}
{%- if series.alternative_names %}
<div class="data-label">{{ _('Alternative Names') }}</div>
<div class="data-value">{{ series.alternative_names|join(', ') }}</div>
{%- endif %}

{%- if parties %}
<h2>{{ _('Parties') }}</h2>
{%- if parties %}
<h2>{{ _('Parties') }}</h2>
{% include 'party/_list.html' %}
<div class="block block--centered">{{ parties|length }} items</div>
{%- endif %}
<div class="block block--centered">{{ parties|length }} items</div>
{%- endif %}

{%- endblock %}

0 comments on commit 57d227a

Please sign in to comment.