addToast.ftl

 1   <#-- Macro: addToast
 2   Description: Adds a Bootstrap toast notification to the page.
 3   Parameters:
 4   - title (string): the title of the notification.
 5   - content (string): the content of the notification.
 6   - type (string, optional): the type of the notification
 7   -->
 8   <#macro addToast title='' content='' titleImg='' titleInfo='' dismiss=true class='' id='' params='' deprecated...>
 9   <@deprecatedWarning args=deprecated />
 10   <div<#if id !=''> id="${id}"</#if> class="toast<#if class !=''> ${class}</#if>" role="alert" aria-live="assertive" aria-atomic="true"<#if params !=''> ${params}"</#if>>
 11     <#if title !=''>
 12       <div class="toast-header">
 13         <#if titleImg !=''><img src="${titleImg}" class="rounded me-2" alt="..."></#if>
 14         <strong class="me-auto">${title}</strong>
 15         <#if titleInfo !=''><small>${titleInfo}</small></#if>
 16         <#if dismiss><button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="#i18n{portal.util.labelClose}"></button></#if>
 17       </div>
 18       <div class="toast-body">
 19         ${content}
 20       </div>
 21     <#else>
 22       <div class="d-flex align-items-center">
 23         <div class="toast-body me-auto">
 24           ${content}
 25         </div>
 26         <#if dismiss><button type="button" class="btn-close me-2" data-bs-dismiss="toast" aria-label="#i18n{portal.util.labelClose}"></button></#if>
 27       </div>
 28     </#if>
 29   </div>
 30   </#macro>