-
Notifications
You must be signed in to change notification settings - Fork 5
Notifications
Notifications displayed to users are implemented in components.makahiki_notifications.models.UserNotification
. Each notification has a level that is borrowed directly from Django's messages framework. The UserNotification model has a few static methods for creating user notifications:
- UserNotification.create_info_notification(recipient, contents, display_alert=False)
- UserNotification.create_success_notification(recipient, contents, display_alert=False)
- UserNotification.create_warning_notification(recipient, contents, display_alert=True)
- UserNotification.create_error_notification(recipient, contents, display_alert=True)
Each of these methods creates a notification of the corresponding level. recipient
is the recipient of the notification and contents is the text of the notification. display_alert
will display an alert the next time the user makes a page request in the system. Success notifications are the only notifications that are "share-able" on Facebook.
In the interface, info and success notifications are both displayed using jQuery UI's ui-state-highlight
class while warnings and errors are displayed using ui-state-error
.