From c726c79a6afc6f688b8ae1ff0727c9cd4b9ca62a Mon Sep 17 00:00:00 2001 From: Eliot Partridge Date: Thu, 3 Mar 2022 15:04:45 -0600 Subject: [PATCH] Sort image favoriters' names case-insensitively --- .../templates/image/favorite/index.html.slime | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/philomena_web/templates/image/favorite/index.html.slime b/lib/philomena_web/templates/image/favorite/index.html.slime index 3f8611d9..1e606aad 100644 --- a/lib/philomena_web/templates/image/favorite/index.html.slime +++ b/lib/philomena_web/templates/image/favorite/index.html.slime @@ -3,7 +3,7 @@ h5 => @image.faves_count = pluralize("user", "users", @image.faves_count) -= for fave <- Enum.sort_by(@image.faves, & &1.user.name) do += for fave <- Enum.sort_by(@image.faves, & String.downcase(&1.user.name)) do => link fave.user.name, to: Routes.profile_path(@conn, :show, fave.user), class: "interaction-user-list-item" = if @has_votes do @@ -12,7 +12,7 @@ h5 => @image.upvotes_count = pluralize("user", "users", @image.upvotes_count) - = for upvote <- Enum.sort_by(@image.upvotes, & &1.user.name) do + = for upvote <- Enum.sort_by(@image.upvotes, & String.downcase(&1.user.name)) do span.interaction-user-list-item => link upvote.user.name, to: Routes.profile_path(@conn, :show, upvote.user) => link "(x)", to: Routes.image_tamper_path(@conn, :create, @image, user_id: upvote.user_id), method: "post" @@ -22,7 +22,7 @@ h5 => @image.downvotes_count = pluralize("user", "users", @image.downvotes_count) - = for downvote <- Enum.sort_by(@image.downvotes, & &1.user.name) do + = for downvote <- Enum.sort_by(@image.downvotes, & String.downcase(&1.user.name)) do span.interaction-user-list-item => link downvote.user.name, to: Routes.profile_path(@conn, :show, downvote.user) => link "(x)", to: Routes.image_tamper_path(@conn, :create, @image, user_id: downvote.user_id), method: "post" @@ -32,5 +32,5 @@ h5 => @image.hides_count = pluralize("user", "users", @image.hides_count) - = for hide <- Enum.sort_by(@image.hides, & &1.user.name) do + = for hide <- Enum.sort_by(@image.hides, & String.downcase(&1.user.name)) do => link hide.user.name, to: Routes.profile_path(@conn, :show, hide.user), class: "interaction-user-list-item"