Skip to content

Commit

Permalink
chore: format and lint files correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
SilvanVerhoeven committed Aug 4, 2024
1 parent 2b0c4c6 commit b9b5abf
Show file tree
Hide file tree
Showing 29 changed files with 358 additions and 283 deletions.
10 changes: 5 additions & 5 deletions myhpi/core/templates/core/information_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
<div class="row flex-column flex-lg-row">
<div class="col-lg-9">
<h1 class="page-title">
<span class="underline">
{{ page.title }}
</span>
<span class="underline">{{ page.title }}</span>
</h1>
{{ parsed_md.0|touchify_abbreviations|tag_external_links }}
</div>
Expand All @@ -23,7 +21,9 @@ <h1 class="side-panel-title">{% translate "Last edited" %}</h1>
{% translate "A long time ago" %}
{% else %}
{% get_current_timezone as TIMEZONE %}
<time id="last-published" datetime="{{ page.last_published_at|date:'c' }}" title="{{ TIMEZONE }}">
<time id="last-published"
datetime="{{ page.last_published_at|date:'c' }}"
title="{{ TIMEZONE }}">
{% blocktranslate with date=page.last_published_at|date:"SHORT_DATE_FORMAT" time=page.last_published_at|time:"TIME_FORMAT" trimmed %}
{{ date }} at {{ time }}
{% endblocktranslate %}
Expand All @@ -39,4 +39,4 @@ <h1 class="side-panel-title">{% translate "Last edited" %}</h1>
</div>
</div>
{% endwith %}
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion myhpi/core/templates/core/label.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% if minutes.labels.all %}
{% for label in minutes.labels.all %}
<span class="badge label-badge" style="background-color: {{ label.color }};">{{ label }}</span>
<span class="badge label-badge" style="background-color: {{ label.color }}">{{ label }}</span>
{% endfor %}
{% endif %}
28 changes: 11 additions & 17 deletions myhpi/core/templates/core/minutes.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@
{% include "core/toc_button.html" with toc=parsed_md.1 %}
<div class="row flex-column flex-lg-row">
<h1 class="page-title">
<span class="underline">
{{ page.title }}
</span>
<span class="underline">{{ page.title }}</span>
</h1>
<div class="col-lg-9 minutes-text">
{{ parsed_md.0|touchify_abbreviations|tag_external_links }}
</div>
<div class="col-lg-9 minutes-text">{{ parsed_md.0|touchify_abbreviations|tag_external_links }}</div>
<div class="col-lg-3 minutes-meta">
<aside class="side-panel border-accent">
<h1 class="side-panel-title">{% translate "Date" %}</h1>
Expand All @@ -33,18 +29,14 @@ <h1 class="side-panel-title">{% translate "Minutes taker" %}</h1>
<aside class="side-panel border-accent">
<h1 class="side-panel-title">{% translate "Participants" %}</h1>
<ul>
{% for participant in page.participants.all %}
<li>{{ participant.get_full_name }}</li>
{% endfor %}
{% for participant in page.participants.all %}<li>{{ participant.get_full_name }}</li>{% endfor %}
</ul>
</aside>
<aside class="side-panel border-accent">
<h1 class="side-panel-title">{% translate "Guests" %}</h1>
{% if page.guests %}
<ul>
{% for guest in page.guests %}
<li>{{ guest }}</li>
{% endfor %}
{% for guest in page.guests %}<li>{{ guest }}</li>{% endfor %}
</ul>
{% else %}
<i>{% translate "No guests" %}</i>
Expand All @@ -61,7 +53,7 @@ <h1 class="side-panel-title">{% translate "Labels" %}</h1>
{% if page.labels.all %}
<p>{% include "core/label.html" with minutes=page %}</p>
{% else %}
<i>{% translate "No labels"%}</i>
<i>{% translate "No labels" %}</i>
{% endif %}
</aside>
{% include "core/sidebar.html" %}
Expand All @@ -72,21 +64,23 @@ <h1 class="side-panel-title">{% translate "Labels" %}</h1>
<div class="col-6">
{% prev_minutes page as prev %}
{% if prev %}
<a href="{{ prev.url }}" class="btn btn-outline-primary minutes-navigation-button">{% bs_icon 'arrow-left' extra_classes='minutes-navigation-icon' %} {% translate "Previous minutes" %}</a>
<a href="{{ prev.url }}"
class="btn btn-outline-primary minutes-navigation-button">{% bs_icon 'arrow-left' extra_classes='minutes-navigation-icon' %} {% translate "Previous minutes" %}</a>
{% endif %}
</div>
<div class="col-6 text-end">
{% next_minutes page as next %}
{% if next %}
<a href="{{ next.url }}" class="btn btn-outline-primary minutes-navigation-button"> {% translate "Next minutes" %} {% bs_icon 'arrow-right' extra_classes='minutes-navigation-icon' %}</a>
<a href="{{ next.url }}"
class="btn btn-outline-primary minutes-navigation-button"> {% translate "Next minutes" %} {% bs_icon 'arrow-right' extra_classes='minutes-navigation-icon' %}</a>
{% endif %}
</div>
</div>
</div>
</div>
{% endwith %}
</div>
{% endblock %}

