Skip to content

Commit

Permalink
💚 Fix djlint & problems found by djlint
Browse files Browse the repository at this point in the history
  • Loading branch information
pajowu committed Dec 19, 2023
1 parent 3da8bb6 commit e94ea2f
Show file tree
Hide file tree
Showing 34 changed files with 98 additions and 55 deletions.
3 changes: 3 additions & 0 deletions .djlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore": "T002,T003,H005,H006,H023,H029,H030,H031"
}
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ jobs:
node-version: '16'
cache: 'yarn'

- uses: pre-commit/[email protected]
- uses: pre-commit-ci/[email protected]
- name: Install dependencies
run: |
pip install django==4.2.4
sudo apt-get update && sudo apt-get install -y gettext
yarn install
- uses: pre-commit/[email protected]
test:
runs-on: ubuntu-latest
strategy:
Expand Down
2 changes: 1 addition & 1 deletion fragdenstaat_de/fds_cms/templates/cms/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% include "account/includes/impostor.html" %}
{% endif %}
{% block top_block %}
<div class="top-banner" style="display: none;">{% static_placeholder "top_banner" %}</div>
<div class="top-banner d-none">{% static_placeholder "top_banner" %}</div>
{% endblock %}
{% block navbar %}
{% include "header.html" %}
Expand Down
5 changes: 3 additions & 2 deletions fragdenstaat_de/fds_cms/templates/cms/pub_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@
</nav>
<div class="collapse text-bg-highlight" id="chapters">
<div class="container">
{# djlint:off H021 #}
<ol class="pb-2 overflow-auto" style="max-height: 50vh">
{% show_menu 1 100 0 1 %}
</ol>
{# djlint:on #}
</div>
</div>
</div>
Expand All @@ -58,8 +60,7 @@
{% if not request.current_page.soft_root and request.current_page.in_navigation %}
<div class="col">
<div id="toc"
class="sticky-top z-2 toc bg-body-secondary my-3 mx-0 mx-md-3 p-3 small"
style="top: 5rem"></div>
class="sticky-top z-2 toc bg-body-secondary my-3 mx-0 mx-md-3 p-3 small"></div>
</div>
{% endif %}
<div class="bg-body col-md-10 col-lg-8 order-md-last mt-3 mb-3 ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
</picture>
{% endwith %}
{% if instance.link %}
</a>{% else %}
{# djlint:off H025 #}
</a>
{# djlint:on #}
{% else %}
</div>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h1>Vielen Dank für Ihre Spende!</h1>
{% if donation.received_timestamp %}Bestätigt{% endif %}
{% endif %}
</td>
</li>
</tr>
{% endfor %}
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block title %}
{% trans "Donation" %}
{% endblock title %}
</title>
{% block top_block %}{% endblock %}
{% block navbar %}
{% include "header_minimal.html" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
</div>
</div>
{% endif %}
{# djlint:off H021 #}
<div class="input-group mt-2" style="max-width: 200px">
{# djlint:on #}
{% include "django/forms/widgets/text.html" %}
<span class="input-group-text">{{ currency }}</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# djlint:off H021 #}
<table cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
{% if heading %}
<tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# djlint:off H021 #}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# djlint:off H021 #}
<table cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
<tr>
<td valign="top" style="padding-bottom:15px; background-color:#ffffff;">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# djlint:off H021 #}
<table cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
<tr>
<td valign="top" style="padding-bottom:15px; background-color:#ffffff;">
Expand All @@ -16,3 +17,4 @@ <h3>{{ heading }}</h3>
</tr>
</table>
<hr />
{# djlint:on #}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# djlint:off H021 #}
{% extends object.get_template %}
{% load cms_tags %}
{% block body %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ <h4>{{ newsletter.title }}</h4>
{% elif has_newsletter and fallback %}
<h4>Unterstützen Sie FragDenStaat!</h4>
<div class="d-grid">
{# djlint:off D018 #}
<a class="btn btn-danger text-white"
href="/spenden/?pk_campaign=newsletter-subscribed&amp;pk_keyword={{ request.path | urlencode }}">
Jetzt spenden
</a>
{# djlint:on #}
</div>
{% endif %}
</div>
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# djlint:off H021 #}
{% extends "fds_ogimage/base.html" %}
{% load humanize %}
{% block title %}{{ object.title }}{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# djlint:off H021 #}
{% extends "fds_ogimage/govplan_plan.html" %}
{% load govplan %}
{% block tagline %}Themenbereich {{ object.title }}{% endblock %}
Expand All @@ -17,3 +18,4 @@
</div>
<div class="col-1"></div>
{% endblock %}
{# djlint:on #}
41 changes: 21 additions & 20 deletions fragdenstaat_de/templates/account/admin_send_mail.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,24 @@
<label>
{% trans "Mailing name" %}:
<input type="text" name="subject" value="" />
</p>
<p>
<input type="submit"
value="{% blocktrans count count=queryset.count %}Setup mailing to one user{% plural %}Setup mailing to {{ count }} users{% endblocktrans %}" />
</p>
</div>
<input type="hidden" name="action" value="{{ action_name }}" />
{% if select_across %}
<input type="hidden" name="select_across" value="1" />
{# set invalid selected, so confirmation action path is chosen in admin #}
<input type="hidden" name="{{ action_checkbox_name }}" value="_" />
{% else %}
{% for obj in queryset %}
<input type="hidden"
name="{{ action_checkbox_name }}"
value="{{ obj.pk|unlocalize }}" />
{% endfor %}
{% endif %}
</form>
{% endblock %}
</label>
</p>
<p>
<input type="submit"
value="{% blocktrans count count=queryset.count %}Setup mailing to one user{% plural %}Setup mailing to {{ count }} users{% endblocktrans %}" />
</p>
</div>
<input type="hidden" name="action" value="{{ action_name }}" />
{% if select_across %}
<input type="hidden" name="select_across" value="1" />
{# set invalid selected, so confirmation action path is chosen in admin #}
<input type="hidden" name="{{ action_checkbox_name }}" value="_" />
{% else %}
{% for obj in queryset %}
<input type="hidden"
name="{{ action_checkbox_name }}"
value="{{ obj.pk|unlocalize }}" />
{% endfor %}
{% endif %}
</form>
{% endblock %}
2 changes: 1 addition & 1 deletion fragdenstaat_de/templates/account/new_terms.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'account/new_terms.html' %}
{% block terms_details %}
<p>
Unsere Nutzungsbedingungen wurden von <a href="http://www.irights-law.de/">iRights.Law</a> komplett überarbeitet und verständlicher gemacht.
Unsere Nutzungsbedingungen wurden von <a href="https://www.irights-law.de/">iRights.Law</a> komplett überarbeitet und verständlicher gemacht.
</p>
<p>Folgendes ist besser geworden:</p>
<ul>
Expand Down
2 changes: 2 additions & 0 deletions fragdenstaat_de/templates/account/settings.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# djlint:off D018 #}
{% extends "account/settings.html" %}
{% load fax_tags %}
{% load newsletter_tags %}
Expand All @@ -22,3 +23,4 @@
{% newsletter_settings %}
{% include "froide_fax/_signature_form.html" with form=request.user|get_signature_form next=request.get_full_path %}
{% endblock %}
{# djlint:on #}
2 changes: 2 additions & 0 deletions fragdenstaat_de/templates/campaign/food/request_banner.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
<div class="card-body">
<div class="row">
<div class="col">
{# djlint:off D018 #}
<a href="/kampagnen/lebensmittelkontrolle/app/?pk_campaign=request">
<img src="https://media.frag-den-staat.de/files/media/thumbnails/95/94/9594735c-851f-4192-b86f-9845806ff763/topf_secret_square_1.png__210x0_q85_subject_location-500%2C500_subsampling-2_upscale.png"
height="100px"
alt="Topf Secret" />
</a>
{# djlint:off #}
</div>
<div class="col-auto">
{% if campaign.description %}{{ campaign.description|markdown }}{% endif %}
Expand Down
2 changes: 2 additions & 0 deletions fragdenstaat_de/templates/djangocms_audio/default/file.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
</button>
</div>
<div class="hstack align-items-center gap-3 mt-3 mt-md-0 ">
{# djlint:off H021 #}
<div class="audio-player__textprogress text-center"
style="min-width: 11ch">00:00 / 00:00</div>
{# djlint:on #}
<button class="btn d-flex align-items-center audio-player__speed">
<i class="fa fa-clock-o"></i>
<span class="sr-only">{% trans "Playback speed" %}:</span>
Expand Down
38 changes: 19 additions & 19 deletions fragdenstaat_de/templates/djangocms_picture/default/picture.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@
/>
{% if not instance.external_picture and not instance.use_no_cropping %}</picture>{% endif %}
{% if picture_link %}</a>{% endif %}
{# start render figure/figcaption #}
{% if instance.caption_text or instance.picture.author or instance.picture.description %}
<figcaption class="text-end">
{% if instance.caption_text or instance.picture.description %}
<div class="picture-description">
{% if instance.caption_text %}
{{ instance.caption_text }}
{% elif instance.picture.description %}
{{ instance.picture.description }}{% endif %}
{% if instance.picture.author %}–{% endif %}
</div>
{% endif %}
{% if instance.picture.author %}<div class="picture-credits">{{ instance.picture.author|markdown }}</div>{% endif %}
</figcaption>
</figure>
{% endif %}
{# end render figure/figcaption #}
{% comment %}
{# start render figure/figcaption #}
{% if instance.caption_text or instance.picture.author or instance.picture.description %}
<figcaption class="text-end">
{% if instance.caption_text or instance.picture.description %}
<div class="picture-description">
{% if instance.caption_text %}
{{ instance.caption_text }}
{% elif instance.picture.description %}
{{ instance.picture.description }}{% endif %}
{% if instance.picture.author %}–{% endif %}
</div>
{% endif %}
{% if instance.picture.author %}<div class="picture-credits">{{ instance.picture.author|markdown }}</div>{% endif %}
</figcaption>
</figure>
{% endif %}
{# end render figure/figcaption #}
{% comment %}
# https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img
# https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure
# https://github.com/divio/django-filer/blob/master/filer/models/imagemodels.py
Expand Down Expand Up @@ -83,4 +83,4 @@
{% for plugin in instance.child_plugin_instances %}
{% render_plugin plugin %}
{% endfor %}
{% endcomment %}
{% endcomment %}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# djlint:off H021 #}
{% load thumbnail %}
{% load markup %}
<!--[if gte MSO 9]>
Expand Down
2 changes: 2 additions & 0 deletions fragdenstaat_de/templates/filingcabinet/_fds_banner.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# djlint:off H021 #}
{% load static %}
{% if not object.properties.disable_embed_banner %}
<div style="position:fixed;
Expand All @@ -21,3 +22,4 @@
</a>
</div>
{% endif %}
{# djlint:on #}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% endblock %}
{% block after_foirequest_messages %}
{% if object|can_write_foirequest:request and object.status_is_final and object|foirequest_has_questionaire and object|foirequest_campaign_report_count == 0 %}
<div class="position-sticky d-print-none" style="bottom: 0">
<div class="position-sticky d-print-none bottom-0">
<div class="bg-yellow-100 text-center p-2">
<a data-tabgo="tab"
data-scrollto="questionaire"
Expand Down
1 change: 1 addition & 0 deletions fragdenstaat_de/templates/foirequest/header/header.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# djlint:off D018 #}
{% extends "foirequest/header/header.html" %}
{% load static %}
{% load i18n %}
Expand Down
1 change: 1 addition & 0 deletions fragdenstaat_de/templates/foirequest/header/info-box.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# djlint:off D018 #}
{% extends "foirequest/header/info-box.html" %}
{% block foirequest_explain_deadline %}
<a class="d-print-none"
Expand Down
1 change: 1 addition & 0 deletions fragdenstaat_de/templates/foirequest/sent.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# djlint:off D018 #}
{% extends 'foirequest/sent.html' %}
{% load newsletter_tags %}
{% block foirequest_sent_footer %}
Expand Down
2 changes: 2 additions & 0 deletions fragdenstaat_de/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,11 @@ <h5 id="menu-label" class="visually-hidden">{% translate "Main Menu" %}</h5>
alt="{{ request.user.get_full_name }}"
class="img-fluid rounded-circle">
{% else %}
{# djlint:off H021 #}
<div class="rounded-circle text-bg-callout d-flex justify-content-center align-items-center"
style="aspect-ratio: 1/1;
height: 32px">
{# djlint:on #}
<i class="fa fa-user" aria-hidden="true"></i>
<span class="visually-hidden">{{ request.user.first_name }}</span>
</div>
Expand Down
2 changes: 2 additions & 0 deletions fragdenstaat_de/templates/header_minimal.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
alt="{{ request.user.get_full_name }}"
class="img-fluid rounded-circle">
{% else %}
{# djlint:off H021 #}
<div class="rounded-circle text-bg-callout d-flex justify-content-center align-items-center"
style="aspect-ratio: 1/1;
height: 32px">
{# djlint:on #}
<i class="fa fa-user" aria-hidden="true"></i>
<span class="visually-hidden">{{ request.user.first_name }}</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ <h2>{{ law_case.title }}</h2>
<div class="pb-2 mb-3">
{% if step_count > 1 %}<div class="fw-bold mb-3">{{ question.questionaire }}</div>{% endif %}
<div class="progress">
<div class="progress-bar"
<div class="progress-bar w-100"
role="progressbar"
style="width: 100%"
aria-valuenow="100"
aria-valuemin="0"
aria-valuemax="100"></div>
Expand Down Expand Up @@ -188,12 +187,12 @@ <h3 class="h5 info-box__title">Hilfe</h3>
</div>
</div>
<div class="info-box__body">
<ul class="info-box__list ">
<ul class="info-box__list">
<li class="info-box__list-item">
<div class="info-box__list-label"></div>
<div class="info-box__list-value">{{ question.information|markdown|linebreaks }}</div>
</li>
</div>
</ul>
</div>
{% endif %}
{% if answer_form %}
Expand All @@ -203,4 +202,5 @@ <h3 class="h5 info-box__title">Hilfe</h3>
</div>
</div>
</div>
</div>
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ <h3 class="h5 info-box__title">Wie geht es weiter?</h3>
</div>
</div>
</li>
</div>
</ul>
</div>
</div>
2 changes: 2 additions & 0 deletions fragdenstaat_de/templates/problem/message_toolbar_item.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# djlint:off D018 #}
{% extends "problem/message_toolbar_item.html" %}
{% block reportinfo %}
<p>
Expand All @@ -6,3 +7,4 @@
rel="noopener">im Forum</a>, in dem sich Nutzer:innen über Ihre Anfragen und Probleme austauschen.
</p>
{% endblock %}
{# djlint:on #}
Loading

0 comments on commit e94ea2f

Please sign in to comment.