Admin tables: scroll containers and phone cards; Alerts list flags missing media
Test and Release / test (push) Successful in 1m26s
Test and Release / release (push) Successful in 5s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
shadowdaoandClaude Sonnet 5.5 committed 2026-11-15 13:59:20 -08:00
1 parent afa768fa42
commit fb200594ce
8 files changed
+190 -54

No files matched your search

+14 -14
View File
@@ -55,17 +55,17 @@ final class ActionsPage {
if ( ! $queued ) {
echo '<p>Nothing in the queue. When a donation triggers a reward, it shows up here.</p>';
} else {
echo '<table class="widefat striped sg-table"><thead><tr><th>Donor</th><th>Amount</th><th>Reward</th><th>Time</th><th>Message</th><th></th></tr></thead><tbody>';
echo Admin::tableOpen( array( 'Donor', 'Amount', 'Reward', 'Time', 'Message', '' ), 'Reward queue' );
foreach ( $queued as $e ) {
echo '<tr><td>' . esc_html( Format::donorName( $e ) ) . '</td>';
echo '<td>' . esc_html( Format::money( (int) ( $e['base_minor'] ?? 0 ), Format::currency( $e['currency'] ?? $cur ) ) ) . '</td>';
echo '<td><strong>' . esc_html( (string) $e['title'] ) . '</strong> &times; ' . (int) $e['times'] . '</td>';
echo '<td>' . esc_html( self::when( (string) $e['created_at'] ) ) . '</td>';
echo '<td>' . esc_html( (string) ( $e['message'] ?? '' ) ) . '</td><td>';
echo '<tr>' . Admin::td( 'Donor' ) . esc_html( Format::donorName( $e ) ) . '</td>';
echo Admin::td( 'Amount' ) . esc_html( Format::money( (int) ( $e['base_minor'] ?? 0 ), Format::currency( $e['currency'] ?? $cur ) ) ) . '</td>';
echo Admin::td( 'Reward' ) . '<strong>' . esc_html( (string) $e['title'] ) . '</strong> &times; ' . (int) $e['times'] . '</td>';
echo Admin::td( 'Time' ) . esc_html( self::when( (string) $e['created_at'] ) ) . '</td>';
echo Admin::td( 'Message' ) . esc_html( (string) ( $e['message'] ?? '' ) ) . '</td>' . Admin::td( '', 'sg-actions' );
Admin::form( 'sg_event_done', array( 'event_id' => (int) $e['id'] ), 'sg-inline' );
echo '<button class="button button-primary">Mark done</button></form></td></tr>';
}
echo '</tbody></table>';
echo Admin::tableClose();
Admin::form( 'sg_event_done_all' );
echo '<p><button class="button">Mark all done</button></p></form>';
}
@@ -104,17 +104,17 @@ final class ActionsPage {
echo '<p>No rewards yet.</p></div>';
return;
}
echo '<table class="widefat striped sg-table"><thead><tr><th>Reward</th><th>Amount</th><th>Triggers</th><th>Applies to</th><th>Order</th><th>Actions</th></tr></thead><tbody>';
echo Admin::tableOpen( array( 'Reward', 'Amount', 'Triggers', 'Applies to', 'Order', 'Actions' ), 'Reward menu' );
foreach ( $actions as $a ) {
$id = (int) $a['id'];
echo '<tr' . ( $a['enabled'] ? '' : ' class="sg-off"' ) . '><td><strong>' . esc_html( $a['title'] ) . '</strong>';
echo '<tr' . ( $a['enabled'] ? '' : ' class="sg-off"' ) . '>' . Admin::td( 'Reward' ) . '<strong>' . esc_html( $a['title'] ) . '</strong>';
if ( '' !== $a['description'] ) {
echo '<br><span class="description">' . esc_html( $a['description'] ) . '</span>';
}
echo '</td><td>' . esc_html( Format::money( $a['amount_minor'], $cur ) ) . '</td>';
echo '<td>' . esc_html( Matcher::EVERY === $a['mode'] ? 'Every time it adds up' : 'Exactly this amount' ) . '</td>';
echo '<td>' . esc_html( 0 === $a['goal_id'] ? 'All goals' : ( $goals[ $a['goal_id'] ] ?? 'Goal #' . $a['goal_id'] ) ) . '</td>';
echo '<td>' . (int) $a['sort'] . '</td><td class="sg-actions">';
echo '</td>' . Admin::td( 'Amount' ) . esc_html( Format::money( $a['amount_minor'], $cur ) ) . '</td>';
echo Admin::td( 'Triggers' ) . esc_html( Matcher::EVERY === $a['mode'] ? 'Every time it adds up' : 'Exactly this amount' ) . '</td>';
echo Admin::td( 'Applies to' ) . esc_html( 0 === $a['goal_id'] ? 'All goals' : ( $goals[ $a['goal_id'] ] ?? 'Goal #' . $a['goal_id'] ) ) . '</td>';
echo Admin::td( 'Order' ) . (int) $a['sort'] . '</td>' . Admin::td( 'Actions', 'sg-actions' );
echo '<a class="button" href="' . esc_url( self::url( array( 'edit' => $id ) ) ) . '">Edit</a> ';
Admin::form( 'sg_action_toggle', array( 'action_id' => $id, 'enabled' => $a['enabled'] ? 0 : 1 ), 'sg-inline' );
echo '<button class="button">' . ( $a['enabled'] ? 'Turn off' : 'Turn on' ) . '</button></form> ';
@@ -122,7 +122,7 @@ final class ActionsPage {
echo '<button class="button button-link-delete" data-confirm="Delete this reward? Rewards already waiting in the queue stay there.">Delete</button></form>';
echo '</td></tr>';
}
echo '</tbody></table></div>';
echo Admin::tableClose() . '</div>';
}
private static function renderForm( int $id ): void {