Skip to content

Commit

Permalink
quality: fix templates
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Jan 3, 2024
1 parent 482557e commit 56ec48e
Show file tree
Hide file tree
Showing 88 changed files with 901 additions and 1,099 deletions.
4 changes: 2 additions & 2 deletions lacommunaute/forum_conversation/tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ def test_selected_tags_are_checked(self):

response = self.client.get(self.url)

checked_box = f'type="checkbox" name="tags" value="{linked_tag.id}" checked="">'
checked_box = f'class="form-check-input" type="checkbox" name="tags" value="{linked_tag.id}" checked="">'
self.assertContains(response, checked_box, status_code=200)
not_checked_box = f'type="checkbox" name="tags" value="{tag.id}">'
not_checked_box = f'class="form-check-input" type="checkbox" name="tags" value="{tag.id}" >'
self.assertContains(response, not_checked_box)


Expand Down
6 changes: 3 additions & 3 deletions lacommunaute/templates/400.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{% extends "layouts/base.html" %}

{% block title %}Erreur 400{{ block.super }}{% endblock %}
{% block body_class %}p-error{{ block.super }}{% endblock %}

{% block content %}
<section class="s-title-01 mt-lg-5">
<div class="s-title-01__container container">
<div class="s-title-01__row row">
<div class="s-title-01__col col-12">
<h1 class="s-title-01__title h1"><strong>Erreur 400</strong></h1>
<h1 class="s-title-01__title h1">
<strong>Erreur 400</strong>
</h1>
<h2 class="h2">Bad request.</h2>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions lacommunaute/templates/403.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{% extends BASE_TEMPLATE %}

{% block title %}Erreur 403{{ block.super }}{% endblock %}
{% block body_class %}p-error{{ block.super }}{% endblock %}

{% block content %}
{% block htmx %}
<section class="s-title-01 mt-lg-5">
<div class="s-title-01__container container">
<div class="s-title-01__row row">
<div class="s-title-01__col col-12">
<h1 class="s-title-01__title h1"><strong>Erreur 403</strong></h1>
<h1 class="s-title-01__title h1">
<strong>Erreur 403</strong>
</h1>
<h2 class="h2">Vous ne pouvez pas continuer.</h2>
<p>Accès refusé</p>
</div>
Expand Down
14 changes: 9 additions & 5 deletions lacommunaute/templates/404.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends BASE_TEMPLATE %}

{% block title %}Erreur 404{{ block.super }}{% endblock %}
{% block body_class %}p-error{{ block.super }}{% endblock %}

{% block content %}
{% block htmx %}
<section class="s-title-01 mt-lg-5">
Expand All @@ -11,9 +9,15 @@
<div class="s-title-01__col col-12">
<h1 class="h1">Bienvenue sur le site de la Communauté de l'Inclusion.</h1>
<p>Le site a fait peau neuve et le lien sur lequel vous avez cliqué n'est plus disponible.</p>
<p>L'aide reste accessible à l'adresse <a href="https://documentation.inclusion.beta.gouv.fr/aide/">documentation.inclusion.beta.gouv.fr/aide/</a></p>
<p>La liste des communautés publiques est accessible à l'adresse <a href="{% url 'pages:home' %}">communaute.inclusion.beta.gouv.fr</a></p>
<p>Pour retrouver l'intégralité des services, vous pouvez consulter le site <a href="https://inclusion.beta.gouv.fr/">inclusion.beta.gouv.fr</a></p>
<p>
L'aide reste accessible à l'adresse <a href="https://documentation.inclusion.beta.gouv.fr/aide/">documentation.inclusion.beta.gouv.fr/aide/</a>
</p>
<p>
La liste des communautés publiques est accessible à l'adresse <a href="{% url 'pages:home' %}">communaute.inclusion.beta.gouv.fr</a>
</p>
<p>
Pour retrouver l'intégralité des services, vous pouvez consulter le site <a href="https://inclusion.beta.gouv.fr/">inclusion.beta.gouv.fr</a>
</p>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions lacommunaute/templates/500.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{% extends "layouts/base.html" %}

{% block title %}Erreur 500{{ block.super }}{% endblock %}
{% block body_class %}p-error{{ block.super }}{% endblock %}

{% block content %}
<section class="s-title-01 mt-lg-5">
<div class="s-title-01__container container">
<div class="s-title-01__row row">
<div class="s-title-01__col col-12">
<h1 class="s-title-01__title h1"><strong>Erreur 500</strong></h1>
<h1 class="s-title-01__title h1">
<strong>Erreur 500</strong>
</h1>
<h2 class="h2">Notre équipe technique a été informée du problème et s'en occupera le plus rapidement possible.</h2>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions lacommunaute/templates/board_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{% load static %}
{% load i18n %}
{% load forum_permission_tags %}

{% block title %}
{% block sub_title %}{% endblock sub_title %} - {{ MACHINA_FORUM_NAME|default:"Forum" }}
{% block sub_title %}
{% endblock sub_title %}
- {{ MACHINA_FORUM_NAME|default:"Forum" }}
{% endblock title %}

