-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #238 from wmo-raf/dev
Updates and Bug Fixes
- Loading branch information
Showing
16 changed files
with
969 additions
and
632 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
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,27 @@ | ||
# Generated by Django 4.2.7 on 2024-06-14 10:42 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('wagtailcore', '0089_log_entry_data_json_null_to_object'), | ||
('cap', '0019_alter_capalertpage_options_alter_capalertpage_guid_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='OtherCAPSettings', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('active_alert_style', models.CharField(choices=[('nav_left', 'Left of the Navbar'), ('nav_top', 'Top of the Navbar')], default='nav_left', help_text='Choose the style of active alerts', max_length=50, verbose_name='Active Alert Style')), | ||
('site', models.OneToOneField(editable=False, on_delete=django.db.models.deletion.CASCADE, to='wagtailcore.site')), | ||
], | ||
options={ | ||
'verbose_name': 'Other Settings', | ||
'verbose_name_plural': 'Other Settings', | ||
}, | ||
), | ||
] |
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,109 @@ | ||
{% load static wagtailiconchooser_tags i18n %} | ||
|
||
{% if latest_active_alert %} | ||
<style> | ||
|
||
.banner-alert-container { | ||
width: 100%; | ||
} | ||
|
||
.banner-alert-item { | ||
position: relative; | ||
border-radius: 4px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.banner-alert-item-icon { | ||
margin-right: 10px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.banner-alert-icon-wrapper { | ||
position: relative; | ||
width: 50px; | ||
height: 50px; | ||
border: 3px solid #fff; | ||
padding: 10px; | ||
border-radius: 50%; | ||
overflow: hidden; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
animation: pulse 2s infinite; | ||
} | ||
|
||
@keyframes pulse { | ||
0% { | ||
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2); | ||
} | ||
100% { | ||
box-shadow: 0 0 0 20px rgba(0, 0, 0, 0); | ||
} | ||
} | ||
|
||
.banner-alert-icon-wrapper svg { | ||
height: 80%; | ||
width: 80%; | ||
fill: currentColor; | ||
} | ||
|
||
.banner-alert-item-title { | ||
font-size: 13px; | ||
font-weight: 700; | ||
} | ||
|
||
.banner-alert-event { | ||
font-size: 12px; | ||
font-weight: 600; | ||
} | ||
|
||
.banner-alert-severity-label { | ||
font-size: 11px; | ||
} | ||
|
||
/*768px and lower*/ | ||
@media screen and (max-width: 1023px) { | ||
.banner-alert-container { | ||
background-color: #f3f5fa; | ||
padding: 4px 0; | ||
} | ||
} | ||
|
||
@media only screen and (min-width: 1024px) and (max-width: 1150px) { | ||
.banner-alert-item-info { | ||
display: none; | ||
} | ||
} | ||
</style> | ||
|
||
<div class="banner-alert-container" data-alert-style="{{ alert_style }}"> | ||
<a href="{{ latest_active_alert.url }}"> | ||
<div class="banner-alert-item"> | ||
<div class="banner-alert-item-icon"> | ||
<div class="banner-alert-icon-wrapper" | ||
style="background-color: {{ latest_active_alert.severity.color }}; border-color: {{ latest_active_alert.severity.border_color }}; | ||
{% if latest_active_alert.severity.icon_color %}color:{{ latest_active_alert.severity.icon_color }};{% endif %} "> | ||
{% if latest_active_alert.event_icon %} | ||
{% svg_icon name=latest_active_alert.event_icon %} | ||
{% endif %} | ||
</div> | ||
</div> | ||
<div class="banner-alert-item-info"> | ||
<div class="banner-alert-item-title"> | ||
{% translate "Alert" %} | ||
</div> | ||
<div class="banner-alert-event"> | ||
{{ latest_active_alert.event|truncatechars:20 }} | ||
</div> | ||
<div class="banner-alert-severity-label"> | ||
{{ latest_active_alert.severity.label }} | ||
</div> | ||
</div> | ||
</div> | ||
</a> | ||
</div> | ||
{% endif %} |
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,82 @@ | ||
{% load static wagtailiconchooser_tags i18n %} | ||
|
||
<style> | ||
|
||
.top-alert-wrapper { | ||
height: 60px; | ||
background-color: #f8f9fb; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.top-alert-wrapper .top-alert-container { | ||
display: flex; | ||
align-items: center; | ||
width: 100%; | ||
} | ||
|
||
.top-alert-wrapper .alert-icon-wrapper { | ||
position: relative; | ||
width: 50px; | ||
height: 50px; | ||
border: 3px solid #fff; | ||
padding: 10px; | ||
border-radius: 50%; | ||
overflow: hidden; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
animation: pulse 2s infinite; | ||
} | ||
|
||
.top-alert-wrapper .alert-icon svg { | ||
height: 80%; | ||
width: 80%; | ||
} | ||
|
||
.top-alert-wrapper .alert-title { | ||
margin-left: 10px; | ||
} | ||
|
||
.top-alert-wrapper .alert-warning { | ||
font-weight: 600; | ||
} | ||
|
||
@keyframes pulse { | ||
0% { | ||
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2); | ||
} | ||
100% { | ||
box-shadow: 0 0 0 20px rgba(0, 0, 0, 0); | ||
} | ||
} | ||
|
||
|
||
</style> | ||
|
||
<div class="top-alert-wrapper" data-alert-style="{{ alert_style }}"> | ||
<div class="container top-alert-container"> | ||
<div class="alert-icon-wrapper" | ||
style="background-color: {{ latest_active_alert.severity.color }}; border-color: {{ latest_active_alert.severity.border_color }}; | ||
{% if latest_active_alert.severity.icon_color %}color:{{ latest_active_alert.severity.icon_color }};{% endif %} "> | ||
{% if latest_active_alert.event_icon %} | ||
{% svg_icon name=latest_active_alert.event_icon %} | ||
{% endif %} | ||
</div> | ||
<div class="alert-title"> | ||
<div class="alert-warning"> | ||
{% translate "Alert" %} | ||
</div> | ||
<a href="{{ latest_active_alert.url }}"> | ||
{% if latest_active_alert.properties.headline %} | ||
{{ latest_active_alert.properties.headline }} | ||
{% else %} | ||
{{ latest_active_alert.title }} | ||
{% endif %} | ||
</a> | ||
</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
Oops, something went wrong.