{% block extra_js %}
<script type="text/javascript" src="{% static 'js/print_processor.js' %}"></script>
{% endblock %}
{% endblock %}
51 changes: 25 additions & 26 deletions myhpi/core/templates/core/minutes_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,47 @@

{% block content %}
<h1 class="page-title">
<span class="underline">
{{ page.title }} {{ selected_year }}
</span>
<span class="underline">{{ page.title }} {{ selected_year }}</span>
</h1>
{% if minutes %}
<table class="table table-striped">
{% for minute in minutes %}
<tr>
<td><a href="{{ minute.get_valid_url }}">{{ minute.date|date:"d.m.Y" }}</a></td>
<td>
<a href="{{ minute.get_valid_url }}">{{ minute.date|date:"d.m.Y" }}</a>
</td>
<td>
{% if minute.has_unpublished_changes %}
<span title='{% translate "Page has unpublished changes!" %}' aria-hidden="true">{% bs_icon "exclamation-triangle" %}</span>
<span title="{% translate 'Page has unpublished changes!' %}"
aria-hidden="true">{% bs_icon "exclamation-triangle" %}</span>
{% endif %}
</td>
<td>{% include "core/label.html" with minutes=minute %}</td>
<td>
{% include "core/label.html" with minutes=minute %}
<a href="{{ minute.get_valid_url }}">{{ minute.title }}</a>
</td>
<td><a href="{{ minute.get_valid_url }}">{{ minute.title }}</a></td>
<td>
{% if minute.attachments.count > 0 %}
<span class="text-gray" data-toggle="tooltip" data-placement="left" data-container="body" title="{{ minute.attachments.all|join:', ' }}">
{% bs_icon "paperclip" %}
</span>
<span class="text-gray"
data-toggle="tooltip"
data-placement="left"
data-container="body"
title="{{ minute.attachments.all|join:', ' }}">{% bs_icon "paperclip" %}</span>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% else %}
<p>
{% translate "No minutes available for this year." %}
</p>
<p>{% translate "No minutes available for this year." %}</p>
{% endif %}
{% if all_years|length > 1 %}
<nav aria-label="Page navigation" class="d-inline-block">
<ul class="pagination">
<li class="page-item {% if selected_year == all_years|first %} disabled {% endif %}">
<a class="page-link" href="{{ minute_list.get_valid_url }}?year={{ all_years|first }}" aria-label="First">
<li class="page-item {% if selected_year == all_years|first %}disabled{% endif %}">
<a class="page-link"
href="{{ minute_list.get_valid_url }}?year={{ all_years|first }}"
aria-label="First">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
Expand All @@ -56,15 +59,9 @@ <h1 class="page-title">
{% endif %}

{% for paginated_year in year_range %}
<li
{% if selected_year == paginated_year %}
class="page-item active" aria-current="true"
{% else %}
class="page-item"
{% endif %}>
<a class="page-link" href="{{ minute_list.get_valid_url }}?year={{ paginated_year }}">
{{ paginated_year }}
</a>
<li {% if selected_year == paginated_year %} class="page-item active" aria-current="true" {% else %} class="page-item" {% endif %}>
<a class="page-link"
href="{{ minute_list.get_valid_url }}?year={{ paginated_year }}">{{ paginated_year }}</a>
</li>
{% endfor %}

