ui_util.py 415 Bytes
Newer Older
Pierre Dittgen's avatar
Pierre Dittgen committed
1
"""Util UI functions."""
2
3
4
5
from flask import flash


def flash_error(msg):
Pierre Dittgen's avatar
Pierre Dittgen committed
6
    """Flash bootstrap error message."""
Pierre Dittgen's avatar
Pierre Dittgen committed
7
    flash(msg, "danger")
8
9
10


def flash_warning(msg):
Pierre Dittgen's avatar
Pierre Dittgen committed
11
    """Flash bootstrap warning message."""
Pierre Dittgen's avatar
Pierre Dittgen committed
12
    flash(msg, "warning")
13
14
15


def flash_success(msg):
Pierre Dittgen's avatar
Pierre Dittgen committed
16
    """Flash bootstrap success message."""
Pierre Dittgen's avatar
Pierre Dittgen committed
17
    flash(msg, "success")
18
19
20


def flash_info(msg):
Pierre Dittgen's avatar
Pierre Dittgen committed
21
    """Flash bootstrap info message."""
Pierre Dittgen's avatar
Pierre Dittgen committed
22
    flash(msg, "info")