Coder Social home page Coder Social logo

sweetify-django's People

Contributors

atrox avatar dependabot[bot] avatar dlrsp-dev avatar gilsondev avatar lobothijau avatar metarizard avatar ochui avatar paumava avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sweetify-django's Issues

Improvement/Bug in django 4.0

When using django 4.0 you will face an issue with importing force_text from django.utils.encoding, instead you'd want to change that to force_str instead of force_text because django 4.0 no longer supports force_text

it doesn't work

I installed in last version of django "3" and just did what documentation says but still doesn't work

Pop up will show on back click

Hi Atrox, I am experience an issue on a similar view as in the below; where the popup keep showing after the redirection especially when I click on a different url page and use the "back" option in the browser the pop up will show again ! any idea how to fix it or would it be a bug I am not sure. Many Thanks a lot
Jabor


import sweetify

def test_view(request):
    sweetify.success(request, 'Deleted!')
    return redirect('xyz:index')

Sweetify customClass

Hi,

Is there a way to add one time option for customClass{} ?
better not repeating this for every single message.
Thanks in advance.

sweetify.error(
            request, title='Error.', text='Text',
            persistent="Close", customClass={
                'icon': 'dark:color-pink-600',
                'popup': 'dark:bg-slate-900 dark:text-slate-200',

            })

How do I style the alert?

I don't see an option to pass "className" to the alert for buttons or any other part. Is there a way around this by any chance?

Not working in Django

Hi, I followed all the steps to install on Django and I was not successful.

Inside my views.py I inserted :

import sweetify

sweetify.fire('Good job!', 'You clicked the button!', 'success')

No message appears.

The parameter "allowOutsideClick" is incompatible with toasts

It is normal behaviour that I get this JavaScript console warning on every Sweetify toast?

SweetAlert2: The parameter "allowOutsideClick" is incompatible with toasts sweetalert2.all.min.js:5:1392

I don't actually use "allowOutsideClick" anywhere in my code, and when I do try to set it to "false" for my toasts, the issue persists. It's not causing problems, but obviously I'd rather not see warnings.

Sweetify not showing alert message

I tried using the sweetify exactly how it was explained but I don't get any alert.

def post(self, request, *args, **kwargs):
    form = self.get_form()
    if form.is_valid():
        sweetify.success(self.request, 'Successfully applied for this job!')
        return self.form_valid(form)
    else:
        sweetify.error(self.request, 'Your application was unsuccessful. Kindly re-apply with correct details')
        return HttpResponseRedirect(reverse_lazy('job-detail', kwargs={'id': self.kwargs['job_id']}))

No show icon

How do I show the icons of success, error, etc ?

For example :

Swal.fire({
icon: 'error',
title: 'Oops...',
text: 'Something went wrong!',
footer: 'Why do I have this issue?'
})

Sweetalert

As per your instruction, I did all the things but in how to download in vs code I am not understood.
You have to install sweetalert2, the library, itself.
See here: https://sweetalert2.github.io/#download

how to install swwetalert in django . I am using vs code I did pip install --upgrade sweetify.
but how to install the package after this

Return value from alerts.

Is it possible to return the value from the alert ?
For example:
sweetify.warning(request, "Do you wanna delete it?", backdrop="rgba(199, 212, 21, 0.4)",showConfirmButton=True,confirmButtonText="Delete",timer=0)

And I want to get information from the user if he presses the confirm button.
I know sweetaler2 can do this.

'Context' object has no attribute 'request'

Summary

On my Sentry report, I get some issue AttributeError 'Context' object has no attribute 'request'.
After I observed, this error appeared when an error 500 occurred in my application. If there is an error 500 in the application then the context contains None.

Screenshot from 2021-02-16 10-19-16

TODO

  • Maybe you can check if the cointext has a request attribute

Json objects

Hello, I can use json objects to send to message ?

No modal displayed

Hi there,
I followed the exact same steps described here, and I loaded the CDN for sweetalert2 as well, that said, the call to the library seems to function but nothing shows up on the front end, no modal displayed, no message and the page redirects successfully after the call.

Tried to put it on a Try/Catch thinking there might be some silent exception but nothing, the code is clean, but the alert is not working

Any ideas ?

Sweetalert2 versions

Up to what version of sweetalert2 does this support? I know they have completely changed the way it works since this was developed.

Confirm deletion

Is there a way to simulate this functionality ?:

Swal.fire({ title: 'Are you sure?', text: "You won't be able to revert this!", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, delete it!' }).then((result) => { if (result.value) { // Django code Swal.fire( 'Deleted!', 'Your file has been deleted.', 'success' ) } })

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.