.block__content.js-imagelist-info.flex class=tags_row_class(@conn)
  .flex__fixed.tag-info__image.thumb-tiny-container.spacing-right
    = if @tag.image do
      img src=tag_image(@tag) alt="spoiler image"
    - else
      | no spoiler image
  
  .flex__grow
    = render PhilomenaWeb.TagView, "_tag.html", tag: @tag, conn: @conn
    = link "Tag changes", to: ~p"/tags/#{@tag}/tag_changes", class: "detail-link"
    = if manages_tags?(@conn) do
      = link "Edit details", to: ~p"/tags/#{@tag}/edit", class: "detail-link"
      = link "Usage", to: ~p"/tags/#{@tag}/details", class: "detail-link"
    = if manages_dnp?(@conn) do
      = link "Create new DNP entry", to: ~p"/dnp/new?#{[tag_id: @tag.id]}", class: "detail-link"

    br
  
    = if @tag.short_description not in [nil, ""] do
      strong> Short description:
      = @tag.short_description
      br

    = if manages_tags?(@conn) and present?(@tag.mod_notes) do
      strong.comment_deleted> Mod notes:
      = @tag.mod_notes
      br

    = if Enum.any?(@tag.aliases) do
      strong> Aliases:
      = if aliases_tags?(@conn) do
        = map_join(@tag.aliases, ", ", &link(&1.name, to: ~p"/tags/#{&1}/alias/edit"))
      - else
        = map_join(@tag.aliases, ", ", & &1.name)
      br

    = if Enum.any?(@tag.implied_tags) do
      strong> Implies:
      = map_join(@tag.implied_tags, ", ", &link(&1.name, to: ~p"/tags/#{&1}"))
      br

    = if Enum.any?(@tag.hidden_links) and manages_links?(@conn) do
      strong.comment_deleted> Hidden links:
      br

      = for artist_link <- @tag.hidden_links do
        => link artist_link.user.name, to: ~p"/profiles/#{artist_link.user}"
        ' &rarr;
        => link artist_link.uri, to: artist_link.uri
        br


    = if present?(@tag.public_links) or present?(@tag.channels) or present?(@tag.implied_by_tags) or present?(@tag.description) do
      br
      = link "Toggle detailed information", to: "#", data: [click_toggle: ".tag-info__more"]

      .tag-info__more
        hr

        = if Enum.any?(@tag.public_links) do
          strong> Associated links:

          = for link <- @tag.public_links do
            a> href=link.uri = link.uri

          br

        = if Enum.any?(@tag.public_links) do
          strong> Associated users:
          - users = Enum.map(@tag.public_links, & &1.user) |> Enum.uniq_by(& &1.id)

          = for user <- users do
            => link user.name, to: ~p"/profiles/#{user}"

          br

        = if Enum.any?(@tag.channels) do
          strong> Associated streams:
          = for channel <- @tag.channels do
            => link channel.title, to: ~p"/channels/#{channel}"

            = if can?(@conn, :edit, channel) do
              | (
              = link "Edit", to: ~p"/channels/#{channel}/edit"
              ' )

          br

        = if Enum.any?(@tag.implied_by_tags) do
          input.toggle-box id="implied_by" type="checkbox"
          label for="implied_by"
            ' Implied by (warning: unfiltered)

          .toggle-box-container
            .toggle-box-container__content
              = map_join @tag.implied_by_tags, ", ", fn tag ->
                = link tag.name, to: ~p"/tags/#{tag}"

          br

        = if @tag.description not in [nil, ""] do
          strong> Detailed description:
          br
          = @body

    = if Enum.any?(@dnp_entries) do
      hr
      strong.comment_deleted This artist is on the Do-Not-Post List with the following restrictions:

      = for {body, entry} <- @dnp_entries do
        br
        ' &bull;

        strong
          => entry.dnp_type

        => body

        | (
        = link "more info", to: ~p"/dnp/#{entry}"
        | )
