From 8cb8e303a7c4c68b0f47ad53aaa9f482431caf36 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Thu, 6 Feb 2020 17:51:22 -0500 Subject: [PATCH] fix price listing inconsistency --- .../templates/commission/_directory_results.html.slime | 2 +- lib/philomena_web/templates/profile/_commission.html.slime | 2 +- .../templates/profile/commission/_listing_sidebar.html.slime | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/philomena_web/templates/commission/_directory_results.html.slime b/lib/philomena_web/templates/commission/_directory_results.html.slime index fa0c35fb..37e9abf7 100644 --- a/lib/philomena_web/templates/commission/_directory_results.html.slime +++ b/lib/philomena_web/templates/commission/_directory_results.html.slime @@ -30,7 +30,7 @@ elixir: = render PhilomenaWeb.UserAttributionView, "_user.html", object: c, badges: true, conn: @conn .commission__listing__body_text - - {min, max} = Enum.min_max_by(c.items, & &1.base_price) + - {min, max} = Enum.min_max_by(c.items, &Decimal.to_float(&1.base_price)) p strong> Price Range: diff --git a/lib/philomena_web/templates/profile/_commission.html.slime b/lib/philomena_web/templates/profile/_commission.html.slime index d884529a..4998029a 100644 --- a/lib/philomena_web/templates/profile/_commission.html.slime +++ b/lib/philomena_web/templates/profile/_commission.html.slime @@ -7,7 +7,7 @@ = if Enum.any?(@user.commission.items) do strong> Price Range: - - {min, max} = Enum.min_max_by(@user.commission.items, & &1.base_price) + - {min, max} = Enum.min_max_by(@user.commission.items, &Decimal.to_float(&1.base_price)) | $ => Decimal.round(min.base_price || 0, 2) |> Decimal.to_string() | - $ diff --git a/lib/philomena_web/templates/profile/commission/_listing_sidebar.html.slime b/lib/philomena_web/templates/profile/commission/_listing_sidebar.html.slime index 85adc8e0..69644e68 100644 --- a/lib/philomena_web/templates/profile/commission/_listing_sidebar.html.slime +++ b/lib/philomena_web/templates/profile/commission/_listing_sidebar.html.slime @@ -14,7 +14,7 @@ = if Enum.any?(@commission.items) do strong> Price Range: - - {min, max} = Enum.min_max_by(@commission.items, & &1.base_price) + - {min, max} = Enum.min_max_by(@commission.items, &Decimal.to_float(&1.base_price)) | $ => Decimal.round(min.base_price, 2) |> Decimal.to_string() | - $ @@ -89,4 +89,4 @@ a href="#" data-click-copy="#commission_url" i.fa.fa-clipboard> ' Copy - = text_input :commission, :commission_url, value: url, class: "input input--wide input--separate-top", readonly: true \ No newline at end of file + = text_input :commission, :commission_url, value: url, class: "input input--wide input--separate-top", readonly: true