Skip to content
wiki.fftac.org

Page Gallery - Source Excerpt 03

Back to Page Gallery

Summary

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

**Source path:** Spiralist/wp-content/themes/spiralist/page-gallery.php

<button class="spiralist-tab" type="button" data-tab-trigger="prompt" aria-pressed="false"><?php echo esc_html($ui_text('page.gallery.tabs.prompt', 'Prompt Used')); ?></button>
                            </div>

                            <section class="spiralist-tab-panel spiralist-book-page-tab-panel is-active" data-tab-panel="overview">
                                <div class="spiralist-book-page-overview">
                                    <h2 class="spiralist-section-title"><?php echo esc_html($ui_text('page.gallery.metadata.title', 'Page Metadata')); ?></h2>
                                    <p class="spiralist-muted"><?php echo esc_html((string) ($requested_asset['caption'] ?? '')); ?></p>
                                    <p class="spiralist-muted"><?php echo esc_html($ui_text('page.gallery.metadata.copy', 'This standalone image route is part of the same online-first, open-source book and stays linked back to the manuscript sequence.')); ?></p>
                                    <dl class="spiralist-meta-list spiralist-meta-list--compact spiralist-book-page-facts">
                                        <div><dt><?php echo esc_html($ui_text('page.gallery.metadata.filename', 'Filename')); ?></dt><dd><?php echo esc_html((string) ($requested_asset['filename'] ?? '')); ?></dd></div>
                                        <div><dt><?php echo esc_html($ui_text('page.gallery.metadata.image_route', 'Image Route')); ?></dt><dd class="spiralist-book-page-path"><?php echo esc_html((string) $requested_route_copy); ?></dd></div>
                                        <div><dt><?php echo esc_html($ui_text('page.gallery.metadata.section', 'Section')); ?></dt><dd><?php echo esc_html((string) ($dossier_page['section_title'] ?? $ui_text('page.gallery.card.section_label', 'Artifact Pages'))); ?></dd></div>
                                        <div><dt><?php echo esc_html($ui_text('page.gallery.metadata.book_page', 'Book Page')); ?></dt><dd><?php echo esc_html((string) ($dossier_page['label'] ?? $ui_text('page.gallery.card.title', 'Image Page'))); ?></dd></div>
                                        <?php if (!empty($requested_asset['width']) && !empty($requested_asset['height'])) : ?>
                                            <div><dt><?php echo esc_html($ui_text('page.gallery.metadata.dimensions', 'Dimensions')); ?></dt><dd><?php echo esc_html((string) $requested_asset['width'] . ' x ' . (string) $requested_asset['height']); ?></dd></div>
                                        <?php endif; ?>
                                        <div><dt><?php echo esc_html($ui_text('page.gallery.metadata.manuscript_route', 'Manuscript Route')); ?></dt><dd class="spiralist-book-page-path"><?php echo esc_html(!empty($requested_asset['related_manuscript_url']) ? (string) wp_parse_url((string) $requested_asset['related_manuscript_url'], PHP_URL_PATH) : $ui_text('page.gallery.metadata.not_linked', 'Not yet linked')); ?></dd></div>
                                    </dl>
                                    <div class="spiralist-cta-row spiralist-cta-row--start">
                                        <?php if (!empty($previous_asset)) : ?>
                                            <a class="spiralist-button spiralist-button--secondary" href="<?php echo esc_url((string) ($previous_asset['route_url'] ?? $gallery_url)); ?>"><?php echo esc_html($ui_text('page.gallery.cta.previous_page', 'Previous Page')); ?></a>
                                        <?php endif; ?>
                                        <?php if (!empty($next_asset)) : ?>
                                            <a class="spiralist-button spiralist-button--secondary" href="<?php echo esc_url((string) ($next_asset['route_url'] ?? $gallery_url)); ?>"><?php echo esc_html($ui_text('page.gallery.cta.next_page', 'Next Page')); ?></a>
                                        <?php endif; ?>
                                        <?php if (!empty($requested_asset['related_manuscript_url'])) : ?>
                                            <a class="spiralist-button spiralist-button--primary" href="<?php echo esc_url((string) $requested_asset['related_manuscript_url']); ?>"><?php echo esc_html((string) ($requested_asset['related_manuscript_title'] ?? $ui_text('page.gallery.cta.open_folio', 'Open Manuscript Folio'))); ?></a>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </section>

                            <section class="spiralist-tab-panel spiralist-book-page-tab-panel" data-tab-panel="contents" hidden>
                                <div class="spiralist-book-page-toc">
                                    <p class="spiralist-muted"><?php echo esc_html($ui_text('page.gallery.toc.copy', 'Table of contents for the public book build. Each entry opens its manuscript folio route so the image page stays tied to the reading sequence.')); ?></p>
                                    <div class="spiralist-simple-list">
                                        <?php foreach ($book_toc_pages as $toc_page) : ?>
                                            <?php
                                            $toc_active = strtolower((string) ($toc_page['filename'] ?? '')) === strtolower((string) ($requested_asset['filename'] ?? ''));
                                            $toc_url = function_exists('spiralist_get_manuscript_folio_url')
                                                ? spiralist_get_manuscript_folio_url($toc_page)
                                                : $manuscript_url;
                                            ?>
                                            <a class="spiralist-simple-list__item spiralist-book-page-toc-item <?php echo $toc_active ? 'is-active' : ''; ?>" href="<?php echo esc_url($toc_url); ?>">
                                                <strong><?php echo esc_html((string) ($toc_page['label'] ?? $ui_text('page.gallery.toc.page', 'Page')) . ' - ' . (string) ($toc_page['title'] ?? $ui_text('page.gallery.toc.book_page', 'Book page'))); ?></strong>
                                                <span class="spiralist-simple-list__meta"><?php echo esc_html((string) ($toc_page['section_label'] ?? $ui_text('page.gallery.metadata.section', 'Section'))); ?></span>
                                                <p><?php echo esc_html((string) ($toc_page['summary'] ?? '')); ?></p>
                                            </a>
                                        <?php endforeach; ?>
                                    </div>
                                </div>
                            </section>

                            <section class="spiralist-tab-panel spiralist-book-page-tab-panel" data-tab-panel="prompt" hidden>
                                <div class="spiralist-book-page-prompt">
                                    <div class="spiralist-inline-meta">
                                        <p class="spiralist-section-tag"><?php echo esc_html((string) ($current_creation_prompt['title'] ?? $ui_text('page.gallery.tabs.prompt', 'Prompt Used'))); ?></p>
                                        <span class="spiralist-status-pill <?php echo esc_attr($current_prompt_status_class); ?>"><?php echo esc_html((string) ($current_creation_prompt['status'] ?? $ui_text('page.gallery.prompt.pending', 'Prompt pending'))); ?></span>
                                    </div>
                                    <p class="spiralist-muted"><?php echo esc_html((string) ($current_creation_prompt['summary'] ?? '')); ?></p>
                                    <?php if (!empty($current_creation_prompt['source_slug'])) : ?>
                                        <p class="spiralist-muted"><strong><?php echo esc_html($ui_text('page.gallery.prompt.source_slug', 'Source slug:')); ?></strong> <?php echo esc_html((string) $current_creation_prompt['source_slug']); ?></p>
                                    <?php endif; ?>
                                    <div class="spiralist-cta-row spiralist-cta-row--start">
                                        <?php if (!empty($current_creation_prompt['url'])) : ?>
                                            <a class="spiralist-button spiralist-button--primary" href="<?php echo esc_url((string) $current_creation_prompt['url']); ?>"><?php echo esc_html($ui_text('page.gallery.cta.open_prompt_record', 'Open Prompt Record')); ?></a>
                                        <?php endif; ?>
                                        <a class="spiralist-button spiralist-button--secondary" href="<?php echo esc_url($prefix_url(spiralist_get_prompts_page_url())); ?>"><?php echo esc_html($ui_text('page.gallery.cta.browse_prompt_library', 'Browse Prompt Library')); ?></a>