Compare commits

..

10 Commits

Author SHA1 Message Date
rafa ea5ecafc3d fix: capture gospel when assigning carta
Co-authored-by: rafa <rcalvotorrejon@gmail.com>
Signed-off-by: rafa <rcalvotorrejon@gmail.com>
2026-08-21 06:59:06 -04:00
rafa 696934016f Merge pull request 'Backfill evangelio: modo apply explícito vía variable de entorno' (#208) from fix/backfill-apply-mode into main 2026-08-12 13:57:12 +00:00
rafa 06d7057e76 fix: support explicit backfill apply mode
Co-authored-by: rafa <rcalvotorrejon@gmail.com>
Signed-off-by: rafa <rcalvotorrejon@gmail.com>
2026-08-12 09:56:10 -04:00
rafa ef2978fc21 Merge pull request 'Mostrar el evangelio también en Comentario editorial (no solo Comentarios al evangelio)' (#207) from feat/evangelio-editorial into main 2026-08-12 13:53:41 +00:00
rafa 587b10c2b3 Merge pull request 'Modo oscuro: toggle duplicado, evangelio, navegación, visited, colaboradores' (#206) from fix/theme-button-duplicate into main 2026-08-12 13:53:37 +00:00
rafa 6b966a3b5f fix: style contributor cards in dark mode
Co-authored-by: rafa <rcalvotorrejon@gmail.com>
Signed-off-by: rafa <rcalvotorrejon@gmail.com>
2026-08-12 09:33:58 -04:00
rafa 75c0f07eab fix: keep visited links readable in dark mode
Co-authored-by: rafa <rcalvotorrejon@gmail.com>
Signed-off-by: rafa <rcalvotorrejon@gmail.com>
2026-08-12 09:20:34 -04:00
rafa f0946be1fc fix: cover navigation and gallery dark states
Co-authored-by: rafa <rcalvotorrejon@gmail.com>
Signed-off-by: rafa <rcalvotorrejon@gmail.com>
2026-08-12 09:16:43 -04:00
rafa d836297c89 fix: cover editorial components in dark mode
Co-authored-by: rafa <rcalvotorrejon@gmail.com>
Signed-off-by: rafa <rcalvotorrejon@gmail.com>
2026-08-12 09:15:47 -04:00
rafa d9ff5e891c fix: prevent duplicate theme toggle
Co-authored-by: rafa <rcalvotorrejon@gmail.com>
Signed-off-by: rafa <rcalvotorrejon@gmail.com>
2026-08-12 09:04:15 -04:00
4 changed files with 141 additions and 5 deletions
+11 -3
View File
@@ -407,14 +407,22 @@ traducción inmediata, avisar a Rafa directamente además de pedírselo a Hermes
| Asignar `_carta_id` a un artículo | `POST /wp-json/fea/v1/carta-id/{id}` con body `{"carta_id": N}` | | Asignar `_carta_id` a un artículo | `POST /wp-json/fea/v1/carta-id/{id}` con body `{"carta_id": N}` |
| Borrar `_carta_id` de un artículo | `DELETE /wp-json/fea/v1/carta-id/{id}` | | Borrar `_carta_id` de un artículo | `DELETE /wp-json/fea/v1/carta-id/{id}` |
## Regla para la sección Evangelio y comentarios al Evangelio ## Evangelio y comentarios: regla y paso obligatorio para Mixbot
La sección empieza siempre con el enlace al post del evangelio de esa semana (por La sección empieza siempre con el enlace al post del evangelio de esa semana (por
ejemplo, `MATEO 14, 22-33`) y después van los comentarios. Si ese post no existe, ejemplo, `MATEO 14, 22-33`) y después van los comentarios. Si ese post no existe,
avisad antes de publicar la carta: no empecéis la sección por un comentario. avisad antes de publicar la carta: no empecéis la sección por un comentario.
No hay que completar ningún campo nuevo. A partir de ese enlace, el sitio asigna la Primero guarda la carta (puede quedar como borrador) con esa sección ya completa y
cita bíblica automáticamente a los comentarios nuevos. anota su ID. Después asigna ese ID a **cada comentario al evangelio** de la semana con
el endpoint `POST /wp-json/fea/v1/carta-id/<id-del-comentario>` y el cuerpo
`{"carta_id": <id-de-la-carta>}`.
No hay que escribir la cita ni el texto bíblico a mano: al asignar `_carta_id`, el
plugin localiza la única lectura bíblica enlazada en la sección y añade
`_cita_evangelio` automáticamente, incluso si el comentario ya estaba publicado. Si
la carta tiene cero o varias lecturas, el plugin no adivina: corrige la sección y
vuelve a asignar el ID de carta.
Campos útiles del post: `title`, `content` (HTML), `status` (`draft`/`publish`/`future`), Campos útiles del post: `title`, `content` (HTML), `status` (`draft`/`publish`/`future`),
`date` (ISO 8601 para programar), `categories` (array de IDs), `featured_media` (ID de adjunto). `date` (ISO 8601 para programar), `categories` (array de IDs), `featured_media` (ID de adjunto).
+117 -1
View File
@@ -105,7 +105,8 @@ add_action('wp_head', function () {
--wp--preset--color--base: #0d0d0d; --wp--preset--color--base: #0d0d0d;
--wp--preset--color--contrast: #ececec; --wp--preset--color--contrast: #ececec;
} }
html[data-fea-theme="dark"] a { color: <?php echo esc_html($accent_dark); ?>; } html[data-fea-theme="dark"] a,
html[data-fea-theme="dark"] a:visited { color: <?php echo esc_html($accent_dark); ?>; }
html[data-fea-theme="dark"] a:focus-visible, html[data-fea-theme="dark"] a:focus-visible,
html[data-fea-theme="dark"] button:focus-visible { html[data-fea-theme="dark"] button:focus-visible {
outline-color: <?php echo esc_html($accent_dark); ?> !important; outline-color: <?php echo esc_html($accent_dark); ?> !important;
@@ -184,6 +185,117 @@ add_action('wp_head', function () {
color: #b8afa8; color: #b8afa8;
} }
/* Comentarios al evangelio: el panel usa colores editoriales claros fijos. */
html[data-fea-theme="dark"] .fea-com-evangelio {
background: #1a1711;
border-left-color: #c9973e;
color: #ececec;
}
html[data-fea-theme="dark"] .fea-com-evangelio-details summary {
color: #f0c674;
}
/* Elementos editoriales presentes en artículos y resultados. */
html[data-fea-theme="dark"] .fea-audio {
background: #161311;
border-color: #3a302b;
border-left-color: <?php echo esc_html($accent_dark); ?>;
}
html[data-fea-theme="dark"] .fea-byline-name { color: #ececec; }
html[data-fea-theme="dark"] .fea-byline-cat,
html[data-fea-theme="dark"] .fea-eed-link .fecha { color: #b8afa8; }
html[data-fea-theme="dark"] .fea-share-rule { border-top-color: #3a302b; }
html[data-fea-theme="dark"] .fea-share-row { color: #d5cbc3; }
html[data-fea-theme="dark"] .fea-share-label,
html[data-fea-theme="dark"] .fea-share-sep { color: #b8afa8; }
/* Formulario y filtros de búsqueda avanzada. */
html[data-fea-theme="dark"] .fea-adv-details {
background: #161311; border-color: #3a302b;
}
html[data-fea-theme="dark"] .fea-adv-summary {
background: #24181c; border-bottom-color: #3a302b;
color: <?php echo esc_html($accent_dark); ?>;
}
html[data-fea-theme="dark"] .fea-adv-label,
html[data-fea-theme="dark"] .fea-adv-chips-label,
html[data-fea-theme="dark"] .fea-adv-meta,
html[data-fea-theme="dark"] .fea-archive-card .fea-adv-byline { color: #b8afa8; }
html[data-fea-theme="dark"] .fea-adv-chip {
background: #2a1b20; border-color: #56343d; color: #ececec;
}
html[data-fea-theme="dark"] .fea-adv-input,
html[data-fea-theme="dark"] .fea-adv-select {
background: #1c1c1c; border-color: #3a3a3a; color: #ececec;
}
html[data-fea-theme="dark"] .fea-adv-count { color: #b8afa8; }
/* Recopilatorios y galería multimedia. */
html[data-fea-theme="dark"] .fea-recop-year { border-bottom-color: #3a302b; }
html[data-fea-theme="dark"] .fea-recop-list li { border-bottom-color: #2a2320; }
html[data-fea-theme="dark"] .fea-recop-list a,
html[data-fea-theme="dark"] .fea-mm-title { color: #ececec; }
html[data-fea-theme="dark"] .fea-recop-date,
html[data-fea-theme="dark"] .fea-mm-date,
html[data-fea-theme="dark"] .fea-mm-excerpt { color: #b8afa8; }
html[data-fea-theme="dark"] .fea-mm-card { background: #161311; border-color: #2a2320; }
html[data-fea-theme="dark"] .fea-mm-thumb { background: #241f1c; }
/* Galerías de pensamientos y navegación del tema base. */
html[data-fea-theme="dark"] .fea-gallery-item {
background: #161311; border-color: #3a302b;
}
html[data-fea-theme="dark"] .fea-lightbox-frame img { background: #161311; }
html[data-fea-theme="dark"] .fea-lightbox button { background: #2a2320; color: #ececec; }
html[data-fea-theme="dark"] .wp-block-navigation .wp-block-navigation-item__content {
color: #ececec;
}
html[data-fea-theme="dark"] .wp-block-navigation__submenu-container {
background: #161311; border-color: #3a302b;
}
/* Página de apoyo: plantilla propia con colores claros explícitos. */
html[data-fea-theme="dark"] .fea-support-page {
--fea-support-ink: #ececec;
--fea-support-warm: #161311;
--fea-support-line: #3a302b;
--fea-support-card: #161311;
}
html[data-fea-theme="dark"] .fea-support-hero,
html[data-fea-theme="dark"] .fea-support-banner {
background: #1a1711 !important;
border-color: #3a302b !important;
}
html[data-fea-theme="dark"] .fea-support-card,
html[data-fea-theme="dark"] .fea-support-button.is-secondary {
background: #161311 !important;
border-color: #3a302b !important;
color: #ececec !important;
}
html[data-fea-theme="dark"] .fea-support-card__title,
html[data-fea-theme="dark"] .fea-support-progress__numbers span,
html[data-fea-theme="dark"] .fea-support-progress__note,
html[data-fea-theme="dark"] .fea-support-sidebar__small { color: #b8afa8; }
html[data-fea-theme="dark"] .fea-support-progress__track { background: #3a302b; }
/* Colaboradores: stylesheet propio del tema con tarjetas claras y !important. */
html[data-fea-theme="dark"] .entry-content .wrapper {
background: #161311 !important;
border-color: #3a302b !important;
color: #ececec !important;
box-shadow: 0 2px 4px rgba(0,0,0,.45) !important;
}
html[data-fea-theme="dark"] .entry-content .wrapper strong {
color: #ececec !important;
}
html[data-fea-theme="dark"] .entry-content .wrapper a,
html[data-fea-theme="dark"] .entry-content .wrapper a:visited {
color: #ececec !important;
}
html[data-fea-theme="dark"] .entry-content .wrapper a:hover {
color: <?php echo esc_html($accent_dark); ?> !important;
}
/* Selector de idioma (fea-homepage.php) */ /* Selector de idioma (fea-homepage.php) */
html[data-fea-theme="dark"] #fea-lang-btn { border-color: rgba(255,255,255,0.3); } html[data-fea-theme="dark"] #fea-lang-btn { border-color: rgba(255,255,255,0.3); }
html[data-fea-theme="dark"] #fea-lang-btn:hover, html[data-fea-theme="dark"] #fea-lang-btn:hover,
@@ -240,6 +352,10 @@ add_action('wp_footer', function () {
?> ?>
<script> <script>
(function() { (function() {
// El footer puede renderizarse más de una vez en algunos templates FSE.
// Evitamos crear un segundo toggle en ese caso.
if (document.getElementById('fea-theme-btn')) return;
var btn = document.createElement('button'); var btn = document.createElement('button');
btn.id = 'fea-theme-btn'; btn.id = 'fea-theme-btn';
btn.type = 'button'; btn.type = 'button';
+8
View File
@@ -126,6 +126,14 @@ add_action('transition_post_status', function($new_status, $old_status, $post) {
if ($new_status === 'publish' && $old_status !== 'publish') fea_evangelio_capture_meta($post->ID); if ($new_status === 'publish' && $old_status !== 'publish') fea_evangelio_capture_meta($post->ID);
}, 20, 3); }, 20, 3);
/** Completa la cita cuando llega la carta, aunque el comentario ya estuviera publicado. */
function fea_evangelio_capture_meta_on_carta_assignment($meta_id, $post_id, $meta_key, $meta_value) {
if ($meta_key !== '_carta_id' || !(int) $meta_value) return;
fea_evangelio_capture_meta((int) $post_id);
}
add_action('added_post_meta', 'fea_evangelio_capture_meta_on_carta_assignment', 20, 4);
add_action('updated_post_meta', 'fea_evangelio_capture_meta_on_carta_assignment', 20, 4);
/** Añade referencia y texto plegado, cerrado por defecto, antes del comentario. */ /** Añade referencia y texto plegado, cerrado por defecto, antes del comentario. */
add_filter('the_content', function($content) { add_filter('the_content', function($content) {
if (!is_single() || is_admin()) return $content; if (!is_single() || is_admin()) return $content;
+5 -1
View File
@@ -2,7 +2,11 @@
/** Propuesta/aplicación segura del backfill de _cita_evangelio. */ /** Propuesta/aplicación segura del backfill de _cita_evangelio. */
/** Uso: wp eval-file scripts/backfill_evangelio_meta.php [--apply] --path=/var/www/html */ /** Uso: wp eval-file scripts/backfill_evangelio_meta.php [--apply] --path=/var/www/html */
$apply = in_array('--apply', $_SERVER['argv'] ?? [], true); // WP-CLI no reenvía de forma consistente argumentos desconocidos a eval-file.
// El modo escritura exige por tanto una intención explícita y auditable:
// FEA_EVANGELIO_APPLY=1 wp eval-file scripts/backfill_evangelio_meta.php
$apply = getenv('FEA_EVANGELIO_APPLY') === '1'
|| in_array('--apply', $_SERVER['argv'] ?? [], true);
$posts = get_posts([ $posts = get_posts([
'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => -1, 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => -1,
'category__in' => fea_evangelio_comment_categories(), 'category__in' => fea_evangelio_comment_categories(),