.dropdown.block__header__dropdown-tab
  a href="#"
    i.fa.fa-images>
    span.hide-limited-desktop.hide-mobile Galleries
    span data-click-preventdefault="true"
      i.fa.fa-caret-down>
  .dropdown__content.dropdown__content-right
    .block
      .block__content.add-to-gallery-list
        .block__list
          a.block__list__link.primary href=~p"/galleries?#{[gallery: [include_image: @image.id]]}"
            i.fa.fa-table>
            span.hide-mobile Featured in

        = if Enum.any?(@user_galleries) do
          ul.block__list.js-gallery-list
            = for {gallery, present} <- @user_galleries do
              = if present do
                / Options to remove
                li id="gallery_#{gallery.id}"
                  a.block__list__link.js-gallery-add.hidden data-fetchcomplete-hide="#gallery_#{gallery.id} .js-gallery-add" data-fetchcomplete-show="#gallery_#{gallery.id} .js-gallery-remove" data-method="post" data-remote="true" href=~p"/galleries/#{gallery}/images?#{[image_id: @image.id]}"
                    = gallery.title
                  a.block__list__link.active.js-gallery-remove data-fetchcomplete-hide="#gallery_#{gallery.id} .js-gallery-remove" data-fetchcomplete-show="#gallery_#{gallery.id} .js-gallery-add" data-method="delete" data-remote="true" href=~p"/galleries/#{gallery}/images?#{[image_id: @image.id]}"
                    = gallery.title
              - else
                / Options to add
                li id="gallery_#{gallery.id}"
                  a.block__list__link.js-gallery-add data-fetchcomplete-hide="#gallery_#{gallery.id} .js-gallery-add" data-fetchcomplete-show="#gallery_#{gallery.id} .js-gallery-remove" data-method="post" data-remote="true" href=~p"/galleries/#{gallery}/images?#{[image_id: @image.id]}"
                    = gallery.title
                  a.block__list__link.active.js-gallery-remove.hidden data-fetchcomplete-hide="#gallery_#{gallery.id} .js-gallery-remove" data-fetchcomplete-show="#gallery_#{gallery.id} .js-gallery-add" data-method="delete" data-remote="true" href=~p"/galleries/#{gallery}/images?#{[image_id: @image.id]}"
                    = gallery.title

        .block__list
          = if @conn.assigns.current_user do
            a.block__list__link.primary href=~p"/galleries/new?#{[with_image: @image.id]}"
              i.fa.fa-plus>
              span.hide-limited-desktop.hide-mobile Create a gallery
          - else
            a.block__list__link.primary href=~p"/sessions/new"
              i.fa.fa-user-plus>
              span.hide-limited-desktop.hide-mobile Sign in to create a gallery
