Categorias, Etiquetas e Publicacions.

This commit is contained in:
Laegnur 2022-10-25 14:47:38 +02:00
parent 9a22f9b7c2
commit 2458979a8c
25 changed files with 2110 additions and 7 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,11 @@
|Wrong username or password', 'Wrong username or password|Wrong reCaptcha', 'Wrong reCaptcha|en', 'HTML language code|Skip to content', 'bypass|Logo of Praia de Seselle Tourist Apartments', 'Site logo|Log in', 'Log in|Username', 'Username|Password', 'Password|Log in', 'Log in|Footer', 'Page footer|All rights reserved', 'copyright|Designed and Developed by', 'developer|^site--templates--xes-acceder-php:/site/templates/xes-acceder.php |Wrong username or password', 'Wrong username or password|Wrong reCaptcha', 'Wrong reCaptcha|en', 'HTML language code|Skip to content', 'bypass|Logo of Praia de Seselle Tourist Apartments', 'Site logo|Log in', 'Log in|Username', 'Username|Password', 'Password|Log in', 'Log in|Footer', 'Page footer|All rights reserved', 'copyright|Designed and Developed by', 'developer|^site--templates--xes-acceder-php:/site/templates/xes-acceder.php
|Autor', 'Post author|Autor', 'Post author|^site--templates--publicacion-php:/site/templates/publicacion.php
|Footer', 'Page footer|All rights reserved', 'copyright|Designed and Developed by', 'developer|^site--templates--_xes-foot-php:/site/templates/_xes-foot.php |Footer', 'Page footer|All rights reserved', 'copyright|Designed and Developed by', 'developer|^site--templates--_xes-foot-php:/site/templates/_xes-foot.php
|Current page', 'navigation|Edit', 'Edit page|^site--templates--_func-php:/site/templates/_func.php |Current page', 'navigation|Edit', 'Edit page|^site--templates--_func-php:/site/templates/_func.php
|Autor', 'Post author|Autor', 'Post author|Ler máis", "Read more|^site--templates--etiqueta-php:/site/templates/etiqueta.php
|en', 'HTML language code|Skip to content', 'bypass|Logo of Praia de Seselle Tourist Apartments', 'Site logo|Open/Close menu', 'Menu Switch|Menu', 'Navigation menu|Log out', 'Log out|Home', 'Home|^site--templates--_xes-head-php:/site/templates/_xes-head.php |en', 'HTML language code|Skip to content', 'bypass|Logo of Praia de Seselle Tourist Apartments', 'Site logo|Open/Close menu', 'Menu Switch|Menu', 'Navigation menu|Log out', 'Log out|Home', 'Home|^site--templates--_xes-head-php:/site/templates/_xes-head.php
|Autor', 'Post author|Autor', 'Post author|Ler máis", "Read more|^site--templates--categoria-php:/site/templates/categoria.php
|Autor', 'Post author|Author', 'Post author|Read more", "Read more|^site--templates--blogue-php:/site/templates/blogue.php
|en', 'HTML language code|Skip to content', 'bypass|Logo of Praia de Seselle Tourist Apartments', 'Site logo|Open/Close menu', 'Menu Switch|Menu', 'Navigation menu|Log out', 'Log out|Management', 'Management|Log in', 'Log in|^site--templates--_head-php:/site/templates/_head.php |en', 'HTML language code|Skip to content', 'bypass|Logo of Praia de Seselle Tourist Apartments', 'Site logo|Open/Close menu', 'Menu Switch|Menu', 'Navigation menu|Log out', 'Log out|Management', 'Management|Log in', 'Log in|^site--templates--_head-php:/site/templates/_head.php
|Footer', 'Page footer|All rights reserved', 'copyright|Designed and Developed by', 'developer|^site--templates--_foot-php:/site/templates/_foot.php |Footer', 'Page footer|All rights reserved', 'copyright|Designed and Developed by', 'developer|^site--templates--_foot-php:/site/templates/_foot.php
|Info|SQL file|ZIP file|Backup|Delete|Restore|Cancel|Upload|Description|Valid?|Date/Time|Exported by|File size|Filename|Database name|Which tables?|Num tables exported|Num tables created|Num rows|Export time (seconds)|file', 'th|date', 'th|tables', 'th|rows', 'th|size', 'th|actions', 'th|(all)|No database backup files yet.|Delete checked|Add new SQL database dump file|Upload File|Added file: %s|Yes! Confirmed valid begin and end of file.|All Tables|Unable to confirm if valid file (likely not created by this tool)|bytes', 'file-details|Backup name|This will be used for the backup filename. The extension .sql will be added to it automatically.|If omitted, a unique filename will be automatically generated.|Backup description|Backup all tables?|Tables|By default, the export will include all tables. If you only want certain tables to be included, select them below.|Please be patient after clicking submit. Backups may take some time, depending on how much there is to backup.|Saved new backup:|Failed to create ZIP file: %s|Delete Backup|Delete %s?|Check the box to confirm|Restore Backup|Restored: %s|Error restoring: %s|Warning: the current database will be destroyed and replaced (this has potential to break your site!)|Restore %s?|Drop all tables from current database before restore?|Deleted: %s|^site--modules--processdatabasebackups--processdatabasebackups-module:/site/modules/ProcessDatabaseBackups/ProcessDatabaseBackups.module |Info|SQL file|ZIP file|Backup|Delete|Restore|Cancel|Upload|Description|Valid?|Date/Time|Exported by|File size|Filename|Database name|Which tables?|Num tables exported|Num tables created|Num rows|Export time (seconds)|file', 'th|date', 'th|tables', 'th|rows', 'th|size', 'th|actions', 'th|(all)|No database backup files yet.|Delete checked|Add new SQL database dump file|Upload File|Added file: %s|Yes! Confirmed valid begin and end of file.|All Tables|Unable to confirm if valid file (likely not created by this tool)|bytes', 'file-details|Backup name|This will be used for the backup filename. The extension .sql will be added to it automatically.|If omitted, a unique filename will be automatically generated.|Backup description|Backup all tables?|Tables|By default, the export will include all tables. If you only want certain tables to be included, select them below.|Please be patient after clicking submit. Backups may take some time, depending on how much there is to backup.|Saved new backup:|Failed to create ZIP file: %s|Delete Backup|Delete %s?|Check the box to confirm|Restore Backup|Restored: %s|Error restoring: %s|Warning: the current database will be destroyed and replaced (this has potential to break your site!)|Restore %s?|Drop all tables from current database before restore?|Deleted: %s|^site--modules--processdatabasebackups--processdatabasebackups-module:/site/modules/ProcessDatabaseBackups/ProcessDatabaseBackups.module

