TreyWW / MyFinances

MyFinances is a web application that can help you as an individual, or team, manage your finances!
https://docs.myfinances.cloud
GNU Affero General Public License v3.0
85 stars 121 forks source link

Added action to allow POST without JS #385

Closed Domejko closed 1 month ago

Domejko commented 1 month ago

Description

Regarding #376

Checklist

What type of PR is this?

Added/updated tests?

Related PRs, Issues etc

TreyWW commented 1 month ago

This doesn't seem to be working. Did it work for you?

TreyWW commented 1 month ago

Ah; as we redirect when the user doesn't use HTMX this doesn't make sense to implement.

    if not request.htmx:
        return redirect("auth:login")

As the user is just stuck with an infinite loop

Domejko commented 1 month ago

Yes, I just made it work in shape and form as it is now without errors.

Basically it comes down now to what's is the desired functionality ? Because if website is supposed to be fully functional without JS then we would need to refactor most of html files since many of them use hx-*, and some backend files also got checks for request.htmx. Without it many functions will just not work and I think that it would be a bad idea to give users access to half baked website. If not then I would keep if not request.htmx: and additionally inform user that he have JS disabled and since this website use JS ask him to enable it. I assume that cases when someone try to use internet without JS are very extreme this days.

TreyWW commented 1 month ago

Yeah I agree with that. It's probably easier to just stick with the idea of users have to have JS enabled, otherwise like you say the whole site wont work. Every page (pretty much) has some reliability on HTMX, and I'd rather not have to make all of it work without it. Maybe a popup saying you need JS could be a good option - that way this bug wont ever occur. We could just add a message before we redirect them to help a little too

Domejko commented 1 month ago

@TreyWW I have added a popup with short info to enable JS and hyperlink to instructions how to do it on different browsers. It activates only when JS is disabled and someone enters login page. I didn't add possibility to close window since website either way wont be functional without JS.

Preview: Screenshot from 2024-05-27 16-18-13

TreyWW commented 1 month ago

Nice, I'd rather we use DaisyUI and tailwind though please. Since they have built in components that will do this and will keep the colour theme synced and styling consistent

Domejko commented 1 month ago

I have utilized available classes to sync color, font theme and size. Only .popup class left since Tailwind don't provide popup class.

Preview: Screenshot from 2024-05-27 17-16-32

TreyWW commented 1 month ago

needs to have ran py manage.py lint