Atrox / sweetify-django

SweetAlert integration for Django
BSD 3-Clause "New" or "Revised" License
55 stars 21 forks source link

Added multiple alerts compatibility for SweetAlerts2 #10

Closed PauMAVA closed 4 years ago

PauMAVA commented 4 years ago

As discussed in issue #9 , I've implemented a way to issue multiple alerts. To do so, the user must predefine the **kwargs of every alert as a dict and then pass all of those dicts to sweetify.multiple(). Here goes an example:

args1 = dict(title='Test1', icon='info', text="Text placeholder1", button="Next")
args2 = dict(title='Test2', icon='success', text="Text placeholder2", timer=5000, timerProgressBar='true', persistent="Close")
sweetify.multiple(request, args1, args2)

The changes made are the following:

THIS MODIFICATION IS ONLY COMPATIBLE WITH SWEETALERTS2. If the user tries to use multiple alerts with sweetalerts1 then sweetify will not flash any javascript code.

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-4.9%) to 29.204% when pulling f65b177174160479753978cc78c3e005e9d91126 on PauMAVA:master into e785a7fb9fe334cc76b9fa303aa0657f9b60999b on Atrox:master.

Atrox commented 4 years ago

Hey @PauMAVA,

thanks for implementing this. Could you update the README with info and examples how this works?

PauMAVA commented 4 years ago

Hey @PauMAVA,

thanks for implementing this. Could you update the README with info and examples how this works?

Hello @Atrox,

As you requested I've modified the README.md.

Atrox commented 4 years ago

Thank you for the contribution @PauMAVA :)

skatepalli1712 commented 3 years ago

I installed sweetalert version2.0 in Django framework When I try to use sweetify for multiple alerts I get this error "Attribute Error - module 'sweetify' has no attribute 'multiple' " Any help is highly appreciated