Skip to content

Commit

Permalink
[#1788] Modify styling for case notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
pi-sigma committed Oct 11, 2023
1 parent f17002b commit e90ccf7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load i18n button_tags icon_tags button_tags icon_tags %}
<div class="notification{% if contents %} notification--contents{% endif %}{% if type %} notification--{{ type }}{% endif %}{% if compact %} notification--compact{% endif %}">
<div class="notification{% if contents %} notification--contents{% endif %}{% if type %} notification--{{ type }}{% endif %}{% if compact %} notification--compact{% endif %} {% if ctx %}notification--{{ ctx }}{% endif %}">
{% if not icon == False %}
<div class="notification__icon">
{% icon icon %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def notification(type, message, **kwargs):
Add a notification to the screen. These will be places inline.
Usage:
{% notification type="success" message="this is the message" closable=True %}
{% notification type="success" message="this is the message" closable=True ctx="cases" %}
{% notification type="warning" title="title" message="this is the message" action="#" action_text="Verzoek opsturen" %}
Variables:
Expand All @@ -43,6 +43,8 @@ def notification(type, message, **kwargs):
- action_text: string | The text of the button.
- closable: bool | If a close button should be shown.
- compact: boolean | Whether to use compact styling or not.
- ctx: string | The context in which the tag is rendered; used to add
classes to HTML element and override CSS
"""
message_types = {
"debug": "bug_report",
Expand Down
25 changes: 20 additions & 5 deletions src/open_inwoner/scss/components/Notification/_Notification.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.notification {
--notification-color-background: var(--color-orange);
--notification-color-text: var(--color-orange-dark);

background-color: var(--notification-color-background);
border-radius: var(--border-radius);
color: var(--notification-color-text);
Expand Down Expand Up @@ -49,10 +49,6 @@
width: 24px;
}

&__content {
width: 100%;
}

&__close {
position: absolute;
top: var(--spacing-small);
Expand All @@ -78,4 +74,23 @@
@media (min-width: 768px) {
margin: var(--spacing-tiny) 0;
}


// Overrides based on context
&--cases {
padding: var(--spacing-small);
margin-bottom: var(--spacing-medium);
align-items: center;

.notification__icon {
display: flex;
padding-left: var(--spacing-medium);
align-items: center;
}

.notification__close {
top: 0;
position: inherit;
}
}
}
4 changes: 2 additions & 2 deletions src/open_inwoner/templates/pages/cases/list_inner.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load link_tags button_tags i18n anchor_menu_tags grid_tags icon_tags list_tags pagination_tags utils %}
{% load link_tags button_tags i18n anchor_menu_tags grid_tags icon_tags list_tags notification_tags pagination_tags utils %}

<div id="cases-list-anchors-oob-desktop" hx-swap-oob="true">
{% anchor_menu anchors desktop=True %}
Expand All @@ -14,7 +14,7 @@ <h2 class="h2" id="cases">{{ page_title }} ({{ paginator.count }})</h2>
<div class="card__body">
<!-- submission cases -->
{% if case.datum_laatste_wijziging %}
<a href="{% url 'cases:case_detail' object_id=case.uuid %}" class="cases__link">
<a href="{{ case.url }}" class="cases__link">
<p class="h4"><span class="link link__text">{{ case.naam }}</span></p>
{% render_list %}
<span class="case-list">
Expand Down

0 comments on commit e90ccf7

Please sign in to comment.