Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dcod-opensource/django-messages-to-bootstrap-notify
Show django messages using bootstrap-notify
https://github.com/dcod-opensource/django-messages-to-bootstrap-notify
bootstrap-notify django messages
Last synced: about 2 months ago
JSON representation
Show django messages using bootstrap-notify
- Host: GitHub
- URL: https://github.com/dcod-opensource/django-messages-to-bootstrap-notify
- Owner: DCOD-OpenSource
- License: mit
- Created: 2017-05-16T11:08:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-07T20:27:32.000Z (about 7 years ago)
- Last Synced: 2024-04-26T19:22:31.876Z (9 months ago)
- Topics: bootstrap-notify, django, messages
- Language: Python
- Size: 1010 KB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: MIT-LICENSE
Awesome Lists containing this project
README
.. django-messages-to-bootstrap-notify
.. README.rstA django-messages-to-bootstrap-notify documentation
===================================================*django-messages-to-bootstrap-notify is a django reusable application to show django messages using bootstrap-notify*
.. contents::
Installation
------------
* Obtain your copy of source code from the git repository: ``git clone https://github.com/DCOD-OpenSource/django-messages-to-bootstrap-notify.git``. Or download the latest release from https://github.com/DCOD-OpenSource/django-messages-to-bootstrap-notify/tags/.
* Run ``python ./setup.py install`` from the repository source tree or the unpacked archive. Or use pip: ``pip install django-messages-to-bootstrap-notify``.Configuration
-------------
Enable and configure `Django Messages Framework `_.Add ``"dm2bn"`` to ``settings.INSTALLED_APPS``.
.. code-block:: python
INSTALLED_APPS += (
"dm2bn",
)Load ``"dm2bn_tags"`` to your base template, load vendor static by including ``dm2bn/includes/dm2bn_static.html`` template, place bootstrap-notify settings in template by calling ``{% dm2bn_settings %}`` and call ``showMessages`` function.
For example:
.. code-block:: django
{% load dm2bn_tags %}
{% include "dm2bn/includes/dm2bn_static.html" %}
{% dm2bn_settings %}
$(function () {
// show messages
$.showMessages({{ messages|messages2json }});
});
If you already use some part of vendor static, manual add missing requirements to you template.
Requirements:
- `jquery `_
- `bootstrap `_
- `Font Awesome `_
- `bootstrap-notify `_
- `striptags.js `_
- `bootstrap-notify-simple-wrapper `_Attention
---------
For pretty looking error messages add ``"danger"`` to ``extra_tags`` in ``messages.error`` calls.For example:
.. code-block:: python
messages.error(request, "Something happened wrong :(", "danger")
Settings
--------
``DM2BN_MESSAGES_CUMULATIVE_DELAY``
Use cumulative delay to showing a message. Defaults to: ``True``.``DM2BN_MESSAGE_DELAY``
A message showing delay (in seconds). Defaults to: ``3``.``DM2BN_MESSAGE_DELAY_FACTOR``
A message showing delay factor (in chars per second). Defaults to: ``8``.``DM2BN_MESSAGE_ICON``
Message icon css classes. Defaults to: ``"fa fa-exclamation-circle"``.``DM2BN_MESSAGE_DEFAULT_SETTING``
A message showing default settings. See `documentation `_. Defaults to:.. code-block:: python
{
"allow_dismiss": True,
"placement": {
"from": "top",
"align": "right",
},
"delay": 3,
"mouse_over": "pause",
}Licensing
---------
django-messages-to-bootstrap-notify uses the MIT license. Please check the MIT-LICENSE file for more details.django-messages-to-bootstrap-notify includes several third party libraries which come under their respective licenses. See their licensing information in the ``dm2bn/static/dm2rbn/vendor/`` directory.
Contacts
--------
**Project Website**: https://github.com/DCOD-OpenSource/django-messages-to-bootstrap-notify/**Author**: Alexei Andrushievich
For other authors list see AUTHORS file.