Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a simple user settings page #190

Merged
merged 5 commits into from
Oct 29, 2024
Merged

Implement a simple user settings page #190

merged 5 commits into from
Oct 29, 2024

Conversation

lunkwill42
Copy link
Member

Butt-ugly first draft of a user settings page, more or less based on the current user drop-down menu.

I'm going to need some styling help here, because Tailwind is just confusing and downright counter-intuitive to an old-timer like me ;)

Closes #170

@lunkwill42 lunkwill42 self-assigned this Oct 21, 2024
Copy link
Contributor

@podliashanyk podliashanyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start! See suggestions below.


{% block main %}
<section id="user-settings">
<h2>{{ page_title }}</h2>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a <h1> and moved out of the <section>. It would also be nice to add sr-only class to the h1 tag.

Suggested change
<h2>{{ page_title }}</h2>
<h1>{{ page_title }}</h1>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we not supposed to signal somehow to non-screenreading users that they are on the user settings page, @podliashanyk ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added 95df103 to resolve most of your comments, but it also adds a card title that reads "User settings" - but I don't think this is a good solution either, especially if we may resort to adding multiple cards for settings groups.

Again, we should resolve how to signal to an able-eyed user which page they are currently on, without forcing them to rely on reading the URL in the address bar - but it doesn't seem the current incarnation of argus-htmx has any kind of page heading system (maybe because we've only been focused on implementing the incidents list thus far).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Page heading system is a good idea.
We could use breadcrumbs. Or we could configure the typography plugin in our project so that making <h1> visible will apply proper styling to it. I prefer the latter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have added typography plugin in a separate PR #202

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a fan of breadcrumbs myself. And "prose" will not work with cards and forms inside, will it?

Copy link
Contributor

@podliashanyk podliashanyk Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prose wouldn't be an issue for any standard card or form, however for daisyUI's menu, table, link etc it will break the styles.
Edit: prose sets max width to 65ch so I would consider this as annoying default for card and forms as well as other components

src/argus_htmx/templates/htmx/user/settings.html Outdated Show resolved Hide resolved
src/argus_htmx/templates/htmx/user/settings.html Outdated Show resolved Hide resolved
src/argus_htmx/templates/htmx/user/settings.html Outdated Show resolved Hide resolved
@podliashanyk
Copy link
Contributor

We could also consider dividing settings into categories and adding for example a drawer to the layout.
And user settings page will likely need its own (non-dropdown) templates for theme- and datetime-selectors instead of reusing the existing *_dropdown.html. But it can be fixed later, preferably after we have more user settings to play with

Copy link
Collaborator

@hmpf hmpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge this as is and work on polish later.

@lunkwill42
Copy link
Member Author

Let's merge this as is and work on polish later.

Agreed, though the introduction of djLint on main didn't make that easier :P

@lunkwill42
Copy link
Member Author

I rebased this on the latest main, tried to fix my changes to be compliant with the new formatting/linting rules introduced, but it seems the linter workflow is still mad about lots of HTML that I did not introduce in this PR...

This copies the current user settings menu from the user dropdown to
the new user settings page, but leaves out the logout link and styling.

Further styling work is needed.
As per review suggestions.
The main branch introduced djLint formatting rules after this feature
branch was created.  This reformats the compounded HTML introduced in
this branch to comply with the new rules.
@lunkwill42
Copy link
Member Author

Master has reportedly been fixed, rebased and force-pushed this.

@lunkwill42 lunkwill42 marked this pull request as ready for review October 29, 2024 09:30
@lunkwill42 lunkwill42 merged commit 224607d into main Oct 29, 2024
4 checks passed
@lunkwill42 lunkwill42 deleted the feature/user-page branch October 29, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make user-page (with all permanently set settings, to give an overview!)
3 participants