Expand All @@ -76,8 +73,10 @@ <h1 class="page-title">
</li>
{% endif %}

<li class="page-item {% if selected_year == all_years|last %} disabled {% endif %}">
<a class="page-link" href="{{ minute_list.get_valid_url }}?year={{ all_years|last }}" aria-label="Last">
<li class="page-item {% if selected_year == all_years|last %}disabled{% endif %}">
<a class="page-link"
href="{{ minute_list.get_valid_url }}?year={{ all_years|last }}"
aria-label="Last">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
Expand Down
15 changes: 10 additions & 5 deletions myhpi/core/templates/core/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1 class="side-panel-title">{% translate "Visibility" %}</h1>
<!-- Bootstrap 5.2 supports responsive offcanvas.
This duplication is a workaround and should be removed after the upgrade -->
<div class="d-none d-lg-block side-panel-container">
{%if parsed_md.1|hasTocContent %}
{% if parsed_md.1|hasTocContent %}
<aside class="side-panel border-accent sidebar-container d-print-none">
<h1 class="side-panel-title">{% translate "Table of contents" %}</h1>
{{ parsed_md.1 }}
Expand All @@ -40,11 +40,16 @@ <h1 class="side-panel-title">{% translate "Attachments" %}</h1>
{% endif %}
</div>

{%if parsed_md.1|hasTocContent %}
<div class="offcanvas offcanvas-bottom" tabindex="-1" id="sidebar-offcanvas" aria-labelledby="sidebar-offcanvas-label">
{% if parsed_md.1|hasTocContent %}
<div class="offcanvas offcanvas-bottom"
tabindex="-1"
id="sidebar-offcanvas"
aria-labelledby="sidebar-offcanvas-label">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="sidebar-offcanvas-label">{% translate "Table of contents" %}</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas"
<button type="button"
class="btn-close"
data-bs-dismiss="offcanvas"
aria-label="{% translate 'Close' %}"></button>
</div>
<div class="offcanvas-body">
Expand All @@ -66,4 +71,4 @@ <h1 class="side-panel-title">{% translate "Attachments" %}</h1>
{% endif %}
</div>
</div>
{% endif %}
{% endif %}
19 changes: 15 additions & 4 deletions myhpi/core/templates/core/text_array_widget.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
<input type="hidden" id="id-{{ widget.name }}" name="{{ widget.name }}" value="{{ widget.value }}">
<input type="hidden"
id="id-{{ widget.name }}"
name="{{ widget.name }}"
value="{{ widget.value }}">
<div id="text-array-{{ widget.name }}" class="text-array">
{% if strings|length == 0 %}
<div>
<input type="text" onkeydown="onTextArrayItemInputKeyDown('{{ widget.name }}', event, this)" onkeyup="synchronizeTextArray('{{ widget.name }}')">
<input type="text"
onkeydown="onTextArrayItemInputKeyDown('{{ widget.name }}', event, this)"
onkeyup="synchronizeTextArray('{{ widget.name }}')">
<span onclick="removeTextArrayItem('{{ widget.name }}',this)">X</span>
</div>
{% endif %}
{% for string in strings %}
<div>
<input type="text" value="{{ string }}" onkeydown="onTextArrayItemInputKeyDown('{{ widget.name }}', event, this)" onkeyup="synchronizeTextArray('{{ widget.name }}')">
<input type="text"
value="{{ string }}"
onkeydown="onTextArrayItemInputKeyDown('{{ widget.name }}', event, this)"
onkeyup="synchronizeTextArray('{{ widget.name }}')">
<span onclick="removeTextArrayItem('{{ widget.name }}',this)">X</span>
</div>
{% endfor %}
</div>
<button type="button" class="text-array-button" id="text-array-add-button-{{ widget.name }}" onclick="addTextArrayItem('{{ widget.name }}').focus()">+</button>
<button type="button"
class="text-array-button"
id="text-array-add-button-{{ widget.name }}"
onclick="addTextArrayItem('{{ widget.name }}').focus()">+</button>
12 changes: 8 additions & 4 deletions myhpi/core/templates/core/toc_button.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
{% load i18n %}
{% load bootstrap_icons %}

