// Button that reveals a dropdown/modal for moderation/reporting

.button-group.small.align-center
  - if can?(:destroy, screenshot) || can?(:approve, screenshot)
    .text
      - @statustext, @statuscolor = status(screenshot)
      span class="label adminlabel #{@statuscolor}"
        = @statustext

  - if !screenshot.hidden && screenshot.approved && can?(:hide, screenshot)
    a.button.small.bordered.radius.warning[
      href=hide_screenshot_path(screenshot.id)
      onclick="return confirm('Really hide the screenshot from public view?');"
      ] #{icon('eye-off', class: 'icon')} Hide

  - if screenshot.hidden && screenshot.approved && can?(:unhide, screenshot)
    a.button.small.bordered.radius.warning[
      href=unhide_screenshot_path(screenshot.id)
      ] #{icon('eye', class: 'icon')} Un-Hide

  - if can?(:destroy, screenshot)
    a.button.small.bordered.radius.alert[
      href=delete_screenshot_path(screenshot.id)
      onclick="return confirm('Really delete the screenshot?');"
      ] #{icon('trash-2', class: 'icon')} Delete

  / a.button.small.bordered.radius.secondary[
  /   href='#'
  /   ] #{icon('fa-solid', 'edit')} Edit caption

  / a.button.small.bordered.radius.secondary[
  /   href='#'
  /   ] #{icon('fa-solid', 'star')} Make primary

  - unless screenshot.approved
    - if can?(:approve, screenshot)
      a.button.small.success[
        href=approve_screenshot_path(screenshot.id)
        method='post'
        ] #{icon('check')} Approve

    / Display additional information to admins
    / p Status: #{screenshot.adminstatus}
    / p Uploader IP=#{screenshot.uploaderip}
    / p Uploader Token=#{session[:token]}
    / p Uploaded #{time_ago_in_words(screenshot.created_at)} ago (#{screenshot.created_at})
