/ General information block
.block
  .block__header
    span General information
  .block__content.commission__block_body
    strong> Profile:
    = render PhilomenaWeb.UserAttributionView, "_user.html", object: @commission, conn: @conn
    br

    strong> Status:
    = if @commission.open, do: "Open", else: "Closed"

    br

    = if Enum.any?(@commission.items) do
      strong> Price Range:
      - {min, max} = Enum.min_max_by(@commission.items, &Decimal.to_float(&1.base_price))
      | $
      => Decimal.round(min.base_price, 2) |> Decimal.to_string()
      | - $
      => Decimal.round(max.base_price, 2) |> Decimal.to_string()
      ' USD

    br
    br

    = @rendered.information

/ Contact information block
.block
  .block__header
    span Contact information
  .block__content.commission__block_body
    = @rendered.contact

/ Categories block
.block
  .block__header
    span Art Categories
  .block__content
    = for cat <- @commission.categories do
      span.commission__category
        = cat

/ Will create block
= if @commission.will_create not in [nil, ""] do
  .block
    .block__header
      span Will draw/create
    .block__content.commission__block_body
      = @rendered.will_create

/ Will not create block
= if @commission.will_not_create not in [nil, ""] do
  .block
    .block__header
      span Will not draw/create
    .block__content.commission__block_body
      = @rendered.will_not_create

/ Artist link block
/.block
  .block__header: span Artist Links
  - is_current = (current_user && current_user.id == @user.id)
  - if @links.present? || is_current
    = render partial: 'profiles/artist_link_area'

/ Options block
.block
  .block__header
    span Options
  .block__content
    = if can?(@conn, :edit, @commission) do
      = link "Edit this listing", to: ~p"/profiles/#{@user}/commission/edit"
      br
      = link "Delete this listing", to: ~p"/profiles/#{@user}/commission", data: [confirm: "Are you really, really sure about that?", method: "delete"]
      br
    = link "Report this listing", to: ~p"/profiles/#{@user}/commission/reports/new"

/ Share block
.block
  .block__header
    span Share this listing
  .block__content
    - url = url(~p"/profiles/#{@user}/commission")

    .field
      label> for="commission_url" URL
      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
