Objective:
Make the default profile picture with the user's first letter of their username.
Task Description:
There is an empty circle symbol on the home page, we want to make a default profile picture as soon as you sign up for the page and log into it. By automatically create a simple background with the color green and include right in the middle the usernames first letter.
Implementation:
To achieve the goal of creating a default profile picture that includes the user's first letter of their username, modified the files index.js and Home.ejs.
In index.js, ensured that when a user logs in, the session variables are updated to include the first letter of the username in uppercase (request.session.usernameFirstLetter = request.body.username[0].toUpperCase()), along with other necessary user information.
When rendering the home page (/ route), the code will check whether the user is logged in. If so, it will render the home page with the user's profile picture, their first letter of the username, and other session data such as whether the user is a faculty member or involved in foster care.
By integrating these changes in the code, we ensure that users who do not have a profile picture set will be provided with a default one based on their username.
We will edit the index.js, the home.ejs and the users.js
Testing and Debugging:
We can test this by creating a new user and seeing if the user's first letter of the username is displayed as the picture
Deadline:
April 23, 2024
Objective: Make the default profile picture with the user's first letter of their username. Task Description: There is an empty circle symbol on the home page, we want to make a default profile picture as soon as you sign up for the page and log into it. By automatically create a simple background with the color green and include right in the middle the usernames first letter.
Implementation:
To achieve the goal of creating a default profile picture that includes the user's first letter of their username, modified the files
index.js
andHome.ejs
.In
index.js
, ensured that when a user logs in, the session variables are updated to include the first letter of the username in uppercase (request.session.usernameFirstLetter = request.body.username[0].toUpperCase()
), along with other necessary user information.When rendering the home page (
/
route), the code will check whether the user is logged in. If so, it will render the home page with the user's profile picture, their first letter of the username, and other session data such as whether the user is a faculty member or involved in foster care.By integrating these changes in the code, we ensure that users who do not have a profile picture set will be provided with a default one based on their username.
We will edit the index.js, the home.ejs and the users.js
Testing and Debugging: We can test this by creating a new user and seeing if the user's first letter of the username is displayed as the picture Deadline: April 23, 2024