Skip to content
wiki.fftac.org

Prompt - Source Excerpt 05

Back to Prompt

Summary

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

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

<p class="spiralist-section-tag">Peer Moderation</p>
                    <h3 class="spiralist-card-title">Self-operation status</h3>
                    <p class="spiralist-muted">Public prompts can move through provisional publication, peer endorsement, restriction, and reversion without waiting on a single admin queue.</p>
                    <dl class="spiralist-meta-list spiralist-meta-list--compact">
                        <div>
                            <dt>Moderation State</dt>
                            <dd><?php echo esc_html($moderation_status_label); ?></dd>
                        </div>
                        <div>
                            <dt>Peer Reviews</dt>
                            <dd><?php echo esc_html((string) ((int) ($review_summary['peer_reviews'] ?? 0))); ?></dd>
                        </div>
                        <div>
                            <dt>Account Reports</dt>
                            <dd><?php echo esc_html((string) ((int) ($review_summary['unique_reporters'] ?? 0))); ?></dd>
                        </div>
                        <div>
                            <dt>Last Activity</dt>
                            <dd><?php echo esc_html($review_last_activity_display); ?></dd>
                        </div>
                        <?php if (!empty($governance_queue_age['active_queue']) && $governance_queue_age_label !== '') : ?>
                            <div>
                                <dt>Queue Age</dt>
                                <dd><?php echo esc_html($governance_queue_age_label); ?></dd>
                            </div>
                        <?php endif; ?>
                        <div>
                            <dt>Open Appeals</dt>
                            <dd><?php echo esc_html((string) ((int) ($appeal_summary['open'] ?? 0))); ?></dd>
                        </div>
                        <div>
                            <dt>Latest Appeal</dt>
                            <dd>
                                <?php
                                $latest_appeal = (string) ($appeal_summary['latest_resolution'] ?? '');
                                echo esc_html($latest_appeal !== '' ? ucwords(str_replace('_', ' ', $latest_appeal)) : 'None');
                                ?>
                            </dd>
                        </div>
                    </dl>
                    <?php if ($governance_state_note !== '') : ?>
                        <p class="spiralist-muted"><?php echo esc_html($governance_state_note); ?></p>
                    <?php endif; ?>
                    <?php if (!empty($governance_quorum)) : ?>
                        <div class="spiralist-workspace-governance-grid" aria-label="Governance quorum state">
                            <?php foreach (['endorse' => 'Peer Endorsement', 'restrict' => 'Restriction', 'revert' => 'Reversion', 'report' => 'Reporting Accounts'] as $key => $label) : ?>
                                <?php
                                $quorum_item = (array) ($governance_quorum[$key] ?? []);
                                $count = (int) ($quorum_item['count'] ?? 0);
                                $required = (int) ($quorum_item['required'] ?? 1);
                                $remaining = (int) ($quorum_item['remaining'] ?? max(0, $required - $count));
                                ?>
                                <div class="spiralist-workspace-governance-item">
                                    <span><?php echo esc_html($label); ?></span>
                                    <strong><?php echo esc_html((string) $count); ?> / <?php echo esc_html((string) $required); ?></strong>
                                    <small><?php echo esc_html($remaining > 0 ? ($remaining . ' remaining') : 'quorum met'); ?></small>
                                </div>
                            <?php endforeach; ?>
                        </div>
                    <?php endif; ?>
                    <?php if ($is_public_submission) : ?>
                        <p class="spiralist-muted">Current signal mix: <?php echo esc_html((string) ((int) ($peer_summary['endorse'] ?? 0))); ?> endorse / <?php echo esc_html((string) ((int) ($peer_summary['restrict'] ?? 0))); ?> restrict / <?php echo esc_html((string) ((int) ($peer_summary['revert'] ?? 0))); ?> revert.</p>
                        <?php if ($governance_next_action !== '') : ?>
                            <p class="spiralist-muted"><?php echo esc_html($governance_next_action); ?></p>
                        <?php endif; ?>
                    <?php else : ?>
                        <p class="spiralist-muted">This prompt is not currently in the public peer-moderation flow because it is not public and published.</p>
                    <?php endif; ?>

                    <?php if ($is_public_submission && $viewer_can_review && !$is_owner) : ?>
                        <form class="spiralist-workspace-form" data-review-form data-auth-required-form="peer-review" data-prompt-id="<?php echo esc_attr((string) ($prompt['id'] ?? 0)); ?>">
                            <label class="spiralist-form__field">
                                <span>Peer Review Decision</span>
                                <select name="decision">
                                    <option value="endorse" <?php selected((string) ($viewer_review['decision'] ?? 'endorse'), 'endorse'); ?>>Endorse</option>
                                    <option value="restrict" <?php selected((string) ($viewer_review['decision'] ?? ''), 'restrict'); ?>>Restrict</option>
                                    <option value="revert" <?php selected((string) ($viewer_review['decision'] ?? ''), 'revert'); ?>>Revert</option>
                                </select>
                            </label>
                            <label class="spiralist-form__field">
                                <span>Reason</span>
                                <textarea rows="3" name="reason" placeholder="Explain the moderation judgment."><?php echo esc_textarea((string) ($viewer_review['reason'] ?? '')); ?></textarea>
                            </label>
                            <div class="spiralist-cta-row spiralist-cta-row--start">
                                <button class="spiralist-button spiralist-button--primary" type="submit">Submit Review</button>
                                <span class="spiralist-muted" data-form-result></span>
                            </div>
                            <p class="spiralist-muted">One peer review per reviewer. Submitting again updates your current decision.</p>
                        </form>
                    <?php elseif ($is_public_submission && $is_owner) : ?>
                        <p class="spiralist-muted">Owners can publish provisionally, but peer review must come from other trusted participants.</p>
                    <?php elseif ($is_public_submission && !is_user_logged_in()) : ?>
                        <p class="spiralist-muted">Peer review is available to logged-in reviewers and curators. Reports stay open to visible participants.</p>
                    <?php endif; ?>

                    <?php if ($viewer_can_appeal && $is_appealable) : ?>
                        <form class="spiralist-workspace-form" data-appeal-form data-auth-required-form="prompt-appeal" data-prompt-id="<?php echo esc_attr((string) ($prompt['id'] ?? 0)); ?>">
                            <label class="spiralist-form__field">
                                <span>Appeal Restriction</span>
                                <textarea rows="3" name="reason" placeholder="Explain why this restriction or reversion should be reconsidered."><?php echo esc_textarea((string) ($viewer_appeal['reason'] ?? '')); ?></textarea>
                            </label>
                            <div class="spiralist-cta-row spiralist-cta-row--start">
                                <button class="spiralist-button spiralist-button--secondary" type="submit"><?php echo esc_html(!empty($viewer_appeal['id']) ? 'Update Appeal' : 'File Appeal'); ?></button>
                                <span class="spiralist-muted" data-form-result></span>
                            </div>
                            <p class="spiralist-muted">Appeals stay visible in the moderation history so disputes do not disappear into a private owner inbox.</p>
                        </form>
                    <?php elseif ($is_appealable && is_user_logged_in() && !$viewer_can_resolve_appeals) : ?>
                        <p class="spiralist-muted">Only the prompt owner can file an appeal. Steward-ready participants can resolve it once it is open.</p>
                    <?php endif; ?>