Merge pull request 'Add multi-use group invite links with expiry and auto-approval on email confirmation' (#83) from feature/group-invite-links into main
CI / Tests (PHP 8.1) (push) Successful in 38s
CI / Tests (PHP 8.2) (push) Successful in 43s
CI / No Debug Code (push) Successful in 2s
CI / Coding Standards (push) Successful in 2m50s
CI / PHPStan (push) Successful in 2m49s
CI / Tests (PHP 8.3) (push) Successful in 2m38s
CI / Build Plugin Zip (push) Successful in 2m47s
CI / Tests (PHP 8.1) (push) Successful in 38s
CI / Tests (PHP 8.2) (push) Successful in 43s
CI / No Debug Code (push) Successful in 2s
CI / Coding Standards (push) Successful in 2m50s
CI / PHPStan (push) Successful in 2m49s
CI / Tests (PHP 8.3) (push) Successful in 2m38s
CI / Build Plugin Zip (push) Successful in 2m47s
Reviewed-on: #83
This commit was merged in pull request #83.
This commit is contained in:
@@ -66,6 +66,23 @@ if (! defined('ABSPATH')) {
|
||||
<?php submit_button(esc_html__('Generate Invitation Link', 'unsupervised-schedular')); ?>
|
||||
</form>
|
||||
|
||||
<h2><?php esc_html_e('Group Invite Link', 'unsupervised-schedular'); ?></h2>
|
||||
<p class="description"><?php esc_html_e('Generate a shareable link (e.g. for a newsletter). Anyone with the link can register until it expires: they enter their own email and must confirm it, but no admin approval is needed afterwards.', 'unsupervised-schedular'); ?></p>
|
||||
<form method="post">
|
||||
<?php wp_nonce_field('usc_invite_action'); ?>
|
||||
<input type="hidden" name="usc_action" value="group_invite">
|
||||
<table class="form-table">
|
||||
<tr>
|
||||
<th><label for="expires_at"><?php esc_html_e('Expires on', 'unsupervised-schedular'); ?></label></th>
|
||||
<td>
|
||||
<input type="date" name="expires_at" id="expires_at" required min="<?php echo esc_attr((string) current_time('Y-m-d')); ?>">
|
||||
<p class="description"><?php esc_html_e('The link stops working at the end of this day.', 'unsupervised-schedular'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php submit_button(esc_html__('Generate Group Link', 'unsupervised-schedular')); ?>
|
||||
</form>
|
||||
|
||||
<h2><?php esc_html_e('Pending Invites', 'unsupervised-schedular'); ?></h2>
|
||||
|
||||
<?php if (empty($pendingInvites)) : ?>
|
||||
@@ -74,8 +91,9 @@ if (! defined('ABSPATH')) {
|
||||
<table class="wp-list-table widefat fixed striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php esc_html_e('Email', 'unsupervised-schedular'); ?></th>
|
||||
<th><?php esc_html_e('Invited', 'unsupervised-schedular'); ?></th>
|
||||
<th><?php esc_html_e('Invite', 'unsupervised-schedular'); ?></th>
|
||||
<th><?php esc_html_e('Created', 'unsupervised-schedular'); ?></th>
|
||||
<th><?php esc_html_e('Expires', 'unsupervised-schedular'); ?></th>
|
||||
<th><?php esc_html_e('Actions', 'unsupervised-schedular'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -84,7 +102,7 @@ if (! defined('ABSPATH')) {
|
||||
<?php foreach ($pendingInvites as $invite) : ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo esc_html($invite->email); ?>
|
||||
<?php echo $invite->isGroup() ? esc_html__('Group link', 'unsupervised-schedular') : esc_html($invite->email); ?>
|
||||
<?php if ($invite->isExpired($now)) : ?>
|
||||
<span class="us-invite-expired" style="color:#b32d2e;">— <?php esc_html_e('expired', 'unsupervised-schedular'); ?></span>
|
||||
<?php endif; ?>
|
||||
@@ -92,6 +110,9 @@ if (! defined('ABSPATH')) {
|
||||
<td>
|
||||
<?php echo esc_html((string) $invite->createdAt); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo esc_html($invite->expiresAt !== null ? (string) mysql2date('M j, Y', $invite->expiresAt) : '—'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<form method="post" style="display:inline;">
|
||||
<?php wp_nonce_field('usc_invite_action'); ?>
|
||||
|
||||
Reference in New Issue
Block a user