-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dsfr_notice tag (and relevant site config), improve i18n
- Loading branch information
Showing
13 changed files
with
119 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 5.0.3 on 2024-04-02 13:29 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("dsfr", "0004_dsfrconfig_beta_tag_dsfrconfig_operator_logo_alt_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="dsfrconfig", | ||
name="notice", | ||
field=models.CharField( | ||
blank=True, | ||
default="", | ||
max_length=200, | ||
verbose_name="Bandeau d’information importante", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{% load i18n %} | ||
{% translate "Hide message" as hide_message %} | ||
<div class="fr-notice fr-notice--info"> | ||
<div class="fr-container"> | ||
<div class="fr-notice__body"> | ||
<p class="fr-notice__title"> | ||
{{ self.title|safe }} | ||
</p> | ||
{% if self.is_collapsible %} | ||
<button class="fr-btn--close fr-btn" | ||
title="{{ hide_message }}" | ||
onclick="const notice = this.parentNode.parentNode.parentNode; notice.parentNode.removeChild(notice)"> | ||
{{ hide_message }} | ||
</button> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
const language_selectors = document.querySelectorAll(".fr-translate__language") | ||
|
||
language_selectors.forEach(el => el.addEventListener("click", event => { | ||
document.cookie = "django_language=" + el.lang; | ||
document.cookie = "django_language=" + el.lang + ";Path=\"/django-dsfr\";SameSite=Strict" | ||
window.location.reload() | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
{% extends "dsfr/base.html" %} | ||
{% load static %} | ||
{% load static i18n %} | ||
|
||
{% block header %} | ||
{% include "example_app/blocks/header.html" %} | ||
{% endblock header %} | ||
|
||
{% block footer %} | ||
{% include "example_app/blocks/footer.html" %} | ||
{% endblock footer %} | ||
|
||
{% block extra_js %} | ||
<script src="{% static 'js/common.js' %}"> | ||
</script> | ||
{% endblock extra_js %} | ||
|
||
{# djlint:off #} | ||
{% block lang %}{% get_current_language as LANGUAGE_CODE %}{{ LANGUAGE_CODE }}{% endblock lang %} | ||
{# djlint:on #} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters