Skip to content

Add UI enhancements: icons, favicon, profile page, clear filters#28

Open
quevon24 wants to merge 11 commits intomainfrom
feat/ui-enhancements
Open

Add UI enhancements: icons, favicon, profile page, clear filters#28
quevon24 wants to merge 11 commits intomainfrom
feat/ui-enhancements

Conversation

@quevon24
Copy link
Copy Markdown
Member

@quevon24 quevon24 commented Mar 11, 2026

Summary

  • Add book favicon with multiple sizes
  • Add Font Awesome 6 Free (built via npm, same pattern as Tailwind)
  • Add icons throughout the UI: header nav, buttons, filter controls
  • Header redesign: favicon logo, icons on nav links, user dropdown menu (profile + sign out)
  • Add "Clear filters" button on scan and opinion list views
  • Add user profile page (/profile/) with first name, last name, email editing
  • Add password change page (/profile/password/) using Django's PasswordChangeForm
  • Show review form to all authenticated users (not just staff)
  • Fix btn-primary hover contrast on anchor tags

Paired with @quevon24 and Claude Code

quevon24 and others added 9 commits March 10, 2026 20:13
CSS and webfont files downloaded from cdnjs, served locally
via static-global. Paths use ../fonts/ relative references.
SVG open-book icon with purple background, PNG variants at
multiple sizes, and ICO. Added FA CSS + favicon link tags
to base.html head.
- Favicon SVG as logo next to site name
- FA icons on all nav links (upload, book scans, opinions)
- User dropdown with profile link and sign out
- Click-outside handler to close dropdown
- Add gap-1.5 to .btn base class for icon-text spacing
- Add hover:text-white to .btn-primary for <a> tag usage
- Add icons to Cancel, Upload, Save, Submit Review, Edit in admin buttons
- Add filter/clear buttons on a separate row below filter inputs
- Add FA icons on Upload, Filter, and Clear buttons
- Clear filters button always visible
- ProfileForm (first_name, last_name, email)
- profile and password_change views with templates
- URL routes at /profile/ and /profile/password/
Remove is_staff gate from scan_detail and opinion_detail views
so all logged-in users can submit reviews.
- TestProfile: login required, GET renders, POST updates fields
- TestPasswordChange: login required, GET renders, valid/invalid POST
- Update review form tests to expect form for non-staff users
@quevon24 quevon24 marked this pull request as ready for review March 11, 2026 15:54
@quevon24 quevon24 requested a review from grossir March 11, 2026 15:54
@quevon24 quevon24 moved this to PRs to Review in Sprint (Case Law) Mar 11, 2026
Copy link
Copy Markdown
Contributor

@grossir grossir left a comment

Choose a reason for hiding this comment

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

one important comment on who can POST a ScanReview

opinion_count = scan.opinions.count()

review_form = None
if request.user.is_staff and scan.status != Status.APPROVED:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dropping the is_staff check means any logged in user can perform ("POST") a scan review.

I think you should move that condition here:

    if request.method == "POST" and request_user.is_staff:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In this case, I removed is_staff because I believe the idea is for them to do everything from the frontend without needing to add permissions or having to go directly to the admin. Now, if we want to use the is_staff flag, give admin access, and have more granular control over actions, we could use is_staff but also create groups with a set of permissions.

For the moment i can remove the profile changes to get this up and running.

What do you think about this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@quevon24

I agree they should do everything on the frontend

The problem is the current code is allowing anyone that can log in, includding the scanners, to review a scan. Meaning, they could approve their own scans?

That's why I was suggestion to add this if request.method == "POST" and request_user.is_staff. So, only is_staff users can "POST" a review

if it is a "GET", to look at a review, anyone can do it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That is a good question, I would hope that the person who did the scan would be responsible for reviewing it, but I think it is better to ask, for now we can leave it as you mentioned so that only those who have the is_staff can do it, initially they would not have that flag so they cannot see the admin.

@grossir grossir moved this from PRs to Review to PRs to improve in Sprint (Case Law) Mar 11, 2026
@grossir grossir assigned quevon24 and unassigned grossir Mar 11, 2026
- Add @fortawesome/fontawesome-free as npm devDependency
- Add build:fa scripts to copy CSS and webfonts from node_modules
- Update all icon classes from `fa` to `fa-solid` prefix
- Rename deprecated icons (file-text, cog, sign-out, times, search)
- Delete vendored FA 4 CSS and font files
- Gitignore generated FA assets (same pattern as Tailwind)
@quevon24 quevon24 requested a review from grossir March 11, 2026 23:46
@quevon24 quevon24 moved this from PRs to improve to Waiting on Feedback in Sprint (Case Law) Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting on Feedback

Development

Successfully merging this pull request may close these issues.

2 participants