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

User profile page branch #64

Merged
merged 6 commits into from
Feb 17, 2025
Merged

Conversation

dev-par
Copy link
Contributor

@dev-par dev-par commented Feb 16, 2025

Build Out User Profile Page

Summary

This PR implements the user profile page, allowing users to view their personal information and club memberships/roles. Additionally, an edit mode has been added, enabling users to modify their profile details.

Changes Made

Profile Display (Read-Only Mode)

  • Edited profile.html to display user profile information.
  • Displayed personal details from the Profile model, including:
    • Username
    • Email
    • First name
    • Last name
    • Phone number
    • Address
    • City
    • State
    • Zip code
    • Birthday
    • Club memberships & roles
  • Styled the page using user-profile.css for a clean and structured layout.

Edit Mode (Profile Editing)

  • Implemented edit functionality in user-profile.js:
    • Clicking the edit button converts span elements into input fields with placeholders set to existing values.
    • The birthday field is a date input, while all others are text fields.
    • Clicking save updates the displayed data dynamically (persists in the UI until the page is refreshed).

Backend Integration

  • Updated views.py (users.views.user_profile_view()) to serve user data dynamically.
  • If a profile field is uninitialized, "None" is displayed as a placeholder.

File Structure

  • HTML: app/users/templates/users/profile.html
  • Scoped CSS: Created app/users/static/users/user-profile.css
  • Scoped JS: Created app/users/static/users/user-profile.js

Added basic HTML with the needed sections and profile picture.
Passed through dynamic data, corrected all editable fields, added birthday field. When profile variables aren't configured, they display None.
@IkeHunter IkeHunter merged commit 05c4fcb into UF-CSU:main Feb 17, 2025
1 of 2 checks passed
@IkeHunter
Copy link
Collaborator

@dev-par Looks great!

@IkeHunter
Copy link
Collaborator

@dev-par If you want to take up another challenge, try and implement the form without JS by using Django's forms:

The goal would be to update the user's info in the database. Let me know if you want to give it a try.

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.

2 participants