

.profile-top
  .profile-top__avatar
    .tag-info__image.media-tiny-container
      = if @tag.image do
        img src=tag_image(@tag) alt="spoiler image" width=50 height=50
      - else
        | no spoiler image

  .profile-top__name-and-links
    div
      h1 Tag image

      p Add a new image or remove the existing one here.
      p SVG is preferred.

      = form_for @changeset, ~p"/tags/#{@tag}/image", [method: "put", multipart: true], fn f ->
        = if @changeset.action do
          .alert.alert-danger
            p Oops, something went wrong! Please check the errors below.

        h4 Select an image
        .image-other
          #js-image-upload-previews
          p Upload a file from your computer
          .field
            = file_input f, :image, class: "input js-scraper"
            = error_tag f, :image_mime_type

          .field-error-js.hidden.js-scraper

          br

          => submit "Update tag image", class: "button"

      br
      = button_to "Remove tag image", ~p"/tags/#{@tag}/image", method: "delete", class: "button", data: [confirm: "Are you really, really sure?"]

    br
    = link "Back", to: ~p"/tags/#{@tag}"