{% block main %}
<section class="s-section" id="main_container">
<div class="s-section__container container">
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a href="{{ facebook_url }}" class="dropdown-item" target="_blank">{{link_text}}</a>
<a href="{{ facebook_url }}" class="dropdown-item" target="_blank">{{ link_text }}</a>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a href="{{ tweet_url }}" class="dropdown-item" target="_blank">{{link_text}}</a>
<a href="{{ tweet_url }}" class="dropdown-item" target="_blank">{{ link_text }}</a>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a href="{{ whatsapp_url }}" class="dropdown-item" target="_blank">{{link_text}}</a>
<a href="{{ whatsapp_url }}" class="dropdown-item" target="_blank">{{ link_text }}</a>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a href="{{ mailto_url|safe }}" class="dropdown-item">{{link_text}}</a>
<a href="{{ mailto_url|safe }}" class="dropdown-item">{{ link_text }}</a>
26 changes: 11 additions & 15 deletions lacommunaute/templates/event/event_archive_month.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
{% extends "layouts/base.html" %}
{% load i18n %}

{% block title %}{% trans "Events" %}{{ block.super }}{% endblock %}
{% block sub_title %}{% trans "Events" %} {{ month }}{% endblock sub_title %}

{% block title %}
{% trans "Events" %}{{ block.super }}
{% endblock %}
{% block sub_title %}
{% trans "Events" %} {{ month }}
{% endblock sub_title %}
{% block content %}
<section class="s-title-01 mt-lg-5">
<div class="s-title-01__container container">
<div class="s-title-01__row row">
<div class="s-title-01__col col-12">
<h1 class="s-title-01__title h1"><strong>{% trans "Month Events" %}</strong></h1>
<h1 class="s-title-01__title h1">
<strong>{% trans "Month Events" %}</strong>
</h1>
</div>
</div>
</div>
</section>

<section class="s-section">
<div class="s-section__container container">
<div class="s-section__row row">
Expand All @@ -34,7 +37,6 @@ <h1 class="s-title-01__title h1"><strong>{% trans "Month Events" %}</strong></h1
</div>
</div>
</section>

<section class="s-section">
<div class="s-section__container container">
<div class="s-section__row row">
Expand All @@ -43,7 +45,7 @@ <h1 class="s-title-01__title h1"><strong>{% trans "Month Events" %}</strong></h1
{% for event in object_list %}
<li class="list-group-item list-group-item-action">
{{ event.date }} - {{ event.time }} :
<a href="{% url 'event:detail' pk=event.pk%}">{{event.name|truncatechars:100}}</a>
<a href="{% url 'event:detail' pk=event.pk %}">{{ event.name|truncatechars:100 }}</a>
</li>
{% empty %}
<li class="list-group-item">{% trans "No event yet" %}</li>
Expand All @@ -53,19 +55,13 @@ <h1 class="s-title-01__title h1"><strong>{% trans "Month Events" %}</strong></h1
</div>
</div>
</section>

<section class="s-section">
<div class="s-section__container container">
<div class="s-section__row row">
<div class="s-section__col col-12">
<a href="{% url 'event:create' %}"
role="button" class="btn btn-primary">
{% trans "Post a new Public Event" %}
</a>
<a href="{% url 'event:create' %}" role="button" class="btn btn-primary">{% trans "Post a new Public Event" %}</a>
</div>
</div>
</div>
</section>

{% endblock content %}

13 changes: 8 additions & 5 deletions lacommunaute/templates/event/event_confirm_delete.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{% extends "layouts/base.html" %}
{% load i18n %}
{% load forum_conversation_tags %}

{% block sub_title %}{% trans "Delete event" %}{% endblock sub_title %}

{% block sub_title %}
{% trans "Delete event" %}
{% endblock sub_title %}
{% block content %}
<section class="s-title-01 mt-lg-5">
<div class="s-title-01__container container">
<div class="s-title-01__row row">
<div class="s-title-01__col col-12">
<h1 class="s-title-01__title h1"><strong>{% trans "Delete event" %}</strong></h1>
<h1 class="s-title-01__title h1">
<strong>{% trans "Delete event" %}</strong>
</h1>
<h2>{% trans "Are you sure you want to delete this event?" %}</h2>
<form action="" method="post">{% csrf_token %}
<form action="" method="post">
{% csrf_token %}
<input type="hidden" name="post" value="yes" />
<button role="submit" class="btn btn-warning">{% trans "Yes, I'm sure" %}</button>
<a href="{% url 'event:myevents' %}" class="btn btn-secondary">{% trans "No, take me back" %}</a>
Expand Down
29 changes: 8 additions & 21 deletions lacommunaute/templates/event/event_detail.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
{% extends "layouts/base.html" %}
{% load i18n %}

{% block title %}{{ event.name }}{{ block.super }}{% endblock %}

