Skip to content

Commit

Permalink
Improve form templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash-Crow committed Jun 27, 2024
1 parent dcc1d46 commit 272e4a9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
4 changes: 2 additions & 2 deletions forms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Meta:

class SitesFacilesBaseForm(BaseForm):
"""
A base form that adds the necessary class on relevant fields
A base form that adds the necessary DSFR class on relevant fields
"""

def __init__(self, *args, **kwargs):
Expand All @@ -49,7 +49,7 @@ def __init__(self, *args, **kwargs):

@property
def default_renderer(self):
return DsfrDjangoTemplates # Settings wasn't modified
return DsfrDjangoTemplates


class SitesFacilesFormBuilder(FormBuilder):
Expand Down
27 changes: 15 additions & 12 deletions forms/templates/forms/form_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@
{% endblock title %}

{% block content %}
<div class="fr-container fr-my-6w">
<div class="fr-grid-row fr-grid-row--center">
<div class="fr-col-md-8">
<h1>{{ page.title }}</h1>
{{ page.intro|richtext }}
<form action="{% pageurl page %}" method="post">
{% csrf_token %}
{% dsfr_form %}
<input class="fr-btn" type="submit">
</form>
</div>
</div>
<div class="fr-container fr-pt-4w">
{% include "content_manager/blocks/breadcrumbs.html" %}
<h1>{{ page.title }}</h1>

</div>

{% include "content_manager/blocks/messages.html" %}

<div class="fr-container fr-pb-6w">
{{ page.intro|richtext }}
<form action="{% pageurl page %}" method="post">
{% csrf_token %}
{% dsfr_form %}
<input class="fr-btn" type="submit">
</form>
</div>
{% endblock content %}
13 changes: 12 additions & 1 deletion forms/templates/forms/form_page_landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

{% load i18n wagtailcore_tags %}

{% block title %}
<title>{{ page.seo_title|default:page.title }} — {{ settings.content_manager.CmsDsfrConfig.site_title }}</title>
{% endblock title %}

{% block content %}
<div class="fr-container fr-mt-6w">
<div class="fr-container fr-pt-4w">
{% include "content_manager/blocks/breadcrumbs.html" %}
<h1>{{ page.title }}</h1>

</div>

{% include "content_manager/blocks/messages.html" %}

<div class="fr-container fr-mb-6w">
{% if page.thank_you_text %}
{{ page.thank_you_text|richtext }}
{% else %}
Expand Down

0 comments on commit 272e4a9

Please sign in to comment.