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:
@@ -60,10 +60,12 @@ foreach ($steps as $i => $step) {
|
||||
json_err("Invalid bead type on step " . ($i + 1));
|
||||
}
|
||||
} else {
|
||||
$pid = (int)($step['prayer_id'] ?? 0);
|
||||
$att = $step['attribution'] ?? 'leader_all';
|
||||
$pid = (int)($step['prayer_id'] ?? 0);
|
||||
$att = $step['attribution'] ?? 'leader_all';
|
||||
$bt = $step['bead_type'] ?? null;
|
||||
if (!$pid) json_err("Step " . ($i + 1) . " is missing a prayer");
|
||||
if (!in_array($att, $valid_attributions)) json_err("Invalid attribution on step " . ($i + 1));
|
||||
if ($bt !== null && !in_array($bt, $valid_bead_types)) json_err("Invalid bead type on step " . ($i + 1));
|
||||
$prayer_ids[] = $pid;
|
||||
}
|
||||
}
|
||||
@@ -131,7 +133,8 @@ try {
|
||||
if ($type === 'bead') {
|
||||
$step_stmt->execute([$session_id, 'bead', $step['bead_type'], $order, null, 'none']);
|
||||
} else {
|
||||
$step_stmt->execute([$session_id, 'prayer', null, $order, (int)$step['prayer_id'], $step['attribution']]);
|
||||
$bt = in_array($step['bead_type'] ?? null, ['small','large','crucifix']) ? $step['bead_type'] : null;
|
||||
$step_stmt->execute([$session_id, 'prayer', $bt, $order, (int)$step['prayer_id'], $step['attribution']]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user