philomena/lib/philomena_web/templates/profile/_commission.html.heex

34 lines
1.3 KiB
Text
Raw Permalink Normal View History

2024-06-02 05:50:36 +02:00
<div class="block__content profile">
<%= cond do %>
<% @user.commission -> %>
<strong>
Status:
</strong>
<%= commission_status(@user.commission) %>
<br />
<%= if Enum.any?(@user.commission.items) do %>
<strong>
Price Range:
</strong>
2024-06-02 05:50:49 +02:00
<% {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() %> - $ <%= Decimal.round(max.base_price || 0, 2) |> Decimal.to_string() %> USD <br />
2024-06-02 05:50:36 +02:00
<% end %>
<% # Lotta space here %>
<br />
<%= @commission_information %>
<br />
<br />
<%= link("More information", to: ~p"/profiles/#{@user}/commission") %>
<% current?(@user, @conn.assigns.current_user) -> %>
<%= if Enum.any?(@conn.assigns.user.verified_links) do %>
<em>
2024-06-02 05:50:49 +02:00
You don't have any commission information listed yet. <%= link("Click here", to: ~p"/profiles/#{@user}/commission/new") %> to set it up.
2024-06-02 05:50:36 +02:00
</em>
<% else %>
<em>
2024-06-02 05:50:49 +02:00
You must have a verified Artist Link to create a commission page. <%= link("Click here", to: ~p"/profiles/#{@user}/artist_links/new") %> to set one up.
2024-06-02 05:50:36 +02:00
</em>
<% end %>
<% true -> %>
<% end %>
</div>