Esempio n. 1
0
def notifications(user):
    notifications = []
    notifications = Notification.get_user_notifications(user.account.id,user.id)
    if user.check_admin():
        notifications.extend(Notification.get_common_notifications(user.account.id))

    notify_text = ''
    for notify in notifications:
        notify_text +='''<div class="alert alert-%s alert-dismissable" id="notification-%s">
            <button aria-hidden="true" data-dismiss="alert" id="%s" class="close close-notification" type="button">x</button>
            %s
        </div>'''%(notify.get_type(),notify.id,notify.id,notify.content)

    return notify_text
Esempio n. 2
0
def notifications(user):
    notifications = []
    notifications = Notification.get_user_notifications(
        user.account.id, user.id)
    if user.check_admin():
        notifications.extend(
            Notification.get_common_notifications(user.account.id))

    notify_text = ''
    for notify in notifications:
        notify_text += '''<div class="alert alert-%s alert-dismissable" id="notification-%s">
            <button aria-hidden="true" data-dismiss="alert" id="%s" class="close close-notification" type="button">x</button>
            %s
        </div>''' % (notify.get_type(), notify.id, notify.id, notify.content)

    return notify_text