From 8c4ee44e43a86c16117f6af14eee06ccd018c3e6 Mon Sep 17 00:00:00 2001 From: Oleg Valter Date: Wed, 21 Jan 2026 03:51:21 +0300 Subject: [PATCH 1/4] linted vote_summary view --- app/views/users/vote_summary.html.erb | 96 +++++++++++++-------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/app/views/users/vote_summary.html.erb b/app/views/users/vote_summary.html.erb index d1cf7dcaa..bd9041fda 100644 --- a/app/views/users/vote_summary.html.erb +++ b/app/views/users/vote_summary.html.erb @@ -5,62 +5,62 @@

A daily summary of votes received for posts.

<% @votes.each do |day, vote_list, net_votes| %> -
> - -

<%= day.strftime('%b %e, %Y') %>: -<% if net_votes > 0 %> - +<%= net_votes %> -<% elsif net_votes < 0 %> - <%= net_votes %> -<% else %> - 0 -<% end %>

-
-
- <% vote_list.each do |post, vote_data| %> - <% vote_data = { -1 => [], 1 => [] }.merge(vote_data.group_by { |vd| vd.vote_type }) %> -
-
+
> + +

<%= day.strftime('%b %e, %Y') %>: + <% if net_votes > 0 %> + +<%= net_votes %> + <% elsif net_votes < 0 %> + <%= net_votes %> + <% else %> + 0 + <% end %>

