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

on profile page, repeat button for all posts at the top of the list #1237

Merged
merged 6 commits into from
Dec 3, 2023

Conversation

cellio
Copy link
Member

@cellio cellio commented Nov 21, 2023

On the user profile page, copies the "show all" button from the bottom of the post list to the top as well. We could make the heading a link instead of having the button, but since it's the same operation maybe we want the same UI presentation. I'm open to changing that, though we only want the link if there are posts, so it complicates the view a little. I tried putting a link next to or immediately below the heading instead, but it looked ugly -- maybe just a matter of spacing.

Fixes #1106.

A problem with "just go to the bottom of the page" is that on mobile the "right column" is at the bottom, so this button is somewhere in the middle.

@cellio cellio requested a review from a team November 21, 2023 00:43
Oaphi
Oaphi previously requested changes Nov 24, 2023
Copy link
Member

@Oaphi Oaphi left a comment

Choose a reason for hiding this comment

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

How about we do something like this?

Screenshot from 2023-11-24 22-49-48

Example implementation:

show.html.erb

      <div class="user-profile-heading">
        <h2 class="has-margin-0">Posts</h2>
        <% if @posts.size > 0 %>
          <%= link_to user_posts_path(@user), class: "button is-muted", 'aria-label': "View all posts by #{rtl_safe_username(@user)}" do %>
            See all &raquo;
          <% end %>
        <% end %>
      </div>
      <% if @posts.size == 0 %>
        <p><span dir="ltr"><%= rtl_safe_username(@user) %></span> hasn't posted anything yet.</p>
      <% else %>

users.scss

.user-profile-heading {
  padding: 0.5em 0 0.5em 0.5em;
  border-bottom: 1px solid #ddd;
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
}

@cellio
Copy link
Member Author

cellio commented Nov 24, 2023

How about we do something like this?

That would be much better! I couldn't figure out how to lay that out. Thanks.

@Oaphi Oaphi requested a review from a team November 26, 2023 10:04
@Oaphi Oaphi dismissed their stale review November 26, 2023 10:04

Outdated as per discussion

@Oaphi Oaphi added the area: ruby Changes to server-side code label Nov 26, 2023
@ArtOfCode- ArtOfCode- merged commit bb4c814 into develop Dec 3, 2023
7 checks passed
@ArtOfCode- ArtOfCode- deleted the cellio/1106-all-posts-at-top branch December 3, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ruby Changes to server-side code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User profile: access all posts without having to scroll all the way down
3 participants