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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions app/assets/stylesheets/users.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,29 @@
overflow: auto;
}

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

& > .user-profile-heading {
flex-grow: 1;
margin-bottom: 0;
margin-top: 0;
padding: 0.5em;

&:not(:last-child) {
padding-right: 0;
}
}

& > .button:last-child {
margin-right: 0;
}
}
.user-profile--image {
text-align: center;

Expand Down
9 changes: 8 additions & 1 deletion app/views/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@
<% end %>
</div>

<h2 class="user-profile-heading">Posts</h2>
<div class="user-profile-heading-container">
<h2 class="user-profile-heading">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 %>
Expand Down
Loading