Closed Domejko closed 1 month ago
This doesn't seem to be working. Did it work for you?
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
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.
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
@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:
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
I have utilized available classes to sync color, font theme and size. Only .popup
class left since Tailwind don't provide popup class.
Preview:
needs to have ran py manage.py lint
Description
Regarding #376
action="{% url 'auth:login manual' %}"
to html form so that when JS is disabled code will default toaction
instead of usinghx
.Checklist
What type of PR is this?
Added/updated tests?
Related PRs, Issues etc