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

Create user profile template #914

Closed
Tracked by #889
brylie opened this issue Jun 10, 2021 · 14 comments · Fixed by #1005
Closed
Tracked by #889

Create user profile template #914

brylie opened this issue Jun 10, 2021 · 14 comments · Fixed by #1005

Comments

@brylie
Copy link
Member

brylie commented Jun 10, 2021

When migrating the old frontend templates to Django, we noticed the user profile was not rendering any content. Rather than weed through the proclaimed "horrendous code" that was responsible for rendering the BackBone view, let's just write a simple user profile template from scratch.

// And hereon commences a pile of horrendous code. Beware!
// TODO: review rewrite refactor. (please)

Task

  • determine what fields are available on the user profile
  • sketch a basic user profile page using pencil and paper or a drawing app
  • discuss the proposed sketch
  • implement the sketch using conventional Django elements like Form and class-based views
@devRawnie
Copy link

Here, I couldn't find any fields specified in the User model. Is there some other model, defined elsewhere?

@brylie
Copy link
Member Author

brylie commented Jun 13, 2021

We have an Account model that is basically the equivalent of a user profile:

class Account(models.Model):

I propose we

  1. move the Account model source code into the accounts app
  2. rename the Account model to Profile
  3. create a FormView for the Profile model with route
  4. change front-end links to use the new 'ProfileForm` view/route

@brylie
Copy link
Member Author

brylie commented Jun 14, 2021

I opened an issue to move all accounts related code to the accounts app and rename the Account model to Profile: #926

@brylie
Copy link
Member Author

brylie commented Jun 14, 2021

This task can focus on rendering the profile edit form and should be considered a child task of #926

@wassafshahzad
Copy link
Contributor

@brylie I worked on settings forms issue and this looks similar to that so could you assign it to me?
secondly should we also have a PR template ? I can create one if you could create a ticket for it an assign it to me

@brylie
Copy link
Member Author

brylie commented Aug 17, 2021

@wassafshahzad thanks for the help :-) I've assigned you to the issue.

@wassafshahzad
Copy link
Contributor

@wassafshahzad thanks for the help :-) I've assigned you to the issue.

No problem always happy to help

@wassafshahzad
Copy link
Contributor

@brylie would you kindly explain how will this be different from the settings form?
I could make it so that this form is readonly and clicking an edit button will redirect you to settings form.

@brylie
Copy link
Member Author

brylie commented Aug 20, 2021

@wassafshahzad good point. Let's perhaps deprecate the "user profile" form/template in favor of the settings page. I.e. just link directly to the settings page and remove any code/mention of "profile" perhaps?

@wassafshahzad
Copy link
Contributor

wassafshahzad commented Aug 27, 2021

So should i change the link from profileView to settingView ?
if possible could you explain your idea ?
Thank you

@brylie
Copy link
Member Author

brylie commented Aug 30, 2021

@wassafshahzad yes. Linking to settingView is fine for now.

@wassafshahzad
Copy link
Contributor

Put up Pr for this issue.

@brylie
Copy link
Member Author

brylie commented Sep 13, 2021

Looks good. We'll merge the PR once the review comments are resolved 😃

@wassafshahzad
Copy link
Contributor

Sorry I didn't add the tests yet.
Are there any more issues of priority?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants