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/users.scss b/app/assets/stylesheets/users.scss index 90d9fadc2..3aa905cda 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-grow: 1; + justify-content: end; + max-width: max-content; + } } 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; diff --git a/app/views/users/vote_summary.html.erb b/app/views/users/vote_summary.html.erb index d1cf7dcaa..9298c63fd 100644 --- a/app/views/users/vote_summary.html.erb +++ b/app/views/users/vote_summary.html.erb @@ -5,62 +5,64 @@

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 + +0 <% else %> - +<%= vote_data[+1].first.vote_count %> + +<%= vote_data[+1].first.vote_count %> <% end %> - -
-
- + +
+
+ <% if vote_data[-1].count == 0 %> - −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') %> -
+ −<%= 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 %>
+
+ <% end %>
- <% end %> -
-
+
<% end %>