_invite.html.haml 978 B

123456789101112131415161718192021222324252627282930
  1. %tr
  2. %td
  3. .input-copy
  4. .input-copy__wrapper
  5. %input{ type: :text, maxlength: '999', spellcheck: 'false', readonly: 'true', value: public_invite_url(invite_code: invite.code) }
  6. %button{ type: :button }= t('generic.copy')
  7. %td
  8. .name-tag
  9. = image_tag invite.user.account.avatar.url(:original), alt: '', width: 16, height: 16, class: 'avatar'
  10. %span.username= invite.user.account.username
  11. - if invite.valid_for_use?
  12. %td
  13. = fa_icon 'user fw'
  14. = invite.uses
  15. = " / #{invite.max_uses}" unless invite.max_uses.nil?
  16. %td
  17. - if invite.expires_at.nil?
  18. - else
  19. %time.formatted{ datetime: invite.expires_at.iso8601, title: l(invite.expires_at) }
  20. = l invite.expires_at
  21. - else
  22. %td{ colspan: 2 }
  23. = t('invites.expired')
  24. %td
  25. - if invite.valid_for_use? && policy(invite).destroy?
  26. = table_link_to 'times', t('invites.delete'), admin_invite_path(invite), method: :delete