Plugins bloques
This commit is contained in:
@@ -0,0 +1,493 @@
|
||||
<?php
|
||||
/**
|
||||
* Template: Dashboard de Bloques en Transición
|
||||
*
|
||||
* @package Bloques_Transicion
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<div class="wrap bloques-dashboard">
|
||||
<h1>
|
||||
<span class="dashicons dashicons-building"></span>
|
||||
<?php _e('Bloques en Transición', 'bloques-transicion'); ?>
|
||||
</h1>
|
||||
|
||||
<div class="bloques-dashboard-welcome">
|
||||
<h2><?php _e('Bienvenido al panel de gestión del microsite', 'bloques-transicion'); ?></h2>
|
||||
<p><?php _e('Desde aquí puedes gestionar todo el contenido del microsite "Bloques en Transición".', 'bloques-transicion'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="bloques-dashboard-stats">
|
||||
<div class="bloques-stat-card">
|
||||
<div class="bloques-stat-icon">
|
||||
<span class="dashicons dashicons-location-alt"></span>
|
||||
</div>
|
||||
<div class="bloques-stat-content">
|
||||
<span class="bloques-stat-number"><?php echo esc_html($counts['actuacion']); ?></span>
|
||||
<span class="bloques-stat-label"><?php _e('Actuaciones', 'bloques-transicion'); ?></span>
|
||||
</div>
|
||||
<a href="<?php echo admin_url('edit.php?post_type=actuacion'); ?>" class="bloques-stat-link">
|
||||
<?php _e('Ver todas', 'bloques-transicion'); ?> →
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="bloques-stat-card">
|
||||
<div class="bloques-stat-icon">
|
||||
<span class="dashicons dashicons-media-document"></span>
|
||||
</div>
|
||||
<div class="bloques-stat-content">
|
||||
<span class="bloques-stat-number"><?php echo esc_html($counts['recurso_bloques']); ?></span>
|
||||
<span class="bloques-stat-label"><?php _e('Recursos', 'bloques-transicion'); ?></span>
|
||||
</div>
|
||||
<a href="<?php echo admin_url('edit.php?post_type=recurso_bloques'); ?>" class="bloques-stat-link">
|
||||
<?php _e('Ver todos', 'bloques-transicion'); ?> →
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="bloques-stat-card">
|
||||
<div class="bloques-stat-icon">
|
||||
<span class="dashicons dashicons-calendar-alt"></span>
|
||||
</div>
|
||||
<div class="bloques-stat-content">
|
||||
<span class="bloques-stat-number"><?php echo esc_html($counts['evento_bloques']); ?></span>
|
||||
<span class="bloques-stat-label"><?php _e('Eventos', 'bloques-transicion'); ?></span>
|
||||
</div>
|
||||
<a href="<?php echo admin_url('edit.php?post_type=evento_bloques'); ?>" class="bloques-stat-link">
|
||||
<?php _e('Ver todos', 'bloques-transicion'); ?> →
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bloques-dashboard-taxonomies">
|
||||
<h3><?php _e('Categorías', 'bloques-transicion'); ?></h3>
|
||||
<div class="bloques-tax-cards">
|
||||
<div class="bloques-tax-card">
|
||||
<strong><?php _e('Iniciativas', 'bloques-transicion'); ?></strong>
|
||||
<span class="bloques-tax-count"><?php echo esc_html($iniciativas); ?></span>
|
||||
<a href="<?php echo admin_url('edit-tags.php?taxonomy=iniciativa'); ?>">
|
||||
<?php _e('Gestionar', 'bloques-transicion'); ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="bloques-tax-card">
|
||||
<strong><?php _e('Líneas de Trabajo', 'bloques-transicion'); ?></strong>
|
||||
<span class="bloques-tax-count"><?php echo esc_html($lineas); ?></span>
|
||||
<a href="<?php echo admin_url('edit-tags.php?taxonomy=linea_trabajo'); ?>">
|
||||
<?php _e('Gestionar', 'bloques-transicion'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bloques-dashboard-shortcuts">
|
||||
<h3><?php _e('Acciones rápidas', 'bloques-transicion'); ?></h3>
|
||||
<div class="bloques-shortcuts">
|
||||
<a href="<?php echo admin_url('post-new.php?post_type=actuacion'); ?>" class="button button-primary">
|
||||
<span class="dashicons dashicons-plus-alt"></span>
|
||||
<?php _e('Nueva Actuación', 'bloques-transicion'); ?>
|
||||
</a>
|
||||
<a href="<?php echo admin_url('post-new.php?post_type=recurso_bloques'); ?>" class="button button-primary">
|
||||
<span class="dashicons dashicons-plus-alt"></span>
|
||||
<?php _e('Nuevo Recurso', 'bloques-transicion'); ?>
|
||||
</a>
|
||||
<a href="<?php echo admin_url('post-new.php?post_type=evento_bloques'); ?>" class="button button-primary">
|
||||
<span class="dashicons dashicons-plus-alt"></span>
|
||||
<?php _e('Nuevo Evento', 'bloques-transicion'); ?>
|
||||
</a>
|
||||
<a href="<?php echo admin_url('admin.php?page=bloques-settings'); ?>" class="button">
|
||||
<span class="dashicons dashicons-admin-customizer"></span>
|
||||
<?php _e('CSS personalizado', 'bloques-transicion'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bloques-dashboard-shortcodes">
|
||||
<h3><?php _e('Guía de Shortcodes', 'bloques-transicion'); ?></h3>
|
||||
|
||||
<div class="bloques-shortcode-section">
|
||||
<h4><?php _e('Shortcode principal', 'bloques-transicion'); ?></h4>
|
||||
<p class="description"><?php _e('Usa este shortcode para mostrar cualquier tipo de contenido con filtros y paginación.', 'bloques-transicion'); ?></p>
|
||||
|
||||
<table class="wp-list-table widefat fixed striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 45%;"><?php _e('Shortcode', 'bloques-transicion'); ?></th>
|
||||
<th><?php _e('Descripción', 'bloques-transicion'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>[bloques-listado type="recursos" filter="true"]</code></td>
|
||||
<td><?php _e('Recursos con filtros tipo botonera', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>[bloques-listado type="recursos" limit="9" pagination="true"]</code></td>
|
||||
<td><?php _e('Recursos con botón "Ver más"', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>[bloques-listado type="noticias" columns="3"]</code></td>
|
||||
<td><?php _e('Noticias en grid de 3 columnas', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>[bloques-listado type="eventos" widget="list"]</code></td>
|
||||
<td><?php _e('Eventos en formato lista', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>[bloques-listado type="actuaciones" filter="true" search="true"]</code></td>
|
||||
<td><?php _e('Actuaciones con filtros y buscador', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h5><?php _e('Atributos disponibles', 'bloques-transicion'); ?></h5>
|
||||
<table class="wp-list-table widefat fixed striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 20%;"><?php _e('Atributo', 'bloques-transicion'); ?></th>
|
||||
<th style="width: 25%;"><?php _e('Valores', 'bloques-transicion'); ?></th>
|
||||
<th style="width: 15%;"><?php _e('Default', 'bloques-transicion'); ?></th>
|
||||
<th><?php _e('Descripción', 'bloques-transicion'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>type</code></td>
|
||||
<td>recursos | noticias | eventos | actuaciones</td>
|
||||
<td>recursos</td>
|
||||
<td><?php _e('Tipo de contenido a mostrar', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>widget</code></td>
|
||||
<td>grid | list</td>
|
||||
<td>grid</td>
|
||||
<td><?php _e('Modo de visualización', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>columns</code></td>
|
||||
<td>1 | 2 | 3 | 4</td>
|
||||
<td>3</td>
|
||||
<td><?php _e('Número de columnas en grid', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>limit</code></td>
|
||||
<td>número</td>
|
||||
<td>-1 (todos)</td>
|
||||
<td><?php _e('Número máximo de items', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>pagination</code></td>
|
||||
<td>true | false</td>
|
||||
<td>false</td>
|
||||
<td><?php _e('Mostrar botón "Ver más"', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>filter</code></td>
|
||||
<td>true | false</td>
|
||||
<td>false</td>
|
||||
<td><?php _e('Mostrar filtros tipo botonera', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>search</code></td>
|
||||
<td>true | false</td>
|
||||
<td>false</td>
|
||||
<td><?php _e('Mostrar campo de búsqueda', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>iniciativa</code></td>
|
||||
<td>slug</td>
|
||||
<td>-</td>
|
||||
<td><?php _e('Filtrar por iniciativa (slug)', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>linea</code></td>
|
||||
<td>slug</td>
|
||||
<td>-</td>
|
||||
<td><?php _e('Filtrar por línea de trabajo (slug)', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>upcoming</code></td>
|
||||
<td>true | false</td>
|
||||
<td>true</td>
|
||||
<td><?php _e('Solo eventos futuros (solo para eventos)', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="bloques-shortcode-section">
|
||||
<h4><?php _e('Shortcodes con header (para Home)', 'bloques-transicion'); ?></h4>
|
||||
<p class="description"><?php _e('Bloques con cabecera y enlace "Ver más" para usar en la página de inicio.', 'bloques-transicion'); ?></p>
|
||||
|
||||
<table class="wp-list-table widefat fixed striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 45%;"><?php _e('Shortcode', 'bloques-transicion'); ?></th>
|
||||
<th><?php _e('Descripción', 'bloques-transicion'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>[bloques-novedades limit="3"]</code></td>
|
||||
<td><?php _e('Bloque de novedades con icono y enlace', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>[bloques-agenda limit="4"]</code></td>
|
||||
<td><?php _e('Bloque de agenda con próximos eventos', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h5><?php _e('Atributos para bloques con header', 'bloques-transicion'); ?></h5>
|
||||
<table class="wp-list-table widefat fixed striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 20%;"><?php _e('Atributo', 'bloques-transicion'); ?></th>
|
||||
<th style="width: 35%;"><?php _e('Default', 'bloques-transicion'); ?></th>
|
||||
<th><?php _e('Descripción', 'bloques-transicion'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>limit</code></td>
|
||||
<td>3 (novedades) / 4 (agenda)</td>
|
||||
<td><?php _e('Número de items', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>title</code></td>
|
||||
<td>"Novedades" / "Agenda"</td>
|
||||
<td><?php _e('Título del bloque', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>subtitle</code></td>
|
||||
<td>"Últimas noticias..." / "Próximas actividades"</td>
|
||||
<td><?php _e('Subtítulo', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>show_header</code></td>
|
||||
<td>true</td>
|
||||
<td><?php _e('Mostrar cabecera con icono', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>link_text</code></td>
|
||||
<td>"Ver todas las novedades" / "Ver calendario completo"</td>
|
||||
<td><?php _e('Texto del enlace', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>link_url</code></td>
|
||||
<td>/bloques-en-transicion/noticias/ | /bloques-en-transicion/eventos/</td>
|
||||
<td><?php _e('URL del enlace', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="bloques-shortcode-section">
|
||||
<h4><?php _e('Shortcodes de taxonomías', 'bloques-transicion'); ?></h4>
|
||||
<table class="wp-list-table widefat fixed striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 45%;"><?php _e('Shortcode', 'bloques-transicion'); ?></th>
|
||||
<th><?php _e('Descripción', 'bloques-transicion'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>[bloques-iniciativas columns="4"]</code></td>
|
||||
<td><?php _e('Cards de iniciativas', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>[bloques-lineas columns="6"]</code></td>
|
||||
<td><?php _e('Líneas de trabajo con iconos', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="bloques-shortcode-section">
|
||||
<h4><?php _e('Ejemplos de uso', 'bloques-transicion'); ?></h4>
|
||||
<div class="bloques-examples">
|
||||
<div class="bloques-example">
|
||||
<strong><?php _e('Página de Recursos:', 'bloques-transicion'); ?></strong>
|
||||
<code>[bloques-listado type="recursos" filter="true" search="true" limit="12" pagination="true"]</code>
|
||||
</div>
|
||||
<div class="bloques-example">
|
||||
<strong><?php _e('Home - Novedades y Agenda:', 'bloques-transicion'); ?></strong>
|
||||
<code>[bloques-novedades limit="3"]</code>
|
||||
<code>[bloques-agenda limit="4"]</code>
|
||||
</div>
|
||||
<div class="bloques-example">
|
||||
<strong><?php _e('Recursos de una iniciativa:', 'bloques-transicion'); ?></strong>
|
||||
<code>[bloques-listado type="recursos" iniciativa="coles-en-transicion"]</code>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.bloques-dashboard-welcome {
|
||||
background: linear-gradient(135deg, #1E6B52 0%, #2A9D8F 100%);
|
||||
color: white;
|
||||
padding: 30px;
|
||||
border-radius: 12px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.bloques-dashboard-welcome h2 {
|
||||
color: white;
|
||||
margin-top: 0;
|
||||
}
|
||||
.bloques-dashboard-welcome p {
|
||||
opacity: 0.9;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.bloques-dashboard-stats {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 20px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.bloques-stat-card {
|
||||
background: white;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
.bloques-stat-icon {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 10px;
|
||||
background: #f0f9f7;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.bloques-stat-icon .dashicons {
|
||||
font-size: 24px;
|
||||
color: #1E6B52;
|
||||
}
|
||||
.bloques-stat-number {
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
color: #1f2937;
|
||||
}
|
||||
.bloques-stat-label {
|
||||
color: #6b7280;
|
||||
font-size: 14px;
|
||||
}
|
||||
.bloques-stat-link {
|
||||
color: #F97316;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
}
|
||||
.bloques-dashboard-taxonomies,
|
||||
.bloques-dashboard-shortcuts,
|
||||
.bloques-dashboard-shortcodes {
|
||||
background: white;
|
||||
padding: 25px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.bloques-dashboard-taxonomies h3,
|
||||
.bloques-dashboard-shortcuts h3,
|
||||
.bloques-dashboard-shortcodes h3 {
|
||||
margin-top: 0;
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.bloques-tax-cards {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
.bloques-tax-card {
|
||||
background: #f8f9fa;
|
||||
padding: 15px 20px;
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
}
|
||||
.bloques-tax-count {
|
||||
background: #1E6B52;
|
||||
color: white;
|
||||
padding: 4px 12px;
|
||||
border-radius: 20px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.bloques-shortcuts {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
.bloques-shortcuts .button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
.bloques-shortcode-section {
|
||||
margin-top: 25px;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
.bloques-shortcode-section:first-of-type {
|
||||
margin-top: 15px;
|
||||
padding-top: 0;
|
||||
border-top: none;
|
||||
}
|
||||
.bloques-shortcode-section h4 {
|
||||
margin: 0 0 10px;
|
||||
color: #1E6B52;
|
||||
}
|
||||
.bloques-shortcode-section h5 {
|
||||
margin: 20px 0 10px;
|
||||
color: #374151;
|
||||
}
|
||||
.bloques-shortcode-section .description {
|
||||
margin-bottom: 15px;
|
||||
color: #6b7280;
|
||||
}
|
||||
.bloques-examples {
|
||||
background: #f8f9fa;
|
||||
padding: 20px;
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 15px;
|
||||
}
|
||||
.bloques-example {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
.bloques-example strong {
|
||||
color: #374151;
|
||||
}
|
||||
.bloques-example code {
|
||||
background: white;
|
||||
padding: 8px 12px;
|
||||
border-radius: 4px;
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
}
|
||||
@media (max-width: 1024px) {
|
||||
.bloques-dashboard-stats {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.bloques-dashboard-stats {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.bloques-tax-cards {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
/**
|
||||
* Template: Página de carga de datos iniciales
|
||||
*
|
||||
* @package Bloques_Transicion
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<div class="wrap bloques-seeder">
|
||||
<h1>
|
||||
<span class="dashicons dashicons-database-import"></span>
|
||||
<?php _e('Cargar datos iniciales', 'bloques-transicion'); ?>
|
||||
</h1>
|
||||
|
||||
<?php if (isset($message)): ?>
|
||||
<div class="notice notice-<?php echo esc_attr($message_type); ?> is-dismissible">
|
||||
<p><?php echo esc_html($message); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="bloques-seeder-info">
|
||||
<h2><?php _e('¿Qué datos se cargarán?', 'bloques-transicion'); ?></h2>
|
||||
|
||||
<div class="bloques-seeder-section">
|
||||
<h3><?php _e('Iniciativas (4)', 'bloques-transicion'); ?></h3>
|
||||
<ul>
|
||||
<li><strong>Oficina de Transición Justa</strong> - Puente y Villa de Vallecas</li>
|
||||
<li><strong>Coles en transición</strong> - 7 centros en Puente y Villa de Vallecas</li>
|
||||
<li><strong>Comunidad energética</strong> - Puente de Vallecas</li>
|
||||
<li><strong>Creación de redes</strong> - Madrid, Cataluña y Valencia</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="bloques-seeder-section">
|
||||
<h3><?php _e('Líneas de Trabajo (6)', 'bloques-transicion'); ?></h3>
|
||||
<ul>
|
||||
<li><strong>Energía</strong> - Rehabilitación edificios, comunidades energéticas y autoconsumo renovable</li>
|
||||
<li><strong>Cuidados</strong> - Redes de apoyo mutuo y espacios vecinales</li>
|
||||
<li><strong>Alimentación</strong> - Alimentación sostenible y saludable y redes de consumo</li>
|
||||
<li><strong>Movilidad</strong> - Movilidad sostenible, uso de la bicicleta y espacio público</li>
|
||||
<li><strong>Renaturalización</strong> - Renaturalización de comunidades y patios escolares</li>
|
||||
<li><strong>Reutilización</strong> - Economía circular y consumo colaborativo</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="bloques-seeder-section">
|
||||
<h3><?php _e('Tipos de Evento (2)', 'bloques-transicion'); ?></h3>
|
||||
<ul>
|
||||
<li><strong>Online</strong></li>
|
||||
<li><strong>Presencial</strong></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bloques-seeder-actions">
|
||||
<form method="post" action="">
|
||||
<?php wp_nonce_field('bloques_seed', 'bloques_seed_nonce'); ?>
|
||||
<input type="hidden" name="bloques_seed_action" value="1">
|
||||
|
||||
<p class="description">
|
||||
<?php _e('Esta acción creará o actualizará las categorías con los datos predefinidos. Los datos existentes no se eliminarán.', 'bloques-transicion'); ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<button type="submit" class="button button-primary button-hero">
|
||||
<span class="dashicons dashicons-database-import"></span>
|
||||
<?php _e('Cargar datos iniciales', 'bloques-transicion'); ?>
|
||||
</button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="bloques-seeder-status">
|
||||
<h3><?php _e('Estado actual', 'bloques-transicion'); ?></h3>
|
||||
<?php
|
||||
$iniciativas_count = wp_count_terms(['taxonomy' => 'iniciativa', 'hide_empty' => false]);
|
||||
$lineas_count = wp_count_terms(['taxonomy' => 'linea_trabajo', 'hide_empty' => false]);
|
||||
$tipos_count = wp_count_terms(['taxonomy' => 'tipo_evento', 'hide_empty' => false]);
|
||||
?>
|
||||
<table class="wp-list-table widefat fixed striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php _e('Iniciativas', 'bloques-transicion'); ?></td>
|
||||
<td><strong><?php echo esc_html($iniciativas_count); ?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('Líneas de Trabajo', 'bloques-transicion'); ?></td>
|
||||
<td><strong><?php echo esc_html($lineas_count); ?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('Tipos de Evento', 'bloques-transicion'); ?></td>
|
||||
<td><strong><?php echo esc_html($tipos_count); ?></strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
/**
|
||||
* Template: Página de Ajustes
|
||||
*
|
||||
* @package Bloques_Transicion
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<div class="wrap bloques-settings">
|
||||
<h1>
|
||||
<span class="dashicons dashicons-admin-settings"></span>
|
||||
<?php _e('Ajustes de Bloques en Transición', 'bloques-transicion'); ?>
|
||||
</h1>
|
||||
|
||||
<?php if (isset($saved) && $saved): ?>
|
||||
<div class="notice notice-success is-dismissible">
|
||||
<p><?php _e('Ajustes guardados correctamente.', 'bloques-transicion'); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form method="post" action="">
|
||||
<?php wp_nonce_field('bloques_save_settings', 'bloques_settings_nonce'); ?>
|
||||
|
||||
<div class="bloques-settings-section">
|
||||
<h2><?php _e('CSS Personalizado', 'bloques-transicion'); ?></h2>
|
||||
<p class="description">
|
||||
<?php _e('Añade CSS personalizado para los shortcodes de Bloques en Transición. Este CSS se cargará en el frontend.', 'bloques-transicion'); ?>
|
||||
</p>
|
||||
|
||||
<table class="form-table">
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="bloques_custom_css"><?php _e('CSS', 'bloques-transicion'); ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<textarea
|
||||
name="bloques_custom_css"
|
||||
id="bloques_custom_css"
|
||||
rows="20"
|
||||
class="large-text code"
|
||||
style="font-family: monospace; font-size: 13px;"
|
||||
><?php echo esc_textarea($custom_css); ?></textarea>
|
||||
<p class="description">
|
||||
<?php _e('Puedes usar las variables CSS definidas:', 'bloques-transicion'); ?>
|
||||
</p>
|
||||
<pre style="background: #f6f7f7; padding: 15px; border-radius: 4px; font-size: 12px; overflow-x: auto;">
|
||||
--bloques-primary: #1E6B52; /* Color principal */
|
||||
--bloques-secondary: #2A9D8F; /* Color secundario */
|
||||
--bloques-accent: #F97316; /* Color de acento (naranja) */
|
||||
--bloques-text: #1f2937; /* Color del texto */
|
||||
--bloques-text-light: #6b7280; /* Color texto secundario */
|
||||
--bloques-bg: #f9fafb; /* Color de fondo */
|
||||
--bloques-border: #e5e7eb; /* Color de bordes */
|
||||
--bloques-radius: 12px; /* Radio de bordes */</pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3><?php _e('Clases CSS disponibles', 'bloques-transicion'); ?></h3>
|
||||
<table class="wp-list-table widefat fixed striped" style="max-width: 800px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php _e('Clase', 'bloques-transicion'); ?></th>
|
||||
<th><?php _e('Descripción', 'bloques-transicion'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>.bloques-listado</code></td>
|
||||
<td><?php _e('Contenedor principal del shortcode', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>.bloques-filters</code></td>
|
||||
<td><?php _e('Contenedor de filtros', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>.bloques-filter-btn</code></td>
|
||||
<td><?php _e('Botones de filtro', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>.bloques-filter-btn.active</code></td>
|
||||
<td><?php _e('Botón de filtro activo', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>.bloques-items</code></td>
|
||||
<td><?php _e('Grid de items', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>.bloques-card</code></td>
|
||||
<td><?php _e('Card de recurso o noticia', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>.bloques-card-thumbnail</code></td>
|
||||
<td><?php _e('Imagen de la card', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>.bloques-card-content</code></td>
|
||||
<td><?php _e('Contenido de la card', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>.bloques-card-title</code></td>
|
||||
<td><?php _e('Título de la card', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>.bloques-btn-outline</code></td>
|
||||
<td><?php _e('Botón con borde (descargar)', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>.bloques-btn-load-more</code></td>
|
||||
<td><?php _e('Botón "Ver más"', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>.bloques-agenda-item</code></td>
|
||||
<td><?php _e('Item de agenda', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>.bloques-novedad-item</code></td>
|
||||
<td><?php _e('Item de novedad', 'bloques-transicion'); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="submit">
|
||||
<input type="submit" name="submit" class="button button-primary" value="<?php esc_attr_e('Guardar cambios', 'bloques-transicion'); ?>">
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.bloques-settings-section {
|
||||
background: white;
|
||||
padding: 20px 25px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
||||
margin-top: 20px;
|
||||
}
|
||||
.bloques-settings-section h2 {
|
||||
margin-top: 0;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.bloques-settings-section h3 {
|
||||
margin-top: 30px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* Template: Item de Actuación
|
||||
*
|
||||
* Variables disponibles:
|
||||
* - $id, $title, $excerpt, $content, $permalink, $thumbnail
|
||||
* - $iniciativas, $lineas, $widget, $type
|
||||
* - $es_piloto, $direccion, $localidad, $latitud, $longitud
|
||||
*
|
||||
* @package Bloques_Transicion
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$classes = ['bloques-item', 'bloques-item-actuacion'];
|
||||
if ($widget === 'list') {
|
||||
$classes[] = 'bloques-item-list';
|
||||
}
|
||||
if ($es_piloto) {
|
||||
$classes[] = 'bloques-item-piloto';
|
||||
}
|
||||
?>
|
||||
<article id="bloques-actuacion-<?php echo esc_attr($id); ?>" class="<?php echo esc_attr(implode(' ', $classes)); ?>">
|
||||
<?php if ($thumbnail): ?>
|
||||
<div class="bloques-item-thumbnail">
|
||||
<a href="<?php echo esc_url($permalink); ?>">
|
||||
<img src="<?php echo esc_url($thumbnail); ?>" alt="<?php echo esc_attr($thumbnail_alt ?: $title); ?>" loading="lazy">
|
||||
</a>
|
||||
<?php if ($es_piloto): ?>
|
||||
<span class="bloques-badge bloques-badge-piloto">
|
||||
<?php _e('Piloto', 'bloques-transicion'); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="bloques-item-content">
|
||||
<header class="bloques-item-header">
|
||||
<?php if (!empty($iniciativas)): ?>
|
||||
<div class="bloques-item-taxonomies">
|
||||
<?php foreach ($iniciativas as $term):
|
||||
$color = get_field('color', $term);
|
||||
$icono = get_field('icono', $term);
|
||||
?>
|
||||
<span class="bloques-tag bloques-tag-iniciativa" style="<?php echo $color ? '--tag-color: ' . esc_attr($color) . ';' : ''; ?>">
|
||||
<?php if ($icono): ?>
|
||||
<img src="<?php echo esc_url($icono); ?>" alt="" class="bloques-tag-icon">
|
||||
<?php endif; ?>
|
||||
<?php echo esc_html($term->name); ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<h3 class="bloques-item-title">
|
||||
<a href="<?php echo esc_url($permalink); ?>">
|
||||
<?php echo esc_html($title); ?>
|
||||
</a>
|
||||
</h3>
|
||||
</header>
|
||||
|
||||
<?php if ($excerpt): ?>
|
||||
<div class="bloques-item-excerpt">
|
||||
<?php echo wp_kses_post($excerpt); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($localidad || $direccion): ?>
|
||||
<div class="bloques-item-location">
|
||||
<span class="bloques-icon bloques-icon-location"></span>
|
||||
<?php
|
||||
$location_parts = array_filter([$direccion, $localidad]);
|
||||
echo esc_html(implode(', ', $location_parts));
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($lineas)): ?>
|
||||
<div class="bloques-item-lineas">
|
||||
<?php foreach ($lineas as $term):
|
||||
$icono = get_field('icono', $term);
|
||||
?>
|
||||
<span class="bloques-linea-badge" title="<?php echo esc_attr($term->name); ?>">
|
||||
<?php if ($icono): ?>
|
||||
<img src="<?php echo esc_url($icono); ?>" alt="<?php echo esc_attr($term->name); ?>">
|
||||
<?php else: ?>
|
||||
<?php echo esc_html(mb_substr($term->name, 0, 1)); ?>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<footer class="bloques-item-footer">
|
||||
<a href="<?php echo esc_url($permalink); ?>" class="bloques-item-link bloques-btn">
|
||||
<?php _e('Ver actuación', 'bloques-transicion'); ?>
|
||||
</a>
|
||||
</footer>
|
||||
</div>
|
||||
</article>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* Template: Item por defecto para listados
|
||||
*
|
||||
* Variables disponibles:
|
||||
* - $id, $title, $excerpt, $content, $permalink, $thumbnail
|
||||
* - $iniciativas, $lineas, $widget, $type
|
||||
*
|
||||
* @package Bloques_Transicion
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$classes = ['bloques-item', 'bloques-item-' . $type];
|
||||
if ($widget === 'list') {
|
||||
$classes[] = 'bloques-item-list';
|
||||
}
|
||||
?>
|
||||
<article id="bloques-item-<?php echo esc_attr($id); ?>" class="<?php echo esc_attr(implode(' ', $classes)); ?>">
|
||||
<?php if ($thumbnail): ?>
|
||||
<div class="bloques-item-thumbnail">
|
||||
<a href="<?php echo esc_url($permalink); ?>">
|
||||
<img src="<?php echo esc_url($thumbnail); ?>" alt="<?php echo esc_attr($thumbnail_alt ?: $title); ?>" loading="lazy">
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="bloques-item-content">
|
||||
<header class="bloques-item-header">
|
||||
<?php if (!empty($iniciativas) || !empty($lineas)): ?>
|
||||
<div class="bloques-item-taxonomies">
|
||||
<?php foreach ($iniciativas as $term):
|
||||
$color = get_field('color', $term);
|
||||
?>
|
||||
<span class="bloques-tag bloques-tag-iniciativa" style="<?php echo $color ? '--tag-color: ' . esc_attr($color) . ';' : ''; ?>">
|
||||
<?php echo esc_html($term->name); ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php foreach ($lineas as $term):
|
||||
$color = get_field('color', $term);
|
||||
?>
|
||||
<span class="bloques-tag bloques-tag-linea" style="<?php echo $color ? '--tag-color: ' . esc_attr($color) . ';' : ''; ?>">
|
||||
<?php echo esc_html($term->name); ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<h3 class="bloques-item-title">
|
||||
<a href="<?php echo esc_url($permalink); ?>">
|
||||
<?php echo esc_html($title); ?>
|
||||
</a>
|
||||
</h3>
|
||||
</header>
|
||||
|
||||
<?php if ($excerpt): ?>
|
||||
<div class="bloques-item-excerpt">
|
||||
<?php echo wp_kses_post($excerpt); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<footer class="bloques-item-footer">
|
||||
<a href="<?php echo esc_url($permalink); ?>" class="bloques-item-link">
|
||||
<?php _e('Ver más', 'bloques-transicion'); ?>
|
||||
<span class="bloques-arrow">→</span>
|
||||
</a>
|
||||
</footer>
|
||||
</div>
|
||||
</article>
|
||||
@@ -0,0 +1,184 @@
|
||||
<?php
|
||||
/**
|
||||
* Template: Item de Evento
|
||||
*
|
||||
* Variables disponibles:
|
||||
* - $id, $title, $excerpt, $content, $permalink, $thumbnail
|
||||
* - $iniciativas, $lineas, $widget, $type, $date
|
||||
* - $fecha_inicio, $hora_inicio, $fecha_fin, $hora_fin
|
||||
* - $lugar, $direccion, $url_online, $url_inscripcion, $tipos_evento
|
||||
*
|
||||
* @package Bloques_Transicion
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Determinar si es online, presencial o híbrido
|
||||
$es_online = false;
|
||||
$es_presencial = false;
|
||||
if (!empty($tipos_evento)) {
|
||||
foreach ($tipos_evento as $tipo) {
|
||||
if ($tipo->slug === 'online') $es_online = true;
|
||||
if ($tipo->slug === 'presencial') $es_presencial = true;
|
||||
}
|
||||
}
|
||||
$modalidad = '';
|
||||
$modalidad_class = '';
|
||||
if ($es_online && $es_presencial) {
|
||||
$modalidad = __('Híbrido', 'bloques-transicion');
|
||||
$modalidad_class = 'bloques-modalidad-hibrido';
|
||||
} elseif ($es_online) {
|
||||
$modalidad = __('Online', 'bloques-transicion');
|
||||
$modalidad_class = 'bloques-modalidad-online';
|
||||
} elseif ($es_presencial) {
|
||||
$modalidad = __('Presencial', 'bloques-transicion');
|
||||
$modalidad_class = 'bloques-modalidad-presencial';
|
||||
}
|
||||
|
||||
// Meses en español abreviados
|
||||
$meses = [
|
||||
'01' => 'ENE', '02' => 'FEB', '03' => 'MAR', '04' => 'ABR',
|
||||
'05' => 'MAY', '06' => 'JUN', '07' => 'JUL', '08' => 'AGO',
|
||||
'09' => 'SEP', '10' => 'OCT', '11' => 'NOV', '12' => 'DIC',
|
||||
];
|
||||
|
||||
// Parsear fecha
|
||||
$dia = '';
|
||||
$mes = '';
|
||||
if ($fecha_inicio) {
|
||||
$fecha_clean = str_replace('-', '', $fecha_inicio);
|
||||
if (strlen($fecha_clean) >= 8) {
|
||||
$dia = ltrim(substr($fecha_clean, 6, 2), '0');
|
||||
$mes_num = substr($fecha_clean, 4, 2);
|
||||
$mes = $meses[$mes_num] ?? $mes_num;
|
||||
}
|
||||
}
|
||||
|
||||
// Determinar ubicación a mostrar
|
||||
$ubicacion_texto = $modalidad ?: $lugar;
|
||||
|
||||
// Widget "agenda" (para bloques-agenda)
|
||||
if ($widget === 'agenda'): ?>
|
||||
<article id="bloques-evento-<?php echo esc_attr($id); ?>" class="bloques-agenda-item">
|
||||
<div class="bloques-agenda-fecha">
|
||||
<span class="bloques-agenda-mes"><?php echo esc_html($mes); ?></span>
|
||||
<span class="bloques-agenda-dia"><?php echo esc_html($dia); ?></span>
|
||||
</div>
|
||||
<div class="bloques-agenda-content">
|
||||
<div class="bloques-agenda-meta">
|
||||
<?php if ($hora_inicio): ?>
|
||||
<span class="bloques-agenda-hora"><?php echo esc_html($hora_inicio); ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if ($ubicacion_texto): ?>
|
||||
<span class="bloques-agenda-separator">•</span>
|
||||
<span class="bloques-agenda-ubicacion <?php echo esc_attr($modalidad_class); ?>">
|
||||
<?php echo esc_html($ubicacion_texto); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<h4 class="bloques-agenda-title"><?php echo esc_html($title); ?></h4>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<?php else:
|
||||
// Widget por defecto (list o grid)
|
||||
$classes = ['bloques-item', 'bloques-item-evento'];
|
||||
if ($widget === 'list') {
|
||||
$classes[] = 'bloques-item-list';
|
||||
}
|
||||
|
||||
// Formatear fecha completa
|
||||
$fecha_formateada = '';
|
||||
if ($fecha_inicio) {
|
||||
$fecha_obj = DateTime::createFromFormat('Ymd', str_replace('-', '', $fecha_inicio));
|
||||
if ($fecha_obj) {
|
||||
$meses_largo = ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'];
|
||||
$dia_num = $fecha_obj->format('j');
|
||||
$mes_nombre = $meses_largo[(int)$fecha_obj->format('n') - 1];
|
||||
$anio = $fecha_obj->format('Y');
|
||||
$fecha_formateada = "$dia_num de $mes_nombre, $anio";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<article id="bloques-evento-<?php echo esc_attr($id); ?>" class="<?php echo esc_attr(implode(' ', $classes)); ?>">
|
||||
<div class="bloques-evento-fecha">
|
||||
<span class="bloques-evento-dia"><?php echo esc_html($dia); ?></span>
|
||||
<span class="bloques-evento-mes"><?php echo esc_html($mes); ?></span>
|
||||
</div>
|
||||
|
||||
<div class="bloques-item-content">
|
||||
<header class="bloques-item-header">
|
||||
<?php if ($modalidad): ?>
|
||||
<span class="bloques-evento-modalidad <?php echo esc_attr($modalidad_class); ?>">
|
||||
<?php echo esc_html($modalidad); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<h3 class="bloques-item-title">
|
||||
<a href="<?php echo esc_url($permalink); ?>">
|
||||
<?php echo esc_html($title); ?>
|
||||
</a>
|
||||
</h3>
|
||||
</header>
|
||||
|
||||
<div class="bloques-evento-meta">
|
||||
<?php if ($fecha_formateada): ?>
|
||||
<div class="bloques-evento-meta-item">
|
||||
<span class="bloques-icon bloques-icon-calendar"></span>
|
||||
<span><?php echo esc_html($fecha_formateada); ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($hora_inicio): ?>
|
||||
<div class="bloques-evento-meta-item">
|
||||
<span class="bloques-icon bloques-icon-clock"></span>
|
||||
<span>
|
||||
<?php echo esc_html($hora_inicio); ?>
|
||||
<?php if ($hora_fin): ?>
|
||||
- <?php echo esc_html($hora_fin); ?>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($lugar || $direccion): ?>
|
||||
<div class="bloques-evento-meta-item">
|
||||
<span class="bloques-icon bloques-icon-location"></span>
|
||||
<span><?php echo esc_html($lugar ?: $direccion); ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if ($excerpt): ?>
|
||||
<div class="bloques-item-excerpt">
|
||||
<?php echo wp_kses_post($excerpt); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($iniciativas)): ?>
|
||||
<div class="bloques-item-taxonomies">
|
||||
<?php foreach ($iniciativas as $term):
|
||||
$color = get_field('color', $term);
|
||||
?>
|
||||
<span class="bloques-tag bloques-tag-iniciativa" style="<?php echo $color ? '--tag-color: ' . esc_attr($color) . ';' : ''; ?>">
|
||||
<?php echo esc_html($term->name); ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<footer class="bloques-item-footer">
|
||||
<a href="<?php echo esc_url($permalink); ?>" class="bloques-item-link bloques-btn">
|
||||
<?php _e('Ver evento', 'bloques-transicion'); ?>
|
||||
</a>
|
||||
<?php if ($url_inscripcion): ?>
|
||||
<a href="<?php echo esc_url($url_inscripcion); ?>" class="bloques-btn bloques-btn-secondary" target="_blank" rel="noopener">
|
||||
<?php _e('Inscribirse', 'bloques-transicion'); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</footer>
|
||||
</div>
|
||||
</article>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* Template: Item de Noticia
|
||||
*
|
||||
* Variables disponibles:
|
||||
* - $id, $title, $excerpt, $content, $permalink, $thumbnail
|
||||
* - $widget, $type, $date
|
||||
* - $category, $category_color
|
||||
*
|
||||
* @package Bloques_Transicion
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Widget compact (para bloques-novedades)
|
||||
if ($widget === 'compact'): ?>
|
||||
<article id="bloques-noticia-<?php echo esc_attr($id); ?>" class="bloques-novedad-item">
|
||||
<div class="bloques-novedad-content">
|
||||
<div class="bloques-novedad-meta">
|
||||
<?php if ($category): ?>
|
||||
<span class="bloques-novedad-category" style="background-color: <?php echo esc_attr($category_color); ?>;">
|
||||
<?php echo esc_html($category->name); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<span class="bloques-novedad-date"><?php echo esc_html($date); ?></span>
|
||||
</div>
|
||||
<h4 class="bloques-novedad-title">
|
||||
<a href="<?php echo esc_url($permalink); ?>">
|
||||
<?php echo esc_html($title); ?>
|
||||
</a>
|
||||
</h4>
|
||||
<p class="bloques-novedad-excerpt">
|
||||
<?php echo wp_trim_words($excerpt, 15, '...'); ?>
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
<?php else:
|
||||
// Widget grid (card completa)
|
||||
$classes = ['bloques-card', 'bloques-card-noticia'];
|
||||
if ($widget === 'list') {
|
||||
$classes[] = 'bloques-card-horizontal';
|
||||
}
|
||||
?>
|
||||
<article id="bloques-noticia-<?php echo esc_attr($id); ?>" class="<?php echo esc_attr(implode(' ', $classes)); ?>">
|
||||
<a href="<?php echo esc_url($permalink); ?>" class="bloques-card-link">
|
||||
<div class="bloques-card-thumbnail">
|
||||
<?php if ($thumbnail): ?>
|
||||
<img src="<?php echo esc_url($thumbnail); ?>" alt="<?php echo esc_attr($thumbnail_alt ?: $title); ?>" loading="lazy">
|
||||
<?php else: ?>
|
||||
<div class="bloques-card-placeholder">
|
||||
<span class="bloques-card-placeholder-text">BLOQUES</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($category): ?>
|
||||
<span class="bloques-card-badge" style="background-color: <?php echo esc_attr($category_color); ?>;">
|
||||
<?php echo esc_html($category->name); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="bloques-card-content">
|
||||
<h3 class="bloques-card-title"><?php echo esc_html($title); ?></h3>
|
||||
|
||||
<?php if ($excerpt): ?>
|
||||
<p class="bloques-card-excerpt"><?php echo wp_trim_words($excerpt, 20, '...'); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<span class="bloques-card-date"><?php echo esc_html($date); ?></span>
|
||||
</div>
|
||||
</a>
|
||||
</article>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* Template: Item de Recurso (Grid Card)
|
||||
*
|
||||
* Variables disponibles:
|
||||
* - $id, $title, $excerpt, $content, $permalink, $thumbnail
|
||||
* - $iniciativas, $lineas, $widget, $type, $date
|
||||
* - $archivo, $tipo_recurso, $url_externa
|
||||
*
|
||||
* @package Bloques_Transicion
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Determinar URL de descarga
|
||||
$download_url = '';
|
||||
$file_info = '';
|
||||
$file_extension = '';
|
||||
$file_size = '';
|
||||
|
||||
if (!empty($archivo) && is_array($archivo)) {
|
||||
$download_url = $archivo['url'];
|
||||
$file_extension = strtoupper(pathinfo($archivo['filename'], PATHINFO_EXTENSION));
|
||||
$file_size = isset($archivo['filesize']) ? size_format($archivo['filesize']) : '';
|
||||
} elseif ($url_externa) {
|
||||
$download_url = $url_externa;
|
||||
$file_extension = 'WEB';
|
||||
}
|
||||
|
||||
// Clases según widget
|
||||
$classes = ['bloques-card', 'bloques-card-recurso'];
|
||||
if ($widget === 'list') {
|
||||
$classes[] = 'bloques-card-horizontal';
|
||||
}
|
||||
?>
|
||||
<article id="bloques-recurso-<?php echo esc_attr($id); ?>" class="<?php echo esc_attr(implode(' ', $classes)); ?>">
|
||||
<div class="bloques-card-thumbnail">
|
||||
<?php if ($thumbnail): ?>
|
||||
<img src="<?php echo esc_url($thumbnail); ?>" alt="<?php echo esc_attr($thumbnail_alt ?: $title); ?>" loading="lazy">
|
||||
<?php else: ?>
|
||||
<div class="bloques-card-placeholder">
|
||||
<span class="bloques-card-placeholder-text">COMMUNITY</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($file_extension): ?>
|
||||
<span class="bloques-card-badge"><?php echo esc_html($file_extension); ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="bloques-card-content">
|
||||
<h3 class="bloques-card-title"><?php echo esc_html($title); ?></h3>
|
||||
|
||||
<?php if ($file_size): ?>
|
||||
<span class="bloques-card-meta">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"/>
|
||||
</svg>
|
||||
<?php echo esc_html($file_size); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="bloques-card-footer">
|
||||
<?php if ($download_url): ?>
|
||||
<a href="<?php echo esc_url($download_url); ?>" class="bloques-btn-outline" target="_blank" rel="noopener">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/>
|
||||
</svg>
|
||||
<?php _e('Descargar', 'bloques-transicion'); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
Reference in New Issue
Block a user