Guest User

Untitled

a guest
Jan 17th, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. ## WorkPlan 1/8/18
  2.  
  3. ### Week's Goal
  4. This weeks focus will be pushing code for the ROAM module. Complete the end of Sprint 1.
  5.  
  6. ### Specifications
  7.  
  8. __See a link to "Log Out" if they're logged in in the site-wide header.__
  9. __Implementation__:
  10. - [ ] If the session_user_id exists, then `<button class="logout-button">` will be`.logout-button{display:inline;}`
  11. - [ ] If the session_user_id does NOT exist, then, `<button class="logout-button"> ` will be `.logout-button{display:none;}`
  12.  
  13. __Update their profile by making changes to their name and/or current city.__
  14. __Implementation__:
  15. - [ ] Edit buttons will be wrapped in `<form action="/profile" method="POST">` tags that will call the routes
  16. - [ ] In the routes, `router.put('/profile', (req, res) ...`, a database function,
  17. `user.updateProfile(user_session_id, original_input_value, new_input_value)` will be called that will execute the SQL query:
  18. ` UPDATE table_name
  19. SET column1 = value1, column2 = value2, ...
  20. WHERE condition;`
  21. - [ ] If the session_user_id exists, on the profile.ejs, `<p>First Name</p>`, `<p>Last Name</p>`, `<p>Email</p>`,
  22. `<p>City</p>`, will each have a`<button class="edit-button">Edit</button>` that will `.edit-button {display: inline;}`, else, `{display: none}`
  23. - [ ] The `profile` object that populates the profile.ejs page with user information will be updated with the newest props and passed to the render method
  24.  
  25. __See the titles of all the posts they've contributed (start with pre-seeded data)__
  26. __Implementation__:
  27. - [x] Loop through the array of objects, pushing the post titles into the array property on the profiles object, `profiles.titles`,
  28. - [x] The `profile` object will be sent with the render method to `profiles.ejs`
  29. _NOTE: Currently rendering SOME user information from the database on profiles.ejs. The titles are all that need to be rendered and I am getting those back in my console.log of the result of my promise._
  30.  
  31. __Click on the title of one of their posts and be redirected to a "show" page for that post.__
  32. __Implementation__:
  33. - [ ] Wrap each title in the following: `<a href="/post/`${id}`"><li>Title of Post</li></a>`
  34. - [ ] In the routes, clicking on the title, calls `router.get('/post/:id'...`, run db function `posts.getPostById(id)`
  35. - [ ] The post.ejs page will render the `/posts/2` with the post passed into the render method in a `singlePost` object.
  36. - [ ] `posts.getPostsById(id)` will take `const sql`= `SELECT posts.blog, posts.user_id
  37. FROM posts RIGHT JOIN users ON users.id=posts.user_id WHERE users.id = $1`
Add Comment
Please, Sign In to add comment