+
+
+ <% vote_list.each do |post, vote_data| %> + <% vote_data = { -1 => [], 1 => [] }.merge(vote_data.group_by { |vd| vd.vote_type }) %> +
+
- <% if vote_data[+1].count == 0 %> - +0 - <% else %> - +<%= vote_data[+1].first.vote_count %> - <% end %> + <% if vote_data[+1].count == 0 %> + +0 + <% else %> + +<%= vote_data[+1].first.vote_count %> + <% end %> -
-
+
+
- <% if vote_data[-1].count == 0 %> - −0 - <% else %> - −<%= vote_data[-1].first.vote_count %> - <% end %> + <% if vote_data[-1].count == 0 %> + −0 + <% else %> + −<%= vote_data[-1].first.vote_count %> + <% end %> -
-
+
+
- <% if post.present? %> -
- <%= link_to generic_share_link(post) do %> - <%= post.post_type.is_top_level ? post.title : post.parent.title %> - <% end %> -
-
- <%= post.post_type.name %> - <%= post.category.name %> -
- <% else %> -
- <%= I18n.t('votes.summary.post_missing') %> -
- <% end %> + <% if post.present? %> +
+ <%= link_to generic_share_link(post) do %> + <%= post.post_type.is_top_level ? post.title : post.parent.title %> + <% end %> +
+
+ <%= post.post_type.name %> + <%= post.category.name %> +
+ <% else %> +
+ <%= I18n.t('votes.summary.post_missing') %> +
+ <% end %>
+
+ <% end %>
- <% end %> -
-
+ <% end %>
From 1ddaaef9d5d06f0c5375e77b8b61c6039094b959 Mon Sep 17 00:00:00 2001 From: Oleg Valter Date: Wed, 21 Jan 2026 04:26:54 +0300 Subject: [PATCH 2/4] made gap SCSS utils dynamically generated --- app/assets/stylesheets/_variables.scss | 5 +++++ app/assets/stylesheets/utilities.scss | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/app/assets/stylesheets/_variables.scss b/app/assets/stylesheets/_variables.scss index 51afa04b5..8cede592d 100644 --- a/app/assets/stylesheets/_variables.scss +++ b/app/assets/stylesheets/_variables.scss @@ -62,4 +62,9 @@ $font-sizes: ( xl: 1.5em ); +$gap-sizes: ( + sm: 0.5em, + md: 1em +); + $text-aligns: left, center, right, justify; diff --git a/app/assets/stylesheets/utilities.scss b/app/assets/stylesheets/utilities.scss index 6e00f7c11..038fc50e7 100644 --- a/app/assets/stylesheets/utilities.scss +++ b/app/assets/stylesheets/utilities.scss @@ -375,6 +375,12 @@ span.spoiler { white-space: nowrap; } +@each $size in $gap-sizes { + .gap-#{$size} { + gap: $size; + } +} + @each $side in $sides { .border-#{$side}-none { border-#{$side}: none; From a8a23944063cd6c649be218356d8bf2d0428f398 Mon Sep 17 00:00:00 2001 From: Oleg Valter Date: Wed, 21 Jan 2026 04:59:40 +0300 Subject: [PATCH 3/4] fixed user vote summary item wrapping --- app/assets/stylesheets/users.scss | 19 ++++++++++++- app/views/users/vote_summary.html.erb | 40 ++++++++++++++------------- 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/app/assets/stylesheets/users.scss b/app/assets/stylesheets/users.scss index 90d9fadc2..323cc7a72 100644 --- a/app/assets/stylesheets/users.scss +++ b/app/assets/stylesheets/users.scss @@ -230,14 +230,31 @@ $sizes: (16, 32, 40, 48, 64, 128, 256); .item-list--item { + flex-wrap: nowrap; padding: 0 !important; .item-list--number-value { - width: 60px !important; + width: max-content !important; } .grid { align-items: center; } } + + .vote-summary-item--counts { + justify-content: end; + display: flex; + flex-wrap: wrap; + gap: 0.25em; + padding: 5px; + } + + .vote-summary-item--tags { + display: flex; + gap: 0.35em; + flex-wrap: wrap; + justify-content: end; + max-width: max-content; + } } diff --git a/app/views/users/vote_summary.html.erb b/app/views/users/vote_summary.html.erb index bd9041fda..131833a0c 100644 --- a/app/views/users/vote_summary.html.erb +++ b/app/views/users/vote_summary.html.erb @@ -20,33 +20,35 @@ <% vote_list.each do |post, vote_data| %> <% vote_data = { -1 => [], 1 => [] }.merge(vote_data.group_by { |vd| vd.vote_type }) %>
-
- - <% if vote_data[+1].count == 0 %> - +0 - <% else %> - +<%= vote_data[+1].first.vote_count %> - <% end %> - -
-
- - <% if vote_data[-1].count == 0 %> - −0 - <% else %> - −<%= vote_data[-1].first.vote_count %> - <% end %> - +
+
+ + <% if vote_data[+1].count == 0 %> + +0 + <% else %> + +<%= vote_data[+1].first.vote_count %> + <% end %> + +
+
+ + <% if vote_data[-1].count == 0 %> + −0 + <% else %> + −<%= vote_data[-1].first.vote_count %> + <% end %> + +
<% if post.present? %> -
+
<%= link_to generic_share_link(post) do %> <%= post.post_type.is_top_level ? post.title : post.parent.title %> <% end %>
-
+
<%= post.post_type.name %> <%= post.category.name %>
From a4b758d49fa640c9f73f682583134c327e2277c1 Mon Sep 17 00:00:00 2001 From: Oleg Valter Date: Wed, 21 Jan 2026 05:05:56 +0300 Subject: [PATCH 4/4] minor adjustments to make vote summary items more reactive to width changes --- app/assets/stylesheets/users.scss | 2 +- app/views/users/vote_summary.html.erb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/users.scss b/app/assets/stylesheets/users.scss index 323cc7a72..3aa905cda 100644 --- a/app/assets/stylesheets/users.scss +++ b/app/assets/stylesheets/users.scss @@ -253,7 +253,7 @@ $sizes: (16, 32, 40, 48, 64, 128, 256); .vote-summary-item--tags { display: flex; gap: 0.35em; - flex-wrap: wrap; + flex-grow: 1; justify-content: end; max-width: max-content; } diff --git a/app/views/users/vote_summary.html.erb b/app/views/users/vote_summary.html.erb index 131833a0c..9298c63fd 100644 --- a/app/views/users/vote_summary.html.erb +++ b/app/views/users/vote_summary.html.erb @@ -41,14 +41,14 @@
-
+
<% if post.present? %> -
+
<%= link_to generic_share_link(post) do %> <%= post.post_type.is_top_level ? post.title : post.parent.title %> <% end %>
-
+
<%= post.post_type.name %> <%= post.category.name %>