Skip to content

Commit

Permalink
[TASK] Make Frontend FlashMessages compatible with v12 (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminkott authored May 26, 2023
1 parent d8ef266 commit e2bb2aa
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions Resources/Private/Partials/General/FlashMessages.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
<f:flashMessages as="flashMessages">
<f:for each="{flashMessages}" as="flashMessage">
<f:switch expression="{flashMessage.severity}">
<f:case value="-1"><f:variable name="class" value="info" /></f:case>
<f:case value="0"><f:variable name="class" value="success" /></f:case>
<f:case value="1"><f:variable name="class" value="warning" /></f:case>
<f:case value="2"><f:variable name="class" value="danger" /></f:case>
<f:defaultCase><f:variable name="class" value="notice" /></f:defaultCase>
</f:switch>
<f:if condition="{flashMessage.severity.cssClass}">
<f:then>
<f:variable name="class" value="{flashMessage.severity.cssClass}" />
</f:then>
<f:else>
<f:switch expression="{flashMessage.severity}">
<f:case value="-1"><f:variable name="class" value="info" /></f:case>
<f:case value="0"><f:variable name="class" value="success" /></f:case>
<f:case value="1"><f:variable name="class" value="warning" /></f:case>
<f:case value="2"><f:variable name="class" value="danger" /></f:case>
<f:defaultCase><f:variable name="class" value="notice" /></f:defaultCase>
</f:switch>
</f:else>
</f:if>
<div class="alert alert-{class}" role="alert">
<div class="alert__title">{flashMessage.title}</div>
<div class="alert__message">{flashMessage.message}</div>
Expand Down

0 comments on commit e2bb2aa

Please sign in to comment.