Labels
No labels
bug
duplicate
enhancement
help wanted
high priority
invalid
L
low priority
M
medium priority
needs refinement
question
S
UX research
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: local-it/mitgliederverwaltung#138
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/68_log_in_screen"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Seems like the tests need to be updated to work with the new changes :)
The login page looks great now :)
@ -1,7 +1,7 @@/* See the Tailwind configuration guide for advanced usagehttps://tailwindcss.com/docs/configuration */@import "tailwindcss" source(none);I'm trying to understand what this line did before 🤔 Looking at the tailwind docs here it seems like it disabled the scanning for tailwind classes completely? I have no idea why the phoenix generators would enable this by default. Do you know why this was in here?
It came with the Phoenix upgrade to 1.8 but I have not found any information why...
Ah, maybe it's because these lines below:
that explicitly register the sources tailwind should scan. So without this setting, tailwind will scan all files in the repository, I guess? Did the
source(none)cause any problems for you?Yes, the classes were not applied to the ash-authentication part of the loginscreen.
@ -37,6 +37,9 @@ defmodule MvWeb.LiveUserAuth doenddef on_mount(:live_no_user, _params, _session, socket) doGettext.put_locale(MvWeb.Gettext, "de")Is there a way to detect the language of the user automatically? Maybe phoenix has a feature for that. This would make sure that folks who don't speak german will get the english login page. I think it makes sense to display the login page in german as a fallback, if the browser doesn't send a preferred language. Maybe we can open an issue for that? :)
I think adding a language switch to the login screen needs more customization than the overrides AshAuthentication provides. As I think it's not that high priority right now I added another issue, but to not spend time on it right now. Is that fine?
Yes, totally fine!
@ -19,1 +18,3 @@# end# Avoid full-width for the Sign In Formoverride AshAuthentication.Phoenix.Components.SignIn doset :root_class, "min-w-md"It seems like this makes the login form too wide on mobile screens. Maybe it should be
max-w-md?@ -12,6 +12,7 @@ module.exports = {"../lib/mv_web.ex","../lib/mv_web/**/*.*ex"],safelist: ['h-screen', 'px-6', 'h-screen', 'place-items-center', 'px-20', 'px-24'], // Classes that are used by AshAuthentication Sign-In Page are otherwise purgedHmm, in the line above we configure tailwind to check the ash authentication files as well:
it seems like that's not working if we need to add the classes manually to the safelist?
No you are right, that was a leftover, if we set tailwindcss as in the other comment we do not need the safelist
14061401eatoafdb5f0647@ -40,0 +39,4 @@def on_mount(:live_no_user, _params, session, socket) do# Set the locale for not logged in user to set the languagelocale = session["locale"] || "en"Gettext.put_locale(MvWeb.Gettext, locale)Do we also need to set the locale here when the router already does it?
Yes, otherwise the login scren is not translated. At least I found no other way.
Okay, could you add a comment saying that this is the reason? This will make it easier to understand if somebody stumbles upon this in the future :)
@ -20,0 +29,4 @@# Translate the or in the horizontal rule to Germanoverride AshAuthentication.Phoenix.Components.HorizontalRule doset :text,Gettext.with_locale(MvWeb.Gettext, "de", fn ->It seems like this would always make the text on the horizontal rule german, even when the user chooses an english locale 🤔
Yes, I would actually take care of that later because I already spent too much time on it. It should not be complicated but we would need to acces the locale here jut for translating or. I would create another issue for that, is that fine?
Yes, let's do that!
#146
@ -145,1 +151,4 @@end# Get locale from userdefp extract_locale_from_headers(headers) doThis looks excellent, great that you managed to do it in such a simple way :)
afdb5f0647tof0b0de0008