Skip to main content

Elegant, responsive, flexible, and lightweight notification plugin.

Project description

IziToast

izitoast is an Elegant, responsive, flexible, and lightweight notification plugin with no dependencies.

Installation

Use the package manager pip to install izitoast.

Usage

Add 'izitoast' to your INSTALLED_APPS setting like this:

INSTALLED_APPS = [
     '...',
    'izitoast',
]

inside base template file at last position include a single line of code

...

{% include 'includes/izitoast.html' %}

...

Working

from izitoast.functions import izitoast

def func(request):
    ...
    message = {
        'raw': [
            {
                'tag': 'success',
                'item': "Success message"
            },
            {
                'tag': 'info',
                'item': "Information message!"
            },
            {
                'tag': 'warning',
                'item': "Warning message!"
            },
            {
                'tag': 'danger',
                'item': "Error message!"
            } 
        ],
        "position": "topRight",
        "transition_in": "flipInX",
        "transition_out": "flipOutX",
        "time_out": 9000,
    }

    izitoast(request=request, model="success", message=message)

    return render(request, 'template.html')

generate form.errors

from izitoast.functions import izitoast

def func(request):
    ...
    

    izitoast(request=request, model="danger", message=form.errors)

    return render(request, 'template.html')

Optionals

  1. position:

Default izitoast shown place "topRight",

It can be: [bottomRight, bottomLeft, topRight, topLeft, topCenter, bottomCenter, center]

  1. transition_in:

Default izitoast open animation. "flipInX",

It can be: [bounceInLeft, bounceInRight, bounceInUp, bounceInDown, fadeIn, fadeInDown, fadeInUp, fadeInLeft, fadeInRight, flipInX]

  1. transition_out: Default izitoast close animation. "flipOutX",

It can be: [fadeOut, fadeOutUp, fadeOutDown, fadeOutLeft, fadeOutRight, flipOutX]

  1. time_out: the default value is 3000.

Dependencies

It uses https://izitoast.marcelodolza.com/ izitoast v1.4.0 scripts and styles.

For message transferring uses messages

from django.contrib import messages

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

izitoast-0.0.4.tar.gz (56.0 kB view details)

Uploaded Source

Built Distribution

izitoast-0.0.4-py3-none-any.whl (57.3 kB view details)

Uploaded Python 3

File details

Details for the file izitoast-0.0.4.tar.gz.

File metadata

  • Download URL: izitoast-0.0.4.tar.gz
  • Upload date:
  • Size: 56.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.0

File hashes

Hashes for izitoast-0.0.4.tar.gz
Algorithm Hash digest
SHA256 db6c584a8c40a1a81198f0dbcf541774f8e0cfebc95a7c0ec881bad19fa5ed5a
MD5 4a912d6572fa3a3b9b8565bee791b515
BLAKE2b-256 0c73b078f35111eff9b64c02a31252ff6dae6463c90cb789fea8ba7dbe8d2678

See more details on using hashes here.

File details

Details for the file izitoast-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: izitoast-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 57.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.0

File hashes

Hashes for izitoast-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 628b5918a3b6f5e93d4d3771a89e1ec27694b37f283e73a55729261f6aa6fc70
MD5 8e6a07ffbe28631da61f820719b56689
BLAKE2b-256 086e6ca6cbfd0e65501a19c4e075f06d6ef7e99a51b882db3bfadc0550fe377f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page