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

Add views layouts #7

Merged
merged 11 commits into from
Oct 17, 2023
Merged

Add views layouts #7

merged 11 commits into from
Oct 17, 2023

Conversation

geekelo
Copy link
Owner

@geekelo geekelo commented Oct 16, 2023

  • Implement the design from the sneak peek wireframes.

  • Implement minimal styling

  • Analyze the wireframes deeply and identify all the necessary elements and how a user would navigate from one page to another

All Users page wireframe Single User page wireframe
All Posts by a given User page wireframe Single Post page wireframe

Copy link

@danmainah danmainah left a comment

Choose a reason for hiding this comment

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

Hi @geekelo ,

Good job so far!
There are some issues that you still need to work on to go to the next project but you are almost there!

Highlights

✔️ Added views for the post and user controller actions.
✔️ Added a way to navigate from one page to another.

Required Changes ♻️

Check the comments under the review.

Optional suggestions

Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.

Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.


_As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

![image](https://github.com/geekelo/rails-blog_app/assets/102464578/b6d75d35-5613-4fec-a23f-533ac2c40af6)
![image](https://github.com/geekelo/rails-blog_app/assets/102464578/072ef998-2566-4116-a21c-edd58af433da)
![image](https://github.com/geekelo/rails-blog_app/assets/102464578/8e31087f-f384-46f0-9f9f-befc87ebd8b1)


Choose a reason for hiding this comment

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

  • @geekelo Great work on your readme, however, I noted your MIT license is currently a template that helps you write MIT license, kindly consider customizing it to suit your project, and also to give users legal authority to use your code.
    image

Comment on lines +1 to +10
<%= stylesheet_link_tag 'users', media: 'all', 'data-turbolinks-track': 'reload' %>
<body>
<div id="user">
<img id="user-image" src="<%= user.photo %>" alt="User Photo" width="200">
<article id="user-details" class="container">
<h1><%= user.name %></h1>
<p class="counts">Number of posts: <%= user.posts_counter.nil? ? 0 : user.posts_counter %></p>
<article>
</div>
</body>

Choose a reason for hiding this comment

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

@geekelo Great work using partials to render users, this will ensure your code will be easier to scale and also easy to read.

Comment on lines +1 to +9
No users
<% else %>
<% @users.each do |user| %>
<%= link_to user_path(user) do %>
<%= render user %>
<% end %><br>
<% end %>
<% end %>

Choose a reason for hiding this comment

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

  • @geekelo I am getting the error below when I try to access the users' page, to fix it you can delete the 4th line code from your manifest.js file, you currently don't have a directory called vendors in the assets folder that's why the error is showing
    image

image

Comment on lines +2 to +16
<% @posts.each do |post| %>
<a href ="<%= user_post_path(@user, post)%>"><%= render post%></a>
<%= "no comments for this post" if post.comments.empty?%>
<div class="comments">
<% post.recent_comments.each do |comment|%>
<%=render comment%>
<% end %>
<p id="view-post"><%= link_to 'View Post', user_post_path(@user, post) %></p>
</div>

<div class="button-container">
<button>See all posts</a></button>
</div>
<% end %>

Choose a reason for hiding this comment

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

  • @geekelo Great work in adding the views to your project, however am unable to access the user's post index page, am getting the error below, this is because you are using render and you don't have a partial view to display comments.
    image
Suggested change
<%= render @user %>
<% @posts.each do |post| %>
<a href ="<%= user_post_path(@user, post)%>"><%= render post%></a>
<%= "no comments for this post" if post.comments.empty?%>
<div class="comments">
<% post.recent_comments.each do |comment|%>
<%=render comment%>
<% end %>
<p id="view-post"><%= link_to 'View Post', user_post_path(@user, post) %></p>
</div>
<div class="button-container">
<button>See all posts</a></button>
</div>
<% end %>
<%= render @user %>
<% @posts.each do |post| %>
<a href ="<%= user_post_path(@user, post)%>"><%= render post%></a>
<%= "no comments for this post" if post.comments.empty?%>
<div class="comments">
<% post.recent_comments.each do |comment|%>
<li> <%= comment.text %> </li>
<% end %>
<p id="view-post"><%= link_to 'View Post', user_post_path(@user, post) %></p>
</div>
<div class="button-container">
<button>See all posts</a></button>
</div>
<% end %>

Copy link

@topeogunleye topeogunleye left a comment

Choose a reason for hiding this comment

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

Hi @geekelo,

Great work on making the changes requested by a previous reviewer 👏
You've done well implementing some of the requested changes, but there are still some which aren't addressed yet.

Highlights

*Tried to implement the changes requested by the previous reviewer. ✔️

Required Changes ♻️

Check the comments under the review.

Optional suggestions

Every comment with the [OPTIONAL] prefix won't stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better. Some of them were simply missed by the previous reviewer and addressing them will really improve your application.

You can also consider:

  • Please kindly check my inline comment.

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag @topeogunleye in your question so I can receive the notification.

Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

![image](https://github.com/geekelo/rails-blog_app/assets/102464578/b6d75d35-5613-4fec-a23f-533ac2c40af6)
![image](https://github.com/geekelo/rails-blog_app/assets/102464578/072ef998-2566-4116-a21c-edd58af433da)
![image](https://github.com/geekelo/rails-blog_app/assets/102464578/8e31087f-f384-46f0-9f9f-befc87ebd8b1)


Choose a reason for hiding this comment

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


Hi @geekelo,

First off, great job on your project so far! The effort and dedication you've put into it is evident. 👏

However, while reviewing, I noticed that a change requested by the previous reviewer concerning the MIT license in your README hasn't been addressed.

Change Requested:
The MIT license in your README appears to still be in its template form. It's essential for the license to be customized and tailored to your project. This not only adds a professional touch but also grants users the proper legal authority to use your code.

Please take a moment to update this section to reflect the appropriate details for your project.

Keep pushing forward, and let's make this adjustment to proceed!


Happy Coding! 🚀👨‍💻👩‍💻

<%= "no comments for this post" if @post.comments.empty?%>
<div class="comments">
<% @post.comments.each do |comment|%>
<%=render comment %>

Choose a reason for hiding this comment

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


Hi @geekelo,

Great job on the progress you've made with your project, especially in adding the views. Your dedication and hard work are commendable. 👏

However, there's a persistent issue from the previous review that still needs to be addressed:

Change Requested:
As per the previous feedback, there's an error when trying to access the user's post index page. This issue seems to stem from this line in your code:

<%=render comment %>

Given that there isn't a comment partial (i.e., _comment.html.erb) in your views directory, this line will throw an error when there are comments for a post.

To resolve this, you have a couple of options:

  1. Create a Comment Partial: If you intend to use a partial for comments, create a _comment.html.erb partial in the appropriate views directory and populate it with the necessary content to display each comment.
  2. Directly Display Comments: If you don't wish to use a partial, you can directly display each comment's content within the loop, replacing the render line.

Please address these concerns and test your view to ensure that the issues are resolved. Keep up the good work, and don't get discouraged. Every challenge is a stepping stone to mastery!


Best of luck with your coding journey! 🚀👨‍💻👩‍💻

<%=render comment %>
<% end %>
<div class="button-container">
<button>Pagination</a></button>

Choose a reason for hiding this comment

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

Hi @geekelo,

Great job on the progress you've made with your project, especially in adding the views. Your dedication and hard work are commendable. 👏

However, there's an issue that needs to be addressed:

  • [OPTIONAL] Also, kindly fix the mismatched tags in <button>Pagination</a></button>. Ensure that you use consistent opening and closing tags.

Copy link

@julie-ify julie-ify left a comment

Choose a reason for hiding this comment

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

Hi @geekelo,

Good job so far!

Highlights!

  • Good code organization and partial use ✔️
  • Descriptive README ✔️

Great work on making the changes requested by a previous reviewer 👏
You've done well implementing some of the requested changes, but there are still some which aren't addressed yet.

Required Changes ♻️

Check the comments under the review.

Optional suggestions

Every comment with the [OPTIONAL] prefix won't stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better. Some of them were simply missed by the previous reviewer and addressing them will really improve your application.

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.

Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

![image](https://github.com/geekelo/rails-blog_app/assets/102464578/b6d75d35-5613-4fec-a23f-533ac2c40af6)
![image](https://github.com/geekelo/rails-blog_app/assets/102464578/072ef998-2566-4116-a21c-edd58af433da)
![image](https://github.com/geekelo/rails-blog_app/assets/102464578/8e31087f-f384-46f0-9f9f-befc87ebd8b1)


## 🛠 Built With <a name="built-with"></a>

Choose a reason for hiding this comment

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

  • You are yet to customize your MIT file as previously requested by the other reviewers. Kindly customize it.

    image

Copy link

@danmainah danmainah left a comment

Choose a reason for hiding this comment

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

Hi @geekelo ,

Your project is complete! There is nothing else to say other than... it's time to merge it :shipit:
Congratulations! 🎉 🎉 🎉

Highlights

✔️ Implemented the change requested to ensure the MIT license is customized as requested.

Optional suggestions

Every comment with the [OPTIONAL] prefix won't stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better. Some of them were simply missed by the previous reviewer and addressing them will really improve your application.

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

@geekelo geekelo merged commit ca8c1e9 into dev Oct 17, 2023
3 checks passed
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.

4 participants