{%if toc|hasTocContent %}
{% if toc|hasTocContent %}
<div id="sidebar-toggle" class="d-grid d-lg-none d-print-none">
<button type="button" data-bs-toggle="offcanvas" data-bs-target="#sidebar-offcanvas"
aria-controls="sidebar-offcanvas" class="btn btn-light mb-3" aria-label="{% translate 'Table of contents' %}">
<button type="button"
data-bs-toggle="offcanvas"
data-bs-target="#sidebar-offcanvas"
aria-controls="sidebar-offcanvas"
class="btn btn-light mb-3"
aria-label="{% translate 'Table of contents' %}">
{% bs_icon 'list-ol' size='1.3rem' %}
{% translate "Table of contents" %}
</button>
</div>
{% endif %}
{% endif %}
16 changes: 6 additions & 10 deletions myhpi/polls/templates/polls/base_poll.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,18 @@
<div class="row flex-column flex-lg-row">
<div class="col-lg-9">
<h1 class="page-title">
<span class="underline">
{{ page.title }}
</span>
<span class="underline">{{ page.title }}</span>
</h1>
{{ parsed_md.0|touchify_abbreviations|tag_external_links }}
<h2> {{ page.question }} </h2>
<h2>{{ page.question }}</h2>
{% if page|can_vote:request.user %}
{% block ballot %}
{% endblock %}
{% block ballot %}{% endblock %}
{% elif page.results_visible %}
{% block results %}
{% endblock %}
{% block results %}{% endblock %}
{% elif not page.in_voting_period %}
<p> {% translate "You've accessed this page outside of the voting period." %} </p>
<p>{% translate "You've accessed this page outside of the voting period." %}</p>
{% else %}
<p> {% translate "You are not allowed to cast (another) vote and the results are not visible yet." %}</p>
<p>{% translate "You are not allowed to cast (another) vote and the results are not visible yet." %}</p>
{% endif %}
</div>
<div class="col-lg-3">
Expand Down
16 changes: 10 additions & 6 deletions myhpi/polls/templates/polls/majority_vote_poll.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
<form method="post">
{% csrf_token %}
{% for choice in page.choices.all %}
<input type={% if page.max_allowed_answers > 1 %} "checkbox" {% else %} "radio"
{% endif %} name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}" />
<label for="choice{{ forloop.counter }}">{{ choice.text }}</label><br/>
<input type="{% if page.max_allowed_answers > 1 %} 'checkbox' {% else %} 'radio' {% endif %}"
name="choice"
id="choice{{ forloop.counter }}"
value="{{ choice.id }}" />
<label for="choice{{ forloop.counter }}">{{ choice.text }}</label>
<br />
{% endfor %}
<input type="submit" value="Vote"/>
<input type="submit" value="Vote" />
</form>
{% endblock %}

Expand All @@ -19,7 +22,8 @@
<tr>
<th class="col-sm-3">{% trans "Choice" %}</th>
{% if has_choice_descriptions %}
<th class="col-sm-5">{% trans "Description" %}</th>{% endif %}
<th class="col-sm-5">{% trans "Description" %}</th>
{% endif %}
<th class="col-sm-1 text-right">{% trans "Votes" %}</th>
<th class="col-sm-1 text-right">{% trans "Percentage" %}</th>
</tr>
Expand All @@ -31,4 +35,4 @@
</tr>
{% endfor %}
</table>
{% endblock %}
{% endblock %}
25 changes: 13 additions & 12 deletions myhpi/polls/templates/polls/poll_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@

{% block content %}
<h1 class="page-title">
<span class="underline">
{{ page.title }}
</span>
<span class="underline">{{ page.title }}</span>
</h1>
<table class="table table-striped">
<thead>
<tr>
<th>{% translate "Title" %}</th>
<th>{% translate "Voting period" %}</th>
</tr>
<tbody>
{% for poll in poll_list %}
<tr>
<td><a href="{% pageurl poll %}">{{ poll.title }}</a></td>
<td>{{ poll.start_date }} - {{ poll.end_date }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</thead>
<tbody>
{% for poll in poll_list %}
<tr>
<td>
<a href="{% pageurl poll %}">{{ poll.title }}</a>
</td>
<td>{{ poll.start_date }} - {{ poll.end_date }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
Loading

0 comments on commit b9b5abf

Please sign in to comment.