{#/********************************************************************************* * This file is part of Myddleware. * @package Myddleware * @copyright Copyright (C) 2013 - 2015 Stéphane Faure - CRMconsult EURL * @copyright Copyright (C) 2015 - 2016 Stéphane Faure - Myddleware ltd - contact@myddleware.com * @link http://www.myddleware.com This file is part of Myddleware. Myddleware is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Myddleware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Myddleware. If not, see . *********************************************************************************/ #} {% set prefix = filter_prefix|default(null) %} {% set map = { 'success':'success', 'notice':'info', 'info':'info', 'warning':'warning', 'error':'danger', 'danger':'danger' } %} {% for type, messages in app.flashes %} {% set parts = type|split('.') %} {% set level = parts|last %} {% set variant = map[level]|default(map[type]|default('info')) %} {% if prefix is null or (type starts with prefix) %} {% for message in messages %} {% endfor %} {% endif %} {% endfor %}