{% block content %}
<section class="s-title-01 mt-lg-5">
<div class="s-title-01__container container">
<div class="s-title-01__row row">
<div class="s-title-01__col col-12">
<h1 class="s-title-01__title h1"><strong>{% trans "Public event" %}</strong></h1>
<h1 class="s-title-01__title h1">
<strong>{% trans "Public event" %}</strong>
</h1>
</div>
</div>
</div>
</section>

<section class="s-section">
<div class="s-section__container container">
<div class="s-section__row row">
Expand All @@ -22,17 +21,15 @@ <h1 class="s-title-01__title h1"><strong>{% trans "Public event" %}</strong></h1
<div class="card-header">
<div class="row">
<div class="col-12 post-content-wrapper mb-1">
<h2 class="mt-3">
{{ event.name }}
</h2>
<h2 class="mt-3">{{ event.name }}</h2>
<h3>
{% if event.date == event.end_date%}
{% if event.date == event.end_date %}
{% blocktrans trimmed with date=event.date time=event.time end_time=event.end_time %}
On {{ date }} from {{ time }} to {{ end_time }}
{% endblocktrans %}
{% else %}
{% blocktrans trimmed with date=event.date end_date=event.end_date time=event.time end_time=event.end_time %}
From {{date }} {{ time }} to {{ end_date }} {{ end_time }}
From {{ date }} {{ time }} to {{ end_date }} {{ end_time }}
{% endblocktrans %}
{% endif %}
</h3>
Expand All @@ -41,38 +38,28 @@ <h3>
</div>
<div class="card-body">
<div class="row">
<div class="col-12 post-content-wrapper mb-1">
{{ event.description }}
</div>
<div class="col-12 post-content-wrapper mb-1">{{ event.description }}</div>
</div>

{% if event.location %}

<div class="row mt-3">
<div class="col-12 post-content-wrapper mb-1">
<b><a href='{{ event.location }}' target='_blank'>{{ event.location }}</a></b>
</div>
</div>

{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
</section>

<section class="s-section">
<div class="s-section__container container">
<div class="s-section__row row">
<div class="col-12">
<a href="{% url 'event:month' year=event.date.year month=event.date.month %}"
role="button" class="btn btn-outline-primary">{% trans "Back to events list" %}
</a>
<a href="{% url 'event:month' year=event.date.year month=event.date.month %}" role="button" class="btn btn-outline-primary">{% trans "Back to events list" %}</a>
</div>
</div>
</div>
</section>
{% endblock content %}

40 changes: 11 additions & 29 deletions lacommunaute/templates/event/event_form.html
Original file line number Diff line number Diff line change
@@ -1,54 +1,40 @@
{% extends "layouts/base.html" %}
{% load i18n %}

{% load widget_tweaks %}

{% block sub_title %}{% trans "Post a new Public Event" %}{% endblock sub_title %}

{% block sub_title %}
{% trans "Post a new Public Event" %}
{% endblock sub_title %}
{% block content %}
<section class="s-title-01 mt-lg-5">
<div class="s-title-01__container container">
<div class="s-title-01__row row">
<div class="s-title-01__col col-12">
<h1 class="s-title-01__title h1"><strong>{% trans "Post a new Public Event" %}</strong></h1>
<h1 class="s-title-01__title h1">
<strong>{% trans "Post a new Public Event" %}</strong>
</h1>
</div>
</div>
</div>
</section>

<section class="s-section">
<div class="s-section__container container">
<div class="s-section__row row">
<div class="s-section__col col-12">
<div class="c-form">
<form method="post" action="." class="form" enctype="multipart/form-data" novalidate>
{% csrf_token %}

{% for hidden_field in form.hidden_fields %}
{{ hidden_field }}
{% endfor %}

{% for hidden_field in form.hidden_fields %}{{ hidden_field }}{% endfor %}
{% include "partials/form_field.html" with field=form.name %}
<div class="row">
<div class="col-6">
{% include "partials/form_field.html" with field=form.date %}
</div>
<div class="col-6">
{% include "partials/form_field.html" with field=form.time %}
</div>
<div class="col-6">{% include "partials/form_field.html" with field=form.date %}</div>
<div class="col-6">{% include "partials/form_field.html" with field=form.time %}</div>
</div>

<div class="row">
<div class="col-6">
{% include "partials/form_field.html" with field=form.end_date %}
</div>
<div class="col-6">
{% include "partials/form_field.html" with field=form.end_time %}
</div>
<div class="col-6">{% include "partials/form_field.html" with field=form.end_date %}</div>
<div class="col-6">{% include "partials/form_field.html" with field=form.end_time %}</div>
</div>
{% include "partials/form_field.html" with field=form.location %}
{% include "partials/form_field.html" with field=form.description %}

<hr>
<div class="form-row align-items-center justify-content-lg-end gx-3">
{% if event %}
Expand All @@ -73,7 +59,3 @@ <h1 class="s-title-01__title h1"><strong>{% trans "Post a new Public Event" %}</
</div>
</section>
{% endblock content %}




Loading

0 comments on commit 56ec48e

Please sign in to comment.