View file

@ -0,0 +1,12 @@
{
"file": "site\/ready.php",
"textdomain": "site--ready-php",
"translations": {
"d42d3a059f66d7c7922c501182602073": {
"text": "%d publicaci\u00f3n"
},
"96d2fb5e7d8d946eaad05f309ae96e7c": {
"text": "%d publicaciones"
}
}
}

View file

@ -0,0 +1,12 @@
{
"file": "site\/templates\/blogue.php",
"textdomain": "site--templates--blogue-php",
"translations": {
"0aef62c2fab347cd350a3eb4263cd85c": {
"text": "Autor"
},
"82a3fdfb69baf6fb0be4dae7be23c8d1": {
"text": "Leer m\u00e1s"
}
}
}

View file

@ -0,0 +1,5 @@
{
"file": "site\/templates\/categoria.php",
"textdomain": "site--templates--categoria-php",
"translations": []
}

View file

@ -0,0 +1,5 @@
{
"file": "site\/templates\/etiqueta.php",
"textdomain": "site--templates--etiqueta-php",
"translations": []
}

View file

@ -0,0 +1,5 @@
{
"file": "site\/templates\/publicacion.php",
"textdomain": "site--templates--publicacion-php",
"translations": []
}

View file

@ -0,0 +1,12 @@
{
"file": "site\/ready.php",
"textdomain": "site--ready-php",
"translations": {
"d42d3a059f66d7c7922c501182602073": {
"text": "%d publicaci\u00f3n"
},
"96d2fb5e7d8d946eaad05f309ae96e7c": {
"text": "%d publicaci\u00f3ns"
}
}
}

View file

@ -0,0 +1,12 @@
{
"file": "site\/templates\/blogue.php",
"textdomain": "site--templates--blogue-php",
"translations": {
"0aef62c2fab347cd350a3eb4263cd85c": {
"text": "Autor"
},
"82a3fdfb69baf6fb0be4dae7be23c8d1": {
"text": "Ler m\u00e1is"
}
}
}

View file

@ -0,0 +1,5 @@
{
"file": "site\/templates\/categoria.php",
"textdomain": "site--templates--categoria-php",
"translations": []
}

View file

@ -0,0 +1,5 @@
{
"file": "site\/templates\/etiqueta.php",
"textdomain": "site--templates--etiqueta-php",
"translations": []
}

View file

