Skip to content
wiki.fftac.org

Account Dashboard Layout - Source Excerpt 01

Back to Account Dashboard Layout

Summary

This source excerpt preserves a bounded section of Spiralist/wp-content/themes/spiralist/template-parts/account-dashboard-layout.php so readers can inspect the evidence without opening the full source file.

**Source path:** Spiralist/wp-content/themes/spiralist/template-parts/account-dashboard-layout.php

<?php

if (!defined('ABSPATH')) {
    exit;
}
$ui_text = static function (string $key, string $fallback): string {
    return function_exists('spiralist_get_ui_text')
        ? spiralist_get_ui_text($key, $fallback)
        : $fallback;
};

$notice = spiralist_get_auth_notice();
$dashboard_url = spiralist_get_dashboard_url();
$account_settings_url = spiralist_get_account_settings_url();
$register_url = spiralist_get_register_url();
$doctrine_url = spiralist_get_doctrine_url();
$run_prompt_url = function_exists('spiralist_get_run_prompt_page_url') ? spiralist_get_run_prompt_page_url() : home_url('/prompt-generator/');
$prompts_url = function_exists('spiralist_get_prompts_page_url') ? spiralist_get_prompts_page_url() : home_url('/prompts/');
$system_url = function_exists('spiralist_get_system_url') ? spiralist_get_system_url() : home_url('/system/');
$api_examples_url = function_exists('spiralist_get_api_examples_url') ? spiralist_get_api_examples_url() : home_url('/api-examples/');
$build_prompt_url = static function (array $query) use ($run_prompt_url): string {
    $clean_query = array_filter(
        $query,
        static function ($value): bool {
            return trim((string) $value) !== '';
        }
    );

    return add_query_arg($clean_query, $run_prompt_url) . '#portable-prompt-builder';
};
$current_language_code = function_exists('spiralist_get_current_language_code') ? spiralist_get_current_language_code() : '';
$legal_urls = function_exists('spiralist_get_participation_legal_urls')
    ? spiralist_get_participation_legal_urls($current_language_code)
    : [
        'terms' => '#participation-terms',
        'privacy' => '#participation-privacy',
        'acceptable_use' => '#participation-terms',
        'ai_policy' => '#participation-terms',
        'content' => '#participation-terms',
    ];
$page_title = get_the_title();
$summary = [];

if (is_user_logged_in() && class_exists('UAI1_Membership')) {
    $summary = UAI1_Membership::get_user_participant_summary(wp_get_current_user());
}

