Skip to content

Commit 4fdb9b5

Browse files
authored
Merge pull request #6732 from akatsoulas/flickering-banner
Do not render an empty banner
2 parents 84d1bad + 72bcd72 commit 4fdb9b5

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

kitsune/sumo/jinja2/includes/common_macros.html

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -894,14 +894,17 @@ <h4 class="mzp-c-menu-item-title">{{ _('Inbox') }}</h4>
894894
{% endcall %}
895895
#}
896896
{% macro announcement_bar(id, level, close_memory="", close_type="") -%}
897-
<div id="announce-{{ id }}" class="mzp-c-notification-bar mzp-t-{{ level }}"
898-
{% if close_memory %}data-close-initial="hidden"{% endif %}>
899-
<button class="mzp-c-notification-bar-button close-button" data-close-id="announce-{{ id }}" type="button"
900-
{% if close_memory %}data-close-memory="{{ close_memory }}" {% endif %}
901-
{% if close_type %}data-close-type="{{ close_type }}" {% endif %}>
902-
</button>
903-
<p>{{ caller() }}</p>
904-
</div>
897+
{% set content = caller() %}
898+
{% if content %}
899+
<div id="announce-{{ id }}" class="mzp-c-notification-bar mzp-t-{{ level }}"
900+
{% if close_memory %}data-close-initial="hidden"{% endif %}>
901+
<button class="mzp-c-notification-bar-button close-button" data-close-id="announce-{{ id }}" type="button"
902+
{% if close_memory %}data-close-memory="{{ close_memory }}" {% endif %}
903+
{% if close_type %}data-close-type="{{ close_type }}" {% endif %}>
904+
</button>
905+
<p>{{ content }}</p>
906+
</div>
907+
{% endif %}
905908
{% endmacro %}
906909

907910
{% macro favicon() %}

0 commit comments

Comments
 (0)