h1
  ' Viewing full filter details for
  = @filter.name

.filter
  .filter-options
    ul
      li
        ' Spoilers
        => number_with_delimiter(length(@filter.spoilered_tag_ids))
        => pluralize("tag", "tags", length(@filter.spoilered_tag_ids))
        ' and hides
        => number_with_delimiter(length(@filter.hidden_tag_ids))
        => pluralize("tag", "tags", length(@filter.hidden_tag_ids))

      = if @filter.id == @conn.assigns.current_filter.id do
        li
          strong Your current filter
      - else
        li
          = button_to "Use this filter", ~p"/filters/current?#{[id: @filter]}", method: "put", class: "button"

      = if can?(@conn, :edit, @filter) do
        li
          = link "Edit this filter", to: ~p"/filters/#{@filter}/edit", class: "button"

      = if can?(@conn, :delete, @filter) do
        = button_to "Destroy this filter", ~p"/filters/#{@filter}", method: "delete", class: "button", data: [confirm: "Are you really, really sure?"]

  = if @filter.user do
    p.filter-maintainer
      ' This filter is maintained by
      = render PhilomenaWeb.UserAttributionView, "_user.html", object: @filter, conn: @conn

  p.filter-description
    = @filter.description

  = if length(@spoilered_tags) > 0 or !!@filter.spoilered_complex_str do
    h5 This filter spoilers...

    = for tag <- @spoilered_tags do
      = render PhilomenaWeb.TagView, "_tag.html", tag: tag, conn: @conn
    pre.spoiler-filter-code
      = @filter.spoilered_complex_str

  - else
    p This filter doesn't spoiler any tags.


  = if length(@hidden_tags) > 0 or !!@filter.hidden_complex_str do
    h5 This filter hides...

    = for tag <- @hidden_tags do
      = render PhilomenaWeb.TagView, "_tag.html", tag: tag, conn: @conn
    pre.spoiler-filter-code
      = @filter.hidden_complex_str

  - else
    p This filter doesn't hide any tags.



/p = link("Report filter to moderators", new_report_path(reportable_class: 'filter', reportable_id: @filter.id)
p = link("Back to filters", to: ~p"/filters")
