Beads are now a property of prayer steps, not separate steps
Each prayer in the library has an optional default_bead_type (small/large/ crucifix). Standard prayers get sensible defaults: Our Father=large, Hail Mary=small, Sign of Cross=crucifix, Divine Mercy beads accordingly. In the sequence, each step card shows a bead selector (—/○/●/✝) so users can override the default per step. Adding a prayer pre-fills its default. Bead library icon hints (○●✝) appear on prayer cards in the library. Modal now includes a Bead selector for creating/editing prayers. Remove the separate Bead Markers library section — beads live on prayers. build_slides: prayer steps with bead_type now get a real bead_index so the ring advances correctly during presentation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+14
-32
@@ -49,7 +49,8 @@ if (isset($_GET['id'])) {
|
||||
|
||||
// ── Load prayer library ───────────────────────────────────────────────────────
|
||||
$lib_stmt = $pdo->prepare("
|
||||
SELECT cp.id, cp.name, cp.leader_text, cp.all_text, cp.is_global, cp.created_by,
|
||||
SELECT cp.id, cp.name, cp.leader_text, cp.all_text,
|
||||
cp.default_bead_type, cp.is_global, cp.created_by,
|
||||
IF(cp.is_global=1 AND u.role='superadmin','standard',
|
||||
IF(cp.is_global=1,'global','mine')) AS source_tag
|
||||
FROM custom_prayers cp
|
||||
@@ -168,37 +169,6 @@ $page_title = $session ? 'Edit: ' . htmlspecialchars($session['name']) : 'Rosary
|
||||
<button class="tab-btn" data-tab="mine">My Prayers</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Bead markers — always visible, not filtered by search/tab -->
|
||||
<div class="bead-markers-section">
|
||||
<div class="bead-markers-label">Bead Markers</div>
|
||||
<div class="bead-marker-cards">
|
||||
<button class="bead-marker-card" onclick="builderAddBead('small')">
|
||||
<span class="bead-icon-sm">○</span>
|
||||
<span class="bead-card-text">
|
||||
<strong>Small Bead</strong>
|
||||
<small>Hail Mary</small>
|
||||
</span>
|
||||
<span class="bead-add-label">+ Add</span>
|
||||
</button>
|
||||
<button class="bead-marker-card" onclick="builderAddBead('large')">
|
||||
<span class="bead-icon-lg">●</span>
|
||||
<span class="bead-card-text">
|
||||
<strong>Large Bead</strong>
|
||||
<small>Our Father</small>
|
||||
</span>
|
||||
<span class="bead-add-label">+ Add</span>
|
||||
</button>
|
||||
<button class="bead-marker-card" onclick="builderAddBead('crucifix')">
|
||||
<span class="bead-icon-cx">✝</span>
|
||||
<span class="bead-card-text">
|
||||
<strong>Crucifix</strong>
|
||||
<small>Cross bead</small>
|
||||
</span>
|
||||
<span class="bead-add-label">+ Add</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="prayer-list">
|
||||
<div class="library-empty" style="grid-column:1/-1;padding:40px;text-align:center;color:var(--muted)">
|
||||
Loading…
|
||||
@@ -248,6 +218,18 @@ $page_title = $session ? 'Edit: ' . htmlspecialchars($session['name']) : 'Rosary
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Bead (optional)</label>
|
||||
<div class="bead-btn-row" id="modal-bead-row">
|
||||
<button type="button" class="bead-sel-btn active" data-bead="">No bead</button>
|
||||
<button type="button" class="bead-sel-btn" data-bead="small">○ Small</button>
|
||||
<button type="button" class="bead-sel-btn" data-bead="large">● Large</button>
|
||||
<button type="button" class="bead-sel-btn" data-bead="crucifix">✝ Crucifix</button>
|
||||
</div>
|
||||
<input type="hidden" id="modal-bead-type" value="">
|
||||
<p class="help-hint">Sets the default bead when this prayer is added to a sequence.</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="modal-leader-group">
|
||||
<label for="modal-leader">Leader text</label>
|
||||
<textarea id="modal-leader" class="modal-textarea" rows="5"
|
||||
|
||||
Reference in New Issue
Block a user