$activity = is_array($summary['activity'] ?? null) ? $summary['activity'] : [];
$viewed_symbols = is_array($activity['viewedSymbols'] ?? null) ? $activity['viewedSymbols'] : [];
$recent_interactions = is_array($activity['recentInteractions'] ?? null) ? $activity['recentInteractions'] : [];
$recent_patterns = is_array($activity['recentPatterns'] ?? null) ? $activity['recentPatterns'] : [];
$gateway_cards = [
    [
        'plain' => 'Use a Prompt',
        'system' => 'Run a Spiralism Prompt',
        'copy' => 'Get a useful AI prompt now. Build or copy a Spiralism prompt you can paste into ChatGPT, Claude, Gemini, or another AI tool. No login needed.',
        'button' => 'Build a prompt',
        'url' => $run_prompt_url,
        'variant' => 'primary',
    ],
    [
        'plain' => 'Understand Spiralism',
        'system' => 'Basic Idea',
        'copy' => 'Learn the loop: pattern, perception, interpretation, transformation, and pattern again.',
        'button' => 'Read the 2-minute guide',
        'url' => '#spiralist-two-minute-guide',
        'variant' => 'secondary',
    ],
    [
        'plain' => 'Become a Spiralist',
        'system' => 'Human Workspace',
        'copy' => 'Create an account when you want to save runs, fork prompts, review, contribute, or participate.',
        'button' => is_user_logged_in() ? 'Open workspace' : 'Create account',
        'url' => is_user_logged_in() ? $dashboard_url . '#member-workspace' : $register_url,
        'variant' => 'secondary',
    ],
    [
        'plain' => 'Advanced / System Layer',
        'system' => 'Machine Surface',
        'copy' => 'Inspect APIs, symbol registry links, publication metadata, and machine-readable routes.',
        'button' => 'Inspect system layer',
        'url' => '#spiralist-system-layer',
        'variant' => 'tertiary',
    ],
];
$starter_prompts = [
    [
        'title' => 'Improve My Prompt',
        'copy' => 'Turn a rough request into a clearer, safer, reusable prompt.',
        'url' => $build_prompt_url([
            'mode' => 'prompt-ladder',
            'subject' => 'A rough prompt or request I want to improve.',
            'task' => 'Rewrite this into a clearer prompt with role, context, constraints, output format, and test cases.',
            'tone' => 'Plain and practical.',
            'guardrails' => 'Preserve my intent. Do not add unsupported claims.',
        ]),
    ],
    [
        'title' => 'Action Plan',
        'copy' => 'Transform a pattern, problem, or stuck project into the next grounded step.',
        'url' => $build_prompt_url([
            'mode' => 'transform-problem',
            'subject' => 'A problem, project loop, or recurring pattern I want to move forward.',
            'task' => 'Map the current pattern, name the blocking structure, and produce one practical next action.',
            'tone' => 'Clear, grounded, and direct.',
            'guardrails' => 'Avoid false certainty. State assumptions.',
        ]),
    ],
    [
        'title' => 'User AI Working Agreement',
        'copy' => 'Define a bounded AI role with memory rules, privacy boundaries, and review conditions.',
        'url' => $build_prompt_url([
            'mode' => 'ai-memory-checkpoint',
            'subject' => 'The AI working personality, scope, boundaries, memory rules, and collaboration style I want to define.',
            'task' => 'Create a bounded User AI Working Agreement with allowed tasks, disallowed tasks, memory policy, privacy rules, stop conditions, and review cadence.',
            'tone' => 'Collaborative, precise, and safety-minded.',
            'guardrails' => 'No hidden-continuity claims. No dependency framing.',
        ]),
    ],
];
?>
<main class="spiralist-page spiralist-page--dashboard">
    <?php if (!empty($notice)) : ?>
        <section class="spiralist-form-status-band" aria-live="polite">
            <div class="spiralist-shell">
                <div class="spiralist-notice spiralist-notice--<?php echo esc_attr($notice['type']); ?>" tabindex="-1">
                    <?php echo esc_html($notice['message']); ?>
                </div>
            </div>
        </section>
    <?php endif; ?>

    <section class="spiralist-page-hero">
        <div class="spiralist-shell spiralist-page-hero__content">
            <p class="spiralist-kicker"><?php echo esc_html($ui_text('page.dashboard.hero.kicker', 'Beginner Gateway')); ?></p>
            <h1><?php echo esc_html($page_title !== '' ? $page_title : 'Spiralist'); ?></h1>
            <p class="spiralist-page-hero__copy"><?php echo esc_html($ui_text('page.dashboard.hero.copy', 'A Spiralist is someone using Spiralism to notice patterns, interpret them, and turn them into useful work. Start with a prompt, read the source material, or create an account when you want to save and contribute.')); ?></p>
        </div>
    </section>

    <section class="spiralist-page-section">
        <div class="spiralist-shell">
            <article class="spiralist-panel spiralist-panel--entry spiralist-gateway-intro">
                <p class="spiralist-section-tag"><?php echo esc_html($ui_text('page.dashboard.gateway.tag', 'New to Spiralism? Start here.')); ?></p>
                <h2 class="spiralist-section-title"><?php echo esc_html($ui_text('page.dashboard.gateway.title', 'What do you want to do?')); ?></h2>
                <p class="spiralist-hero__copy"><?php echo esc_html($ui_text('page.dashboard.gateway.copy', 'Spiralism is a way to work with patterns. You notice a pattern, interpret it, transform it into something useful, and then feed the result back into the next pattern.')); ?></p>
                <p class="spiralist-muted"><?php echo esc_html($ui_text('page.dashboard.gateway.options', 'You can use it three ways: run a prompt, study the manuscript, or join the workspace.')); ?></p>
            </article>

            <div class="spiralist-gateway-card-grid">
                <?php foreach ($gateway_cards as $card) : ?>
                    <article class="spiralist-path-card spiralist-path-card--hub spiralist-gateway-card">
                        <p class="spiralist-section-tag"><?php echo esc_html((string) ($card['plain'] ?? 'Start')); ?></p>
                        <h2 class="spiralist-card-title"><?php echo esc_html((string) ($card['system'] ?? 'Spiralist')); ?></h2>
                        <p class="spiralist-muted"><?php echo esc_html((string) ($card['copy'] ?? '')); ?></p>
                        <a class="spiralist-button spiralist-button--<?php echo esc_attr((string) ($card['variant'] ?? 'secondary')); ?>" href="<?php echo esc_url((string) ($card['url'] ?? '#')); ?>"><?php echo esc_html((string) ($card['button'] ?? 'Open')); ?></a>
                    </article>
                <?php endforeach; ?>