Skip to content
wiki.fftac.org

Workspace - Source Excerpt 06

Back to Workspace

Summary

This source excerpt preserves a bounded section of Spiralist/wp-content/plugins/spiralist-workspace/templates/workspace.php so readers can inspect the evidence without opening the full source file.

**Source path:** Spiralist/wp-content/plugins/spiralist-workspace/templates/workspace.php

<?php echo esc_html((string) ((int) ($peer['revert'] ?? 0))); ?> revert /
                                                <?php echo esc_html((string) ((int) ($summary['unique_reporters'] ?? 0))); ?> reporting accounts
                                            </p>
                                            <?php if (!empty($governance['next_action_label'])) : ?>
                                                <p class="spiralist-muted"><?php echo esc_html((string) $governance['next_action_label']); ?></p>
                                            <?php endif; ?>
                                            <?php if (!empty($queue_age['active_queue']) && !empty($queue_age['label'])) : ?>
                                                <p class="spiralist-muted">Queue age: <?php echo esc_html((string) $queue_age['label']); ?></p>
                                            <?php endif; ?>
                                            <?php if (!empty($viewer_review['decision'])) : ?>
                                                <p class="spiralist-muted">Your current review: <?php echo esc_html((string) $viewer_review['decision']); ?>.</p>
                                            <?php endif; ?>
                                            <div class="spiralist-cta-row spiralist-cta-row--start">
                                                <a class="spiralist-button spiralist-button--primary" href="<?php echo esc_url($route_url('prompt/' . rawurlencode((string) ($record['slug'] ?? ''))) . '#peer-moderation'); ?>">Review Prompt</a>
                                                <a class="spiralist-button spiralist-button--secondary" href="<?php echo esc_url($route_url('prompt/' . rawurlencode((string) ($record['slug'] ?? '')))); ?>">Open Dossier</a>
                                            </div>
                                        </div>
                                    <?php endforeach; ?>
                                </div>
                            <?php else : ?>
                                <p class="spiralist-muted">No public prompts currently need reviewer action.</p>
                            <?php endif; ?>
                        </article>
                    </div>
                <?php endif; ?>

                <?php if ($can_resolve_prompt_appeals) : ?>
                    <div class="spiralist-grid spiralist-grid--split" style="margin-top:1.5rem;">
                        <article class="spiralist-panel">
                            <p class="spiralist-section-tag">Steward Appeals</p>
                            <h2 class="spiralist-section-title">Dispute queue</h2>
                            <p class="spiralist-muted">Appeals keep moderation reversible. Stewards can restore provisional visibility, deny an appeal, or archive a prompt without routing everything through one admin.</p>
                            <div class="spiralist-stat-grid">
                                <div class="spiralist-stat">
                                    <strong><?php echo esc_html((string) ((int) ($appeal_queue_counts['total'] ?? 0))); ?></strong>
                                    <span>Open appeals</span>
                                </div>
                                <div class="spiralist-stat">
                                    <strong><?php echo esc_html((string) ((int) ($appeal_queue_counts['restricted_review'] ?? 0))); ?></strong>
                                    <span>Restricted review</span>
                                </div>
                                <div class="spiralist-stat">
                                    <strong><?php echo esc_html((string) ((int) ($appeal_queue_counts['reverted'] ?? 0))); ?></strong>
                                    <span>Reverted</span>
                                </div>
                            </div>
                        </article>

                        <article class="spiralist-panel">
                            <p class="spiralist-section-tag">Needs Steward Action</p>
                            <h2 class="spiralist-section-title">Open appeals</h2>
                            <?php if (!empty($appeal_queue)) : ?>
                                <div class="spiralist-simple-list">
                                    <?php foreach ($appeal_queue as $item) : ?>
                                        <?php
                                        $appeal = (array) ($item['appeal'] ?? []);
                                        $record = (array) ($item['prompt'] ?? []);
                                        ?>
                                        <div class="spiralist-simple-list__item">
                                            <strong><?php echo esc_html((string) ($record['title'] ?? 'Prompt')); ?></strong>
                                            <span class="spiralist-simple-list__meta">
                                                <?php echo esc_html((string) ($record['moderation_status_label'] ?? 'Draft')); ?> /
                                                <?php echo esc_html((string) ($appeal['updated_utc'] ?? '')); ?>
                                            </span>
                                            <p class="spiralist-muted">
                                                Appeal from <?php echo esc_html((string) (($appeal['appellant_label'] ?? '') !== '' ? $appeal['appellant_label'] : ('Participant #' . (int) ($appeal['appellant_user_id'] ?? 0)))); ?>:
                                                <?php echo esc_html((string) ($appeal['reason'] ?? 'No reason provided.')); ?>
                                            </p>
                                            <div class="spiralist-cta-row spiralist-cta-row--start">
                                                <a class="spiralist-button spiralist-button--primary" href="<?php echo esc_url($route_url('prompt/' . rawurlencode((string) ($record['slug'] ?? ''))) . '#peer-moderation'); ?>">Resolve Appeal</a>
                                                <a class="spiralist-button spiralist-button--secondary" href="<?php echo esc_url($route_url('prompt/' . rawurlencode((string) ($record['slug'] ?? '')))); ?>">Open Dossier</a>
                                            </div>
                                        </div>
                                    <?php endforeach; ?>
                                </div>
                            <?php else : ?>
                                <p class="spiralist-muted">No open appeals currently need steward action.</p>
                            <?php endif; ?>
                        </article>
                    </div>
                <?php endif; ?>

                <div class="spiralist-grid spiralist-grid--split" style="margin-top:1.5rem;">
                    <article class="spiralist-panel">
                        <p class="spiralist-section-tag">My Prompts</p>
                        <h2 class="spiralist-section-title">Owned prompt manuscripts</h2>
                        <?php
                        $render_prompt_cards(
                            $my_prompts,
                            'No prompts yet. Start with the authoring panel above.',
                            fn(array $record): array => [
                                [
                                    'label' => 'Edit',
                                    'url' => $route_url('workspace', ['edit_prompt' => (int) ($record['id'] ?? 0)]),
                                    'class' => 'spiralist-button--primary',
                                ],
                                [
                                    'label' => 'Open',
                                    'url' => $route_url('prompt/' . rawurlencode((string) ($record['slug'] ?? ''))),
                                    'class' => 'spiralist-button--secondary',
                                ],
                                [
                                    'label' => 'Render Packet',
                                    'url' => $route_url('prompt/' . rawurlencode((string) ($record['slug'] ?? ''))) . '#run-prompt',
                                    'class' => 'spiralist-button--tertiary',
                                ],
                            ]
                        );
                        ?>
                    </article>

                    <article class="spiralist-panel">
                        <p class="spiralist-section-tag">Drafts</p>
                        <h2 class="spiralist-section-title">Unpublished work</h2>
                        <?php
                        $render_prompt_cards(
                            $drafts,
                            'No drafts are currently waiting in your workspace.',