Library - Source Excerpt 04
Summary
This source excerpt preserves a bounded section of Spiralist/wp-content/plugins/spiralist-workspace/templates/library.php so readers can inspect the evidence without opening the full source file.
**Source path:** Spiralist/wp-content/plugins/spiralist-workspace/templates/library.php
<h2 class="spiralist-section-title"><?php echo esc_html((string) ((int) ($moderation_counts['peer_reviewed'] ?? 0) + (int) ($moderation_counts['official_canon'] ?? 0))); ?></h2>
<p class="spiralist-muted">Public records that have reached peer-reviewed or official-canon moderation state.</p>
</article>
</div>
</div>
</section>
<section class="spiralist-page-section">
<div class="spiralist-shell spiralist-grid spiralist-grid--split">
<article class="spiralist-panel">
<p class="spiralist-section-tag">Filters</p>
<h2 class="spiralist-section-title"><?php echo esc_html((string) ($filters_active ? $filtered_count : $all_count)); ?> public prompt manuscripts.</h2>
<p class="spiralist-muted"><?php echo esc_html($filters_active ? 'Showing prompts that match the current filters.' : 'Browse the full library or narrow it by lane, provenance, risk, and function.'); ?></p>
<form id="prompt-library-filters" class="spiralist-workspace-form" method="get" action="<?php echo esc_url($route_url('prompts')); ?>" data-public-form="prompt-library-filters" data-engagement-submit="advanced_layer_open" data-engagement-surface="prompt-library" data-engagement-target="expert-filters">
<div class="spiralist-workspace-input-grid">
<label class="spiralist-form__field">
<span>Intent</span>
<select name="intent">
<option value="">All intents</option>
<?php foreach ($intent_records as $intent_record) : ?>
<?php $intent_value = (string) ($intent_record['value'] ?? ''); ?>
<option value="<?php echo esc_attr($intent_value); ?>" <?php selected((string) ($filters['intent'] ?? ''), $intent_value); ?>><?php echo esc_html((string) ($intent_record['label'] ?? $intent_value)); ?></option>
<?php endforeach; ?>
</select>
</label>
<label class="spiralist-form__field">
<span>Search</span>
<input type="text" name="search" value="<?php echo esc_attr((string) ($filters['search'] ?? '')); ?>" placeholder="title, summary, symbol, note" />
</label>
<label class="spiralist-form__field">
<span>Lane</span>
<select name="lane">
<option value="">All lanes</option>
<?php foreach ($lane_labels as $value => $label) : ?>
<option value="<?php echo esc_attr($value); ?>" <?php selected((string) ($filters['lane'] ?? ''), $value); ?>><?php echo esc_html($label); ?></option>
<?php endforeach; ?>
</select>
</label>
<label class="spiralist-form__field">
<span>Provenance</span>
<select name="provenance">
<option value="">All provenance</option>
<?php foreach ($provenance_labels as $value => $label) : ?>
<option value="<?php echo esc_attr($value); ?>" <?php selected((string) ($filters['provenance'] ?? ''), $value); ?>><?php echo esc_html($label); ?></option>
<?php endforeach; ?>
</select>
</label>
<label class="spiralist-form__field">
<span>Review State</span>
<select name="moderation_status">
<option value="">All public states</option>
<?php foreach ($moderation_labels as $value => $label) : ?>
<option value="<?php echo esc_attr($value); ?>" <?php selected((string) ($filters['moderation_status'] ?? ''), $value); ?>><?php echo esc_html($label); ?></option>
<?php endforeach; ?>
</select>
</label>
</div>
<div class="spiralist-workspace-input-grid">
<label class="spiralist-form__field">
<span>Category</span>
<select name="category">
<option value="">All categories</option>
<?php foreach ($categories as $category_record) : ?>
<?php $category = (string) ($category_record['category'] ?? ''); ?>
<option value="<?php echo esc_attr($category); ?>" <?php selected((string) ($filters['category'] ?? ''), $category); ?>><?php echo esc_html($category); ?></option>
<?php endforeach; ?>
</select>
</label>
<label class="spiralist-form__field">
<span>Risk</span>
<select name="risk">
<option value="">All risk labels</option>
<?php foreach ($risk_labels as $value => $label) : ?>
<option value="<?php echo esc_attr($value); ?>" <?php selected((string) ($filters['risk'] ?? ''), $value); ?>><?php echo esc_html($label); ?></option>
<?php endforeach; ?>
</select>
</label>
<label class="spiralist-form__field">
<span>Function</span>
<select name="function">
<option value="">All functions</option>
<?php foreach ($function_labels as $value => $label) : ?>
<option value="<?php echo esc_attr($value); ?>" <?php selected((string) ($filters['function'] ?? ''), $value); ?>><?php echo esc_html($label); ?></option>
<?php endforeach; ?>
</select>
</label>
<label class="spiralist-form__field">
<span>Level</span>
<select name="level">
<option value="">All levels</option>
<?php foreach ($level_labels as $value => $label) : ?>
<option value="<?php echo esc_attr($value); ?>" <?php selected((string) ($filters['level'] ?? ''), $value); ?>><?php echo esc_html($label); ?></option>
<?php endforeach; ?>
</select>
</label>
</div>
<div class="spiralist-cta-row spiralist-cta-row--start">
<button class="spiralist-button spiralist-button--primary" type="submit">Apply Filters</button>
<a class="spiralist-button spiralist-button--secondary" href="<?php echo esc_url($route_url('prompts')); ?>" data-engagement-event="advanced_layer_open" data-engagement-surface="prompt-library" data-engagement-target="reset-filters">Reset</a>
</div>
</form>
</article>
<article class="spiralist-panel">
<p class="spiralist-section-tag">Safety Center</p>
<h2 class="spiralist-section-title">Read symbolic prompts with guardrails.</h2>
<p class="spiralist-muted">Spiralist.org distinguishes practical prompting from archive records. High-risk symbolic forms are documented with provenance and warnings instead of being presented as ordinary task defaults.</p>
<div class="spiralist-chip-row spiralist-chip-row--dense">
<?php foreach ((array) ($facets['risk_labels'] ?? []) as $record) : ?>
<span class="spiralist-chip spiralist-chip--risk"><?php echo esc_html((string) ($record['label'] ?? '')); ?></span>
<?php endforeach; ?>
</div>
<p class="spiralist-muted">Archive does not equal endorsement. Official canon prompts should remain grounded, inspectable, and explicit about uncertainty.</p>
</article>
</div>
</section>