-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1647] add configurable warning banner
- Loading branch information
Showing
12 changed files
with
150 additions
and
3 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/open_inwoner/components/templates/components/Header/WarningHeader.html
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,15 @@ | ||
{% load i18n icon_tags link_tags static %} | ||
|
||
<style nonce="{{ request.csp_nonce }}"> | ||
.warning-header { | ||
background-color: {{ warning_banner_background_color }}; | ||
color: {{ warning_banner_font_color }}; | ||
} | ||
</style> | ||
|
||
<div class="warning-header"> | ||
<div class="warning-header__container"> | ||
<span class="warning-header__icon">{% icon icon="error_outlined" icon_position="after" outlined=True %}</span> | ||
<span class="warning-header__text">{{ warning_banner_text }}</span> | ||
</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
53 changes: 53 additions & 0 deletions
53
src/open_inwoner/configurations/migrations/0047_auto_20230809_0833.py
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,53 @@ | ||
# Generated by Django 3.2.15 on 2023-08-09 06:33 | ||
|
||
from django.db import migrations, models | ||
|
||
import colorfield.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("configurations", "0046_siteconfiguration_cookie_consent"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="siteconfiguration", | ||
name="warning_banner_background_color", | ||
field=colorfield.fields.ColorField( | ||
default="#FFDBAD", | ||
help_text="The background color for the warning banner", | ||
max_length=18, | ||
verbose_name="Warning banner background", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="siteconfiguration", | ||
name="warning_banner_enabled", | ||
field=models.BooleanField( | ||
default=False, | ||
help_text="Whether the warning banner should be displayed", | ||
verbose_name="Show warning banner", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="siteconfiguration", | ||
name="warning_banner_font_color", | ||
field=colorfield.fields.ColorField( | ||
default="#000000", | ||
help_text="The font color for the warning banner", | ||
max_length=18, | ||
verbose_name="Warning banner font", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="siteconfiguration", | ||
name="warning_banner_text", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="Text will be displayed on the warning banner", | ||
verbose_name="Warning banner text", | ||
), | ||
), | ||
] |
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
24 changes: 24 additions & 0 deletions
24
src/open_inwoner/scss/components/WarningHeader/WarningHeader.scss
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,24 @@ | ||
.warning-header { | ||
display: flex; | ||
box-sizing: border-box; | ||
padding: var(--spacing-large); | ||
|
||
.warning-header__container { | ||
display: flex; | ||
align-items: center; | ||
padding: 0; | ||
margin: 0 auto; | ||
|
||
@media (min-width: 768px) { | ||
max-width: 90%; | ||
} | ||
|
||
.warning-header__icon, | ||
.warning-header__text { | ||
padding: var(--spacing-small); | ||
} | ||
.warning-header__icon { | ||
width: 20px; | ||
} | ||
} | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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