Change how invalid-but-not-expired invites are shown in moderation interface (#38736)

This commit is contained in:
Claire 2026-05-04 13:38:11 +02:00 committed by GitHub
parent ff99131776
commit 030104a30c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,21 +10,23 @@
= image_tag invite.user.account.avatar.url(:original), alt: '', width: 16, height: 16, class: 'avatar'
%span.username= invite.user.account.username
%td
= material_symbol 'person'
= invite.uses
= " / #{invite.max_uses}" unless invite.max_uses.nil?
- if invite.valid_for_use?
%td
= material_symbol 'person'
= invite.uses
= " / #{invite.max_uses}" unless invite.max_uses.nil?
%td
- if invite.expires_at.nil?
- else
%time.formatted{ datetime: invite.expires_at.iso8601, title: l(invite.expires_at) }
= l invite.expires_at
- else
%td
= table_link_to 'close', t('invites.delete'), admin_invite_path(invite), method: :delete if policy(invite).destroy?
- elsif invite.expired?
%td{ colspan: 2 }
= t('invites.expired')
%td
- if invite.valid_for_use? && policy(invite).destroy?
= table_link_to 'close', t('invites.delete'), admin_invite_path(invite), method: :delete
- else
%td{ colspan: 2 }
= t('invites.invalid')