Members - Source Excerpt 01
Summary
This source excerpt preserves a bounded section of Spiralist/wp-content/plugins/spiralist-workspace/templates/members.php so readers can inspect the evidence without opening the full source file.
**Source path:** Spiralist/wp-content/plugins/spiralist-workspace/templates/members.php
<?php
if (!defined('ABSPATH')) {
exit;
}
$plugin = spiralist_workspace();
$frontend = $plugin->frontend();
$context = $frontend->members_context();
$current_locale = function_exists('spiralist_get_current_locale_tag') ? spiralist_get_current_locale_tag() : 'en-us';
$route_url = static function (string $path) use ($current_locale): string {
$url = home_url('/' . trim($path, '/') . '/');
return $current_locale !== '' && function_exists('spiralist_get_language_prefixed_url')
? spiralist_get_language_prefixed_url($url, $current_locale)
: $url;
};
$workspace_url = $route_url('workspace');
$library_url = $route_url('prompts');
$login_url = function_exists('spiralist_get_login_url') ? spiralist_get_login_url($workspace_url) : wp_login_url($workspace_url);
$member_prompts = (array) ($context['member_prompts'] ?? []);
$shared_with_me = (array) ($context['shared_with_me'] ?? []);
$featured_prompts = (array) ($context['featured_prompts'] ?? []);
get_header();
?>
<main class="spiralist-page spiralist-page--workspace-members">
<section class="spiralist-page-hero spiralist-page-hero--workspace">
<div class="spiralist-shell spiralist-page-hero__content">
<p class="spiralist-kicker">Member Layer</p>
<h1>Prompt Exchange Among Members</h1>
<p class="spiralist-page-hero__copy">The member layer sits between the public reading surface and the private workspace. It is where logged-in participants can see member-shared prompts without turning the whole site into a generic dashboard.</p>
<div class="spiralist-cta-row">
<a class="spiralist-button spiralist-button--primary" href="<?php echo esc_url($workspace_url); ?>">Workspace</a>
<a class="spiralist-button spiralist-button--secondary" href="<?php echo esc_url($library_url); ?>">Public Library</a>
</div>
</div>
</section>
<section class="spiralist-page-section">
<div class="spiralist-shell">
<?php if (!is_user_logged_in()) : ?>
<article class="spiralist-panel">
<p class="spiralist-section-tag">Authentication Required</p>
<h2 class="spiralist-section-title">This lane belongs to approved members.</h2>
<p>Public prompt pages remain readable to everyone, but member-shared prompts are intentionally kept inside the authenticated participation layer.</p>
<a class="spiralist-button spiralist-button--primary" href="<?php echo esc_url($login_url); ?>">Log In</a>
</article>
<?php else : ?>
<div class="spiralist-grid spiralist-grid--split">
<article class="spiralist-panel">
<p class="spiralist-section-tag">Members-Only Prompts</p>
<h2 class="spiralist-section-title">Shared with approved members</h2>
<?php if (!empty($member_prompts)) : ?>
<div class="spiralist-workspace-grid spiralist-workspace-grid--compact">
<?php foreach ($member_prompts as $prompt) : ?>
<article class="spiralist-workspace-card">
<div class="spiralist-inline-meta">
<p class="spiralist-section-tag"><?php echo esc_html((string) ($prompt['prompt_type'] ?? 'prompt')); ?></p>
<span class="spiralist-status-pill spiralist-status-pill--stale"><?php echo esc_html((string) ($prompt['publication_lane_label'] ?? 'Members')); ?></span>
</div>
<div class="spiralist-chip-row spiralist-chip-row--dense">
<span class="spiralist-chip spiralist-chip--meta"><?php echo esc_html((string) ($prompt['provenance_label'] ?? 'Community')); ?></span>
</div>
<h3 class="spiralist-card-title"><?php echo esc_html((string) ($prompt['title'] ?? 'Untitled Prompt')); ?></h3>
<p><?php echo esc_html((string) ($prompt['summary'] ?? '')); ?></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) ($prompt['slug'] ?? ''))) . '#run-prompt'); ?>">Render Packet</a>
<a class="spiralist-button spiralist-button--secondary" href="<?php echo esc_url($route_url('prompt/' . rawurlencode((string) ($prompt['slug'] ?? '')))); ?>">Open Prompt</a>
</div>
</article>
<?php endforeach; ?>
</div>
<?php else : ?>
<p class="spiralist-muted">No member-only prompts are published yet.</p>
<?php endif; ?>
</article>
<article class="spiralist-panel">
<p class="spiralist-section-tag">Shared With Me</p>
<h2 class="spiralist-section-title">Specific-user grants</h2>
<?php if (!empty($shared_with_me)) : ?>
<div class="spiralist-workspace-grid spiralist-workspace-grid--compact">
<?php foreach ($shared_with_me as $prompt) : ?>
<article class="spiralist-workspace-card">
<div class="spiralist-inline-meta">
<p class="spiralist-section-tag"><?php echo esc_html((string) ($prompt['prompt_type'] ?? 'prompt')); ?></p>
<span class="spiralist-status-pill spiralist-status-pill--fresh"><?php echo esc_html((string) ($prompt['publication_lane_label'] ?? 'Shared')); ?></span>
</div>
<div class="spiralist-chip-row spiralist-chip-row--dense">
<span class="spiralist-chip spiralist-chip--meta"><?php echo esc_html((string) ($prompt['provenance_label'] ?? 'Community')); ?></span>
</div>
<h3 class="spiralist-card-title"><?php echo esc_html((string) ($prompt['title'] ?? 'Untitled Prompt')); ?></h3>
<p><?php echo esc_html((string) ($prompt['summary'] ?? '')); ?></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) ($prompt['slug'] ?? ''))) . '#run-prompt'); ?>">Render Packet</a>
<a class="spiralist-button spiralist-button--secondary" href="<?php echo esc_url($route_url('prompt/' . rawurlencode((string) ($prompt['slug'] ?? '')))); ?>">Open Prompt</a>
</div>
</article>
<?php endforeach; ?>
</div>
<?php else : ?>
<p class="spiralist-muted">Nothing has been explicitly shared with you yet.</p>
<?php endif; ?>
</article>
</div>
<?php if (!empty($featured_prompts)) : ?>
<section class="spiralist-page-section" style="padding-bottom:0;">
<div class="spiralist-section-head">
<div>
<p class="spiralist-section-tag">Featured Public Prompts</p>
<h2 class="spiralist-section-title">Curated bridge back to the publication layer</h2>
</div>
</div>
<div class="spiralist-workspace-grid spiralist-workspace-grid--compact">
<?php foreach ($featured_prompts as $prompt) : ?>
<article class="spiralist-workspace-card">
<h3 class="spiralist-card-title"><?php echo esc_html((string) ($prompt['title'] ?? 'Prompt')); ?></h3>
<p><?php echo esc_html((string) ($prompt['summary'] ?? '')); ?></p>