Closed PauMAVA closed 4 years ago
Hey @PauMAVA,
thanks for implementing this. Could you update the README with info and examples how this works?
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.
Thank you for the contribution @PauMAVA :)
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
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:
The changes made are the following:
multiple(request, *args)
onsweetify/sweetify.py
sweetalert(request, title,**kwargs)
intosweetalert(request, title,**kwargs)
and_treat_data(opts)
so that part of the code present in sweetalert function can be used by both sweetalert and multiple function. (sweetify/sweetify.py
)_flash_multiple_configs(request, jsonData)
to flash multiple configs correctly when using the multiple function.concatenate(list)
onsweetify/templatetags/sweetify.py
. This function parses the multiple alerts config and converts it to the corresponding javacript code.sweetify(context)
to adapt to the changes.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.