@ -0,0 +1,5 @@
{
"file": "site\/templates\/publicacion.php",
"textdomain": "site--templates--publicacion-php",
"translations": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

61
site/ready.php Normal file
View file

@ -0,0 +1,61 @@
<?php namespace ProcessWire;
/**
* ProcessWire Bootstrap API Ready
* ===============================
* This ready.php file is called during ProcessWire bootstrap initialization process.
* This occurs after the current page has been determined and the API is fully ready
* to use, but before the current page has started rendering. This file receives a
* copy of all ProcessWire API variables. This file is an idea place for adding your
* own hook methods.
*
*/
if(!defined("PROCESSWIRE")) die();
/** @var ProcessWire $wire */
/**
* Example of a custom hook method
*
* This hook adds a “numPosts” method to pages using template “category”.
* The return value is the quantity of posts in category.
*
* Usage:
* ~~~~~
* $numPosts = $page->numPosts(); // returns integer
* numPosts = $page->numPosts(true); // returns string like "5 posts"
* ~~~~~
*
*/
$wire->addHook('Page(template=categoria)::numPosts', function($event)
{
$page = $event->object;
if($page->template != 'categoria') return;
$numPosts = $event->pages->count("template=publicacion, categorias=$page");
if($event->arguments(0) === true)
{
$numPosts = sprintf(_n('%d post', '%d posts', $numPosts), $numPosts);
}
$event->return = $numPosts;
});
$wire->addHook('Page(template=etiqueta)::numPosts', function($event)
{
$page = $event->object;
if($page->template != 'etiqueta') return;
$numPosts = $event->pages->count("template=publicacion, etiquetas=$page");
if($event->arguments(0) === true)
{
$numPosts = sprintf(_n('%d post', '%d posts', $numPosts), $numPosts);
}
$event->return = $numPosts;
});

View file

@ -22,6 +22,17 @@ function getConfig($paxina)
return $configuracion; return $configuracion;
} }
function getTextoLimpo($texto)
{
$texto = preg_replace ('/<[^>]*>/', ' ', $texto);
$texto = str_replace("\r", '', $texto);
$texto = str_replace("\n", ' ', $texto);
$texto = str_replace("\t", ' ', $texto);
$texto = trim(preg_replace('/ {2,}/', ' ', $texto));
return $texto;
}
function getSeccions($seccions) function getSeccions($seccions)
{ {
$saida = ''; $saida = '';
@ -121,6 +132,24 @@ function renderMigasPan($paxina, $separador = '<i class="icon-chevrons-right"></
return $saida; return $saida;
} }
function renderPaxinacion($artigos, $posicion)
{
$paxinacion = $artigos->renderPager(array(
'listMarkup' => '<nav id="paxinacion-' . $posicion . '" class="paxinacion"><ul>{out}</ul></nav>',
'itemMarkup' => '<li class="{class}">{out}</li>',
'linkMarkup' => '<a href="{url}"><span>{out}</span></a>',
'nextItemLabel' => '<i class="icon-skip-forward"></i>',
'previousItemLabel' => '<i class="icon-skip-back"></i>',
'separatorItemClass' => 'separador',
'nextItemClass' => 'seguinte',
'previousItemClass' => 'anterior',
'lastItemClass' => 'derradeiro',
'currentItemClass' => 'actual'
));
return $paxinacion;
}
function renderTexto($titulo, $texto) function renderTexto($titulo, $texto)
{ {
$saida = ''; $saida = '';
@ -259,4 +288,21 @@ function renderImaxeLigazon($titular, $imaxe, $ligazon)
$saida .= '</div>' . "\n"; $saida .= '</div>' . "\n";
return $saida; return $saida;
} }
function renderResumen($texto = '', $limite = 120, $fin = '...')
{
if($texto == '') return '';
if(strlen($texto) <= $limite) return $texto;
$saida = substr($texto, 0, $limite);
$pos = strrpos($saida, " ");
if($pos>0)
{
$saida = substr($saida, 0, $pos);
}
$saida .= $fin;
return $saida;
}

View file

@ -10,4 +10,100 @@ else
{ {
$menu = renderMenu($inicio->and($inicio->children), 0, 'paxinas'); $menu = renderMenu($inicio->and($inicio->children), 0, 'paxinas');
$contido = ''; $contido = '';
$categorias = pages()->get('/noticias/categorias/')->children();
$etiquetas = pages()->get('/noticias/etiquetas/')->children();
$contido .= ' ' . renderMigasPan($page) . "\n";
$contido .= ' <article id="' . $page->name .'">' . "\n";
$contido .= ' <header>' . "\n";
$contido .= ' <div class="columna">' . "\n";
$contido .= ' <h2>' . ucfirst($page->title) . '</h2>' . "\n";
$contido .= ' </div>' . "\n";
$contido .= ' </header>' . "\n";
$contido .= ' <div class="contedor">' . "\n";
$contido .= ' <section id="categorias">' . "\n";
$contido .= ' <h3>' . pages()->get('/noticias/categorias/')->title . '</h3>' . "\n";
$contido .= ' <ul class="lista">' . "\n";
foreach($categorias as $categoria)
{
$contido .= ' <li class="info">' . "\n";
$contido .= ' <a href="' . $categoria->url . '"><i class="icon-folder"></i> ' . $categoria->title . '</a>' . "\n";
$contido .= ' <span>(' . $categoria->numPosts(true) . ')</span>' . "\n";
$contido .= ' </li>' . "\n";
}
$contido .= ' </ul>' . "\n";
$contido .= ' </section>' . "\n";
$contido .= ' <section id="etiquetas">' . "\n";
$contido .= ' <h3>' . pages()->get('/noticias/etiquetas/')->title . '</h3>' . "\n";
$contido .= ' <ul class="nube">' . "\n";
foreach($etiquetas as $etiqueta)
{
$contido .= ' <li class="info">' . "\n";
$contido .= ' <a href="' . $etiqueta->url . '"><i class="icon-tag"></i> ' . $etiqueta->title . '</a>' . "\n";
$contido .= ' <span>(' . $etiqueta->numPosts(true) . ')</span>' . "\n";
$contido .= ' </li>' . "\n";
}
$contido .= ' </ul>' . "\n";
$contido .= ' </section>' . "\n";
$contido .= '<section id="publicacions">' . "\n";
if($page->numChildren)
{
$publicacions = pages()->get('/noticias/publicacions/')->children("template='publicacion',sort=-data_publicacion,limit=10");
$contido .= renderPaxinacion($publicacions, 'superior');
foreach($publicacions as $publicacion)
{
$data = strtotime($publicacion->data_publicacion);
$dateFormatter = \IntlDateFormatter::create(
$languages->getLocale(),
\IntlDateFormatter::NONE,
\IntlDateFormatter::NONE,
\date_default_timezone_get(),
\IntlDateFormatter::GREGORIAN
);
$contido .= '<div class="artigo">' . "\n";
$contido .= '<header class="publicacion-info">' . "\n";
$contido .= '<div class="data">' . "\n";
$contido .= '<time datetime="' . $publicacion->data_publicacion . '">' ."\n";
$dateFormatter->setPattern('EEEE');
$contido .= '<em>' . ucfirst(datefmt_format($dateFormatter, $data)) . '</em>' . "\n";
$dateFormatter->setPattern('MMMM');
$contido .= '<strong>' . ucfirst(datefmt_format($dateFormatter, $data)) . '</strong>' . "\n";
$dateFormatter->setPattern('dd');
$contido .= '<span>' . datefmt_format($dateFormatter, $data) . '</span>' . "\n";
$contido .= '</time>' . "\n";
$contido .= '</div>' . "\n";
$contido .= '<div class="info">' . "\n";
$contido .= '<h3 class="publicacion-titulo">' . "\n";
$contido .= '<a href="' . $publicacion->url . '"><i class="icon-book"></i> ' . $publicacion->title . '</a>' . "\n";
$contido .= '</h3>' . "\n";
$contido .= '<dl>' . "\n";
$contido .= '<dt title="' . _x('Author', 'Post author') . '"><i class="icon-user"></i><span class="oculto-movil"> ' . _x('Author', 'Post author') . '</span></dt>' . "\n";
$contido .= '<dd>' . ucfirst($publicacion->createdUser->name) . '</dd>' . "\n";
$contido .= '<dt title="' . pages()->get('/noticias/categorias/')->title . '"><i class="icon-folder"></i><span class="oculto-movil"> ' . pages()->get('/noticias/categorias/')->title . '</span></dt>' . "\n";
$contido .= '<dd><a href="' . $publicacion->categorias->url . '">' . $publicacion->categorias->title . '</a></dd>' . "\n";
$contido .= '<dt title="' . pages()->get('/noticias/etiquetas/')->title . '"><i class="icon-tag"></i><span class="oculto-movil"> ' . pages()->get('/noticias/etiquetas/')->title . '</span></dt>' . "\n";
$contido .= '<dd>' . $publicacion->etiquetas->each("<a href='{url}'>{title}</a>") . '</dd>' . "\n";
$contido .= '</dl>' . "\n";
$contido .= '</div>' . "\n";
$contido .= '</header>' . "\n";
$contido .= '<div class="resumo">' . "\n";
$contido .= '<p>' . renderResumen(getTextoLimpo(getSeccions($publicacion->seccions))) . '</p>' . "\n";
$contido .= '<p><a href="' . $publicacion->url . '"><i class="icon-arrow-right"></i>' . _x("Read more", "Read more") . '</a></p>' ."\n";
$contido .= '</div>' . "\n";
$contido .= '</div>' . "\n";
}
$contido .= renderPaxinacion($publicacions, 'inferior');
}
$contido .= '</section>' . "\n";
$contido .= '</div>' . "\n";
$contido .= '</article>' . "\n";
} }

View file

@ -0,0 +1,68 @@
<?php namespace ProcessWire;
$menu = '';
$contido = '';
$mantemento = $inicio->mantemento;
if($mantemento && !$user->isLoggedin())
{
$session->redirect($inicio->url);
}
else
{
$contido .= '<article id="' . $page->name . '">' . "\n";
$contido .= '<h2 class="bloque"><i class="icon-folder"></i> ' . $page->parent()->title . ': ' . ucfirst($page->title) . '</h2>' . "\n";
$publicacions = pages()->get('/publicacions/')->children("template='publicacion',categorias=$page,sort=-data_publicacion,limit=10");
$contido .= '<section id="publicacions">' . "\n";
$contido .= renderPaxinacion($publicacions, 'superior');
foreach($publicacions as $publicacion)
{
$data = strtotime($publicacion->data_publicacion);
$dateFormatter = \IntlDateFormatter::create(
$languages->getLocale(),
\IntlDateFormatter::NONE,
\IntlDateFormatter::NONE,
\date_default_timezone_get(),
\IntlDateFormatter::GREGORIAN
);
$contido .= '<div class="artigo">' . "\n";
$contido .= '<header class="publicacion-info">' . "\n";
$contido .= '<div class="data">' . "\n";
$contido .= '<time datetime="' . $publicacion->data_publicacion . '">' ."\n";
$dateFormatter->setPattern('EEEE');
$contido .= '<em>' . ucfirst(datefmt_format($dateFormatter, $data)) . '</em>' . "\n";
$dateFormatter->setPattern('MMMM');
$contido .= '<strong>' . ucfirst(datefmt_format($dateFormatter, $data)) . '</strong>' . "\n";
$dateFormatter->setPattern('dd');
$contido .= '<span>' . datefmt_format($dateFormatter, $data) . '</span>' . "\n";
$contido .= '</time>' . "\n";
$contido .= '</div>' . "\n";
$contido .= '<div class="info">' . "\n";
$contido .= '<h3 class="publicacion-titulo">' . "\n";
$contido .= '<a href="' . $publicacion->url . '"><i class="icon-book"></i> ' . $publicacion->title . '</a>' . "\n";
$contido .= '</h3>' . "\n";
$contido .= '<dl>' . "\n";
$contido .= '<dt title="' . _x('Autor', 'Post author') . '"><i class="icon-user"></i><span class="oculto-movil"> ' . _x('Autor', 'Post author') . '</span></dt>' . "\n";
$contido .= '<dd>' . $publicacion->createdUser->name . '</dd>' . "\n";
$contido .= '<dt title="' . pages()->get('/categorias/')->title . '"><i class="icon-folder"></i><span class="oculto-movil"> ' . pages()->get('/categorias/')->title . '</span></dt>' . "\n";
$contido .= '<dd><a href="' . $publicacion->categorias->url . '">' . $publicacion->categorias->title . '</a></dd>' . "\n";
$contido .= '<dt title="' . pages()->get('/etiquetas/')->title . '"><i class="icon-tag"></i><span class="oculto-movil"> ' . pages()->get('/etiquetas/')->title . '</span></dt>' . "\n";
$contido .= '<dd>' . $publicacion->etiquetas->each("<a href='{url}'>{title}</a>") . '</dd>' . "\n";
$contido .= '</dl>' . "\n";
$contido .= '</div>' . "\n";
$contido .= '</header>' . "\n";
$contido .= '<div class="resumo">' . "\n";
$contido .= '<p>' . renderResumen(getTextoLimpo(getSeccions($publicacion->seccions))) . '</p>' . "\n";
$contido .= '<p><a href="' . $publicacion->url . '"><i class="icon-arrow-right"></i>' . _x("Ler máis", "Read more") . '</a></p>' ."\n";
$contido .= '</div>' . "\n";
$contido .= '</div>' . "\n";
}
$contido .= renderPaxinacion($publicacions, 'inferior');
$contido .= '</section>' . "\n";
$contido .= '</article>' . "\n";
}

View file

@ -0,0 +1,3 @@
<?php namespace ProcessWire;
$session->redirect($inicio->url);

View file

@ -70,6 +70,37 @@ a
text-decoration-style: dotted; text-decoration-style: dotted;
} }
dl
{
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 10%;
max-width: 18.75rem;
margin: 0;
}
dt
{
width: 10%;
}
dt::after
{
content: ": ";
}
dd
{
width: 80%;
margin: 0;
padding: 0;
}
img img
{ {
width: 100%; width: 100%;
@ -80,6 +111,11 @@ figure
margin: 0; margin: 0;
} }
ul li
{
list-style: none;
}
figure figcaption figure figcaption
{ {
padding: 10px 40px 20px; padding: 10px 40px 20px;
@ -371,10 +407,30 @@ article header
), var(--imaxe_destacada); ), var(--imaxe_destacada);
} }
article header h2 article#noticias div.contedor,
section#publicacions
{ {
margin: 30px; display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
}
article#noticias section#categorias,
article#noticias section#etiquetas,
article#noticias section#publicacions,
section#publicacions div.artigo
{
width: 100%;
}
section#publicacions div.artigo
{
margin: 0.5rem;
}
article section > h3
{
text-align: center; text-align: center;
} }
@ -507,6 +563,13 @@ figure.enlace figcaption a
text-transform: uppercase; text-transform: uppercase;
} }
div.artigo
{
padding: 10px;
border: 1px solid rgb(var(--cor_10));
}
form#inicio-sesion form#inicio-sesion
{ {
display: flex; display: flex;
@ -597,6 +660,56 @@ form#inicio-sesion div.elemento > *
justify-content: center; justify-content: center;
} }
.info
{
color: rgb(var(--cor_30));
font-size: 0.875rem;
}
.info a
{
color: rgb(var(--cor_30));
font-size: 0.875rem;
text-decoration: none;
}
.artigo p
{
margin-bottom: 1rem;
}
ul.lista
{
margin: 1rem 0;
padding-left: 1rem;
text-align: center;
}
ul.nube
{
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 1rem;
justify-content: center;
margin: 1rem 0;
padding-left: 1rem;
}
div.resumo
{
padding: 0.625rem;
}
.oculto-movil
{
display: none;
}
.visually-hidden .visually-hidden
{ {
position: absolute; position: absolute;
@ -653,6 +766,21 @@ form#inicio-sesion div.elemento > *
@media (min-width: 1024px) @media (min-width: 1024px)
{ {
dl
{
gap: 0;
}
dt
{
width: 50%;
}
dd
{
width: 50%;
}
header#cabeceira div.contedor header#cabeceira div.contedor
{ {
align-items: flex-start; align-items: flex-start;
@ -729,7 +857,18 @@ form#inicio-sesion div.elemento > *
article header, article header .columna article header, article header .columna
{ {
height: 200px; height: 100px;
}
article#noticias section#categorias,
article#noticias section#etiquetas
{
width: 50%;
}
section#publicacions div.artigo
{
width: calc(50% - 1rem);
} }
form#inicio-sesion form#inicio-sesion
@ -772,6 +911,16 @@ form#inicio-sesion div.elemento > *
width: 100%; width: 100%;
max-width: 62.5rem; max-width: 62.5rem;
} }
.oculto-escritorio
{
display: none;
}
.oculto-movil
{
display: initial;
}
} }
@media (min-width: 1025px) @media (min-width: 1025px)

View file

@ -0,0 +1,68 @@
<?php namespace ProcessWire;
$menu = '';
$contido = '';
$mantemento = $inicio->mantemento;
if($mantemento && !$user->isLoggedin())
{
$session->redirect($inicio->url);
}
else
{
$contido .= '<article id="' . $page->name . '">' . "\n";
$contido .= '<h2 class="bloque"><i class="icon-tag"></i> ' . $page->parent()->title . ': ' . ucfirst($page->title) . '</h2>' . "\n";
$publicacions = pages()->get('/publicacions/')->children("template='publicacion',etiquetas=$page,sort=-data_publicacion,limit=10");
$contido .= '<section id="publicacions">' . "\n";
$contido .= renderPaxinacion($publicacions, 'superior');
foreach($publicacions as $publicacion)
{
$data = strtotime($publicacion->data_publicacion);
$dateFormatter = \IntlDateFormatter::create(
$languages->getLocale(),
\IntlDateFormatter::NONE,
\IntlDateFormatter::NONE,
\date_default_timezone_get(),
\IntlDateFormatter::GREGORIAN
);
$contido .= '<div class="artigo">' . "\n";
$contido .= '<header class="publicacion-info">' . "\n";
$contido .= '<div class="data">' . "\n";
$contido .= '<time datetime="' . $publicacion->data_publicacion . '">' ."\n";
$dateFormatter->setPattern('EEEE');
$contido .= '<em>' . ucfirst(datefmt_format($dateFormatter, $data)) . '</em>' . "\n";
$dateFormatter->setPattern('MMMM');
$contido .= '<strong>' . ucfirst(datefmt_format($dateFormatter, $data)) . '</strong>' . "\n";
$dateFormatter->setPattern('dd');
$contido .= '<span>' . datefmt_format($dateFormatter, $data) . '</span>' . "\n";
$contido .= '</time>' . "\n";
$contido .= '</div>' . "\n";
$contido .= '<div class="info">' . "\n";
$contido .= '<h3 class="publicacion-titulo">' . "\n";
$contido .= '<a href="' . $publicacion->url . '"><i class="icon-book"></i> ' . $publicacion->title . '</a>' . "\n";
$contido .= '</h3>' . "\n";
$contido .= '<dl>' . "\n";
$contido .= '<dt title="' . _x('Autor', 'Post author') . '"><i class="icon-user"></i><span class="oculto-movil"> ' . _x('Autor', 'Post author') . '</span></dt>' . "\n";
$contido .= '<dd>' . $publicacion->createdUser->name . '</dd>' . "\n";
$contido .= '<dt title="' . pages()->get('/categorias/')->title . '"><i class="icon-folder"></i><span class="oculto-movil"> ' . pages()->get('/categorias/')->title . '</span></dt>' . "\n";
$contido .= '<dd><a href="' . $publicacion->categorias->url . '">' . $publicacion->categorias->title . '</a></dd>' . "\n";
$contido .= '<dt title="' . pages()->get('/etiquetas/')->title . '"><i class="icon-tag"></i><span class="oculto-movil"> ' . pages()->get('/etiquetas/')->title . '</span></dt>' . "\n";
$contido .= '<dd>' . $publicacion->etiquetas->each("<a href='{url}'>{title}</a>") . '</dd>' . "\n";
$contido .= '</dl>' . "\n";
$contido .= '</div>' . "\n";
$contido .= '</header>' . "\n";
$contido .= '<div class="resumo">' . "\n";
$contido .= '<p>' . renderResumen(getTextoLimpo(getSeccions($publicacion->seccions))) . '</p>' . "\n";
$contido .= '<p><a href="' . $publicacion->url . '"><i class="icon-arrow-right"></i>' . _x("Ler máis", "Read more") . '</a></p>' ."\n";
$contido .= '</div>' . "\n";
$contido .= '</div>' . "\n";
}
$contido .= renderPaxinacion($publicacions, 'inferior');
$contido .= '</section>' . "\n";
$contido .= '</article>' . "\n";
}

View file

@ -15,7 +15,7 @@ else
$menu = renderMenu($inicio->and($inicio->children), 0, 'paxinas'); $menu = renderMenu($inicio->and($inicio->children), 0, 'paxinas');
$contido .= ' ' . renderMigasPan($page) . "\n"; $contido .= ' ' . renderMigasPan($page) . "\n";
$contido .= ' <article id="' . $page->title .'">' . "\n"; $contido .= ' <article id="' . $page->name .'">' . "\n";
$contido .= ' <header>' . "\n"; $contido .= ' <header>' . "\n";
$contido .= ' <div class="columna">' . "\n"; $contido .= ' <div class="columna">' . "\n";
$contido .= ' <h2>' . ucfirst($page->title) . '</h2>' . "\n"; $contido .= ' <h2>' . ucfirst($page->title) . '</h2>' . "\n";

View file

@ -15,7 +15,7 @@ else
$menu = renderMenu($inicio->and($inicio->children), 0, 'paxinas'); $menu = renderMenu($inicio->and($inicio->children), 0, 'paxinas');
$contido .= ' ' . renderMigasPan($page) . "\n"; $contido .= ' ' . renderMigasPan($page) . "\n";
$contido .= ' <article id="' . $page->title .'">' . "\n"; $contido .= ' <article id="' . $page->name .'">' . "\n";
$contido .= ' <header>' . "\n"; $contido .= ' <header>' . "\n";
$contido .= ' <div class="columna">' . "\n"; $contido .= ' <div class="columna">' . "\n";
$contido .= ' <h2>' . ucfirst($page->title) . '</h2>' . "\n"; $contido .= ' <h2>' . ucfirst($page->title) . '</h2>' . "\n";

View file

@ -15,7 +15,7 @@ else
$menu = renderMenu($inicio->and($inicio->children), 0, 'paxinas'); $menu = renderMenu($inicio->and($inicio->children), 0, 'paxinas');
$contido .= ' ' . renderMigasPan($page) . "\n"; $contido .= ' ' . renderMigasPan($page) . "\n";
$contido .= ' <article id="' . $page->title .'">' . "\n"; $contido .= ' <article id="' . $page->name .'">' . "\n";
$contido .= ' <header>' . "\n"; $contido .= ' <header>' . "\n";
$contido .= ' <div class="columna">' . "\n"; $contido .= ' <div class="columna">' . "\n";
$contido .= ' <h2>' . ucfirst($page->title) . '</h2>' . "\n"; $contido .= ' <h2>' . ucfirst($page->title) . '</h2>' . "\n";

View file

@ -0,0 +1,76 @@
<?php namespace ProcessWire;
$menu = '';
$contido = '';
$mantemento = $inicio->mantemento;
if($mantemento && !$user->isLoggedin())
{
$session->redirect($inicio->url);
}
else
{
$data = strtotime($page->data_publicacion);
$dateFormatter = \IntlDateFormatter::create(
$languages->getLocale(),
\IntlDateFormatter::NONE,
\IntlDateFormatter::NONE,
\date_default_timezone_get(),
\IntlDateFormatter::GREGORIAN
);
$contido .= '<article id="' . $page->name . '">' . "\n";
$contido .= '<h2 class="bloque"><i class="icon-book-open"></i> ' . $page->parent()->title . ': ' . ucfirst($page->title) . '</h2>' . "\n";
$contido .= '<header class="publicacion-info">' . "\n";
$contido .= '<div class="data">' . "\n";
$contido .= '<time datetime="' . $page->data_publicacion . '">' ."\n";
$dateFormatter->setPattern('EEEE');
$contido .= '<em>' . ucfirst(datefmt_format($dateFormatter, $data)) . '</em>' . "\n";
$dateFormatter->setPattern('MMMM');
$contido .= '<strong>' . ucfirst(datefmt_format($dateFormatter, $data)) . '</strong>' . "\n";
$dateFormatter->setPattern('dd');
$contido .= '<span>' . datefmt_format($dateFormatter, $data) . '</span>' . "\n";
$contido .= '</time>' . "\n";
$contido .= '</div>' . "\n";
$contido .= '<div class="info">' . "\n";
$contido .= '<dl>' . "\n";
$contido .= '<dt title="' . _x('Autor', 'Post author') . '"><i class="icon-user"></i><span class="oculto-movil"> ' . _x('Autor', 'Post author') . '</span></dt>' . "\n";
$contido .= '<dd>' . $page->createdUser->name . '</dd>' . "\n";
$contido .= '<dt title="' . pages()->get('/categorias/')->title . '"><i class="icon-folder"></i><span class="oculto-movil"> ' . pages()->get('/categorias/')->title . '</span></dt>' . "\n";
$contido .= '<dd><a href="' . $page->categorias->url . '">' . $page->categorias->title . '</a></dd>' . "\n";
$contido .= '<dt title="' . pages()->get('/etiquetas/')->title . '"><i class="icon-tag"></i><span class="oculto-movil"> ' . pages()->get('/etiquetas/')->title . '</span></dt>' . "\n";
$contido .= '<dd>' . $page->etiquetas->each("<a href='{url}'>{title}</a>") . '</dd>' . "\n";
$contido .= '</dl>' . "\n";
$contido .= '</div>' . "\n";
$contido .= '</header>' . "\n";
$contido .= '<div class="resumo">' . "\n";
$contido .= getSeccions($page->seccions) . "\n";
$contido .= '</div>' . "\n";
$contido .= '</article>' . "\n";
/*
echo ukBlogPost(page());
// comments
$comments = page()->comments;
// comment list
if(count($comments)) {
echo ukHeading3("Comments", "icon=comments");
echo ukComments($comments);
}
// comment form
echo ukHeading3("Post a comment", "icon=comment");
echo ukCommentForm($comments);
// link to the next blog post, if there is one
$nextPost = page()->next();
if($nextPost->id): ?>
<p class='next-blog-post'>
Next <?=ukIcon('chevron-right')?>
<a href='<?=$nextPost->url?>'><?=$nextPost->title?></a>
</p>
<?php endif; ?> */
}