From c040bd5c8e289d3af338ec6dabf1415f900bf678 Mon Sep 17 00:00:00 2001 From: Monica Cellio Date: Mon, 20 Nov 2023 19:40:36 -0500 Subject: [PATCH 1/4] repeat button for all posts at the top of the list --- app/views/users/show.html.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 925437b42..9fdae4187 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -85,6 +85,9 @@ <% if @posts.size == 0 %>

<%= rtl_safe_username(@user) %> hasn't posted anything yet.

<% else %> + <%= link_to user_posts_path(@user), class: "button is-muted", 'aria-label': "View all posts by #{rtl_safe_username(@user)}" do %> + See all » + <% end %>
<% @posts.each do |a| %> <%= render 'posts/type_agnostic', post: a, show_type_tag: true, show_category_tag: true %> From cfc6c889d94773d7c7a9e480cbfafeee5a8d86e2 Mon Sep 17 00:00:00 2001 From: Monica Cellio Date: Fri, 24 Nov 2023 15:20:43 -0500 Subject: [PATCH 2/4] moved button into row with the heading --- app/assets/stylesheets/users.scss | 5 +++-- app/views/users/show.html.erb | 14 +++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/users.scss b/app/assets/stylesheets/users.scss index 22b580367..4e5c25321 100644 --- a/app/assets/stylesheets/users.scss +++ b/app/assets/stylesheets/users.scss @@ -51,11 +51,12 @@ } .user-profile-heading { - padding: 0.5em; + padding: 0.5em 0 0.5em 0.5em; border-bottom: 1px solid #ddd; margin-bottom: 0; + display: flex; + justify-content: space-between; } - .user-profile--image { text-align: center; diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 9fdae4187..0abd3fc80 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -81,13 +81,17 @@ <% end %>
-

Posts

+
+

Posts

+ <% 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 » + <% end %> + <% end %> +
<% if @posts.size == 0 %>

<%= rtl_safe_username(@user) %> hasn't posted anything yet.

- <% else %> - <%= link_to user_posts_path(@user), class: "button is-muted", 'aria-label': "View all posts by #{rtl_safe_username(@user)}" do %> - See all » - <% end %> + <% else %>
<% @posts.each do |a| %> <%= render 'posts/type_agnostic', post: a, show_type_tag: true, show_category_tag: true %> From c49b172d9350973154a827ae3a8af79bdbcf54d5 Mon Sep 17 00:00:00 2001 From: Oleg Valter Date: Sat, 25 Nov 2023 01:32:04 +0300 Subject: [PATCH 3/4] proper styling for user profile header with a 'see all' button --- app/assets/stylesheets/users.scss | 22 +++++++++++++++++++--- app/views/users/show.html.erb | 6 +++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/users.scss b/app/assets/stylesheets/users.scss index 4e5c25321..bb0850252 100644 --- a/app/assets/stylesheets/users.scss +++ b/app/assets/stylesheets/users.scss @@ -50,12 +50,28 @@ overflow: auto; } -.user-profile-heading { - padding: 0.5em 0 0.5em 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: 0.5em 0 0.5em 0.5em; + } + } + + & > .button:last-child { + margin-right: 0; + } } .user-profile--image { text-align: center; diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 0abd3fc80..a70f5e5da 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -81,8 +81,8 @@ <% end %>
-
-

Posts

+ <% if @posts.size == 0 %>

<%= rtl_safe_username(@user) %> hasn't posted anything yet.

- <% else %> + <% else %>