2022-01-20 09:58:26 +01:00
|
|
|
<!--
|
|
|
|
* Este archivo es parte de Nabu.
|
|
|
|
*
|
|
|
|
* Nabu es software libre: puedes redistribuirlo y/o modificarlo
|
|
|
|
* bajo los términos de la Licencia Pública General de GNU Affero publicada por
|
|
|
|
* la Free Software Foundation, ya sea la versión 3 de la Licencia, o
|
|
|
|
* (a su elección) cualquier versión posterior.
|
|
|
|
*
|
|
|
|
* Nabu se distribuye con la esperanza de que sea de utilidad,
|
|
|
|
* pero SIN NINGUNA GARANTÍA; incluso sin la garantía implícita de
|
|
|
|
* COMERCIABILIDAD o APTITUD PARA UN PROPÓSITO PARTICULAR. Consulte la
|
|
|
|
* Licencia Pública General de GNU Affero para obtener más detalles.
|
|
|
|
*
|
|
|
|
* Debería haber recibido una copia de la Licencia Pública General de GNU Affero
|
|
|
|
* junto con este programa. De lo contrario, consulte <https://www.gnu.org/licenses/>.
|
|
|
|
-->
|
|
|
|
|
2021-10-06 21:02:20 +02:00
|
|
|
<?php defined('NABU') || exit() ?>
|
2022-01-20 09:58:26 +01:00
|
|
|
|
2021-09-21 05:13:35 +02:00
|
|
|
<?php $head_title = 'Artículo' ?>
|
2022-01-20 09:58:26 +01:00
|
|
|
|
|
|
|
<!-- Estilos a cargar -->
|
|
|
|
<?php $styles = array(
|
2021-11-09 01:09:14 +01:00
|
|
|
'components/navbar/navbar.css',
|
2021-09-25 06:53:12 +02:00
|
|
|
'components/articles/articles.css',
|
2021-11-09 01:09:14 +01:00
|
|
|
'components/footer/footer.css',
|
2022-02-24 21:25:19 +01:00
|
|
|
'components/messages/messages.css',
|
2022-01-20 09:58:26 +01:00
|
|
|
'pages/article/article.css'
|
2021-09-21 05:13:35 +02:00
|
|
|
) ?>
|
2022-01-20 09:58:26 +01:00
|
|
|
|
|
|
|
<!-- Estilos a cargar para el responsive design -->
|
2021-09-25 08:08:48 +02:00
|
|
|
<?php $desktop_styles = array(
|
2022-01-30 05:17:25 +01:00
|
|
|
array('file' => 'components/navbar/navbar-desktop.css', 'attributes' => 'media="screen and (min-width: 768px)"'),
|
2022-01-20 09:58:26 +01:00
|
|
|
array('file' => 'pages/article/article-desktop.css', 'attributes' => 'media="screen and (min-width: 768px)"')
|
2021-11-09 01:09:14 +01:00
|
|
|
) ?>
|
2022-01-20 09:58:26 +01:00
|
|
|
|
|
|
|
<!-- Archivos de javascript a cargar -->
|
2021-11-09 01:09:14 +01:00
|
|
|
<?php $scripts = array(
|
|
|
|
'home.js',
|
2021-09-25 08:08:48 +02:00
|
|
|
) ?>
|
2022-01-20 09:58:26 +01:00
|
|
|
|
2021-11-09 01:09:14 +01:00
|
|
|
<!-- HTML head -->
|
2022-03-11 01:02:21 +01:00
|
|
|
<link rel="stylesheet" href="/assets/highlight/dracula.css">
|
2021-09-21 05:13:35 +02:00
|
|
|
<?php require_once 'views/components/head.php' ?>
|
2022-02-21 01:58:58 +01:00
|
|
|
<?php require_once 'views/components/messages.php' ?>
|
2022-03-11 01:02:21 +01:00
|
|
|
|
2022-02-21 01:58:58 +01:00
|
|
|
|
2021-11-09 01:09:14 +01:00
|
|
|
<!-- HTML body -->
|
|
|
|
<header>
|
2022-03-03 20:33:17 +01:00
|
|
|
<!-- Imagen de fondo dl post -->
|
|
|
|
<img src="/assets/images/cover.svg" alt="Imagen de fondo del post" class="post__back-image">
|
2021-11-09 04:12:19 +01:00
|
|
|
<!-- Nav bar -->
|
2021-11-09 01:09:14 +01:00
|
|
|
<?php require_once 'views/components/navbar.php' ?>
|
|
|
|
<div class="post__head">
|
|
|
|
<h1 class="post__title">
|
2022-02-20 22:55:18 +01:00
|
|
|
<?= $article['title'] ?>
|
2021-11-09 01:09:14 +01:00
|
|
|
</h1>
|
|
|
|
<div class="post__details">
|
2022-02-20 22:55:18 +01:00
|
|
|
<a class="post__author-link" href="<?= $article['profile'] ?>">
|
2021-11-09 01:09:14 +01:00
|
|
|
<picture class="post__profile">
|
2022-02-20 22:55:18 +01:00
|
|
|
<img src="<?= $article['avatar'] ?>" alt="Foto de perfil del autor" class="post__img-author">
|
2021-11-09 01:09:14 +01:00
|
|
|
</picture>
|
|
|
|
</a>
|
|
|
|
<div class="post__info">
|
|
|
|
<p class="post__author-name">
|
2022-02-20 22:55:18 +01:00
|
|
|
<a href="<?= $article['profile'] ?>">
|
2022-02-21 18:56:14 +01:00
|
|
|
<?= $article['username'] ?>
|
2021-11-09 01:09:14 +01:00
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
<p class="post__date">
|
2022-02-20 22:55:18 +01:00
|
|
|
<?= $article['date'] ?>
|
2021-11-09 01:09:14 +01:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</header>
|
2021-09-21 05:13:35 +02:00
|
|
|
|
2021-11-09 01:09:14 +01:00
|
|
|
<section class="post__body">
|
2022-01-08 03:47:20 +01:00
|
|
|
<aside class='post__aside'>
|
2022-01-15 07:35:09 +01:00
|
|
|
<div class="heart">
|
|
|
|
<input type="checkbox" id='toggle__heart'>
|
2022-02-23 00:34:39 +01:00
|
|
|
<label for="toggle__heart"><a href="<?= NABU_ROUTES['likes'] . '&slug=' . $article['slug'] ?>">❤</a></label>
|
2022-01-15 07:35:09 +01:00
|
|
|
</div>
|
2022-01-08 03:47:20 +01:00
|
|
|
</aside>
|
|
|
|
|
2021-11-09 01:09:14 +01:00
|
|
|
<article class="post__copy">
|
2022-03-11 01:02:21 +01:00
|
|
|
<pre>
|
|
|
|
<code>
|
|
|
|
const hi = 2;
|
|
|
|
</code>
|
|
|
|
</pre>
|
2022-02-20 22:55:18 +01:00
|
|
|
<?= $article['body'] ?>
|
2021-11-09 01:09:14 +01:00
|
|
|
</article>
|
|
|
|
</section>
|
2021-09-21 05:13:35 +02:00
|
|
|
|
2021-11-09 01:09:14 +01:00
|
|
|
<section class="popular-posts">
|
|
|
|
<h2 class="popular-posts__title">También tenemos esto para ti</h2>
|
|
|
|
<section class="popular-cards__container">
|
|
|
|
<?php require 'views/components/articles.php' ?>
|
|
|
|
</section>
|
|
|
|
</section>
|
2021-09-21 05:13:35 +02:00
|
|
|
|
2021-11-09 01:09:14 +01:00
|
|
|
<section class="author-info">
|
|
|
|
<div class="author-info__container">
|
2022-02-21 20:22:21 +01:00
|
|
|
<a href="<?= $article['profile'] ?>">
|
|
|
|
<picture class="author-info__image">
|
|
|
|
<img class="author__image" src="<?= $article['avatar'] ?>">
|
|
|
|
</picture>
|
|
|
|
</a>
|
2021-11-09 01:09:14 +01:00
|
|
|
<div class="author-info__text">
|
|
|
|
<h3 class="author-info__title">
|
2022-02-20 22:55:18 +01:00
|
|
|
<a href="<?= $article['profile'] ?>">
|
2021-11-09 01:09:14 +01:00
|
|
|
<?= $article['author'] ?>
|
|
|
|
</a>
|
|
|
|
</h3>
|
|
|
|
<p class="author-info__description">
|
2022-02-20 22:55:18 +01:00
|
|
|
<?= $article['description'] ?>
|
2021-11-09 01:09:14 +01:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
2021-09-21 05:13:35 +02:00
|
|
|
|
2021-11-09 01:09:14 +01:00
|
|
|
<section class="comments">
|
|
|
|
<div class="comments__container">
|
|
|
|
<h2 class="comments__title">Deja tu opinión al autor</h2>
|
|
|
|
<div class="comments__box">
|
2022-03-03 20:03:45 +01:00
|
|
|
<a href="<?= $login['profile'] ?>" class="comments__user-link">
|
2022-02-21 20:22:21 +01:00
|
|
|
<picture class="author-info__image comment__user-image-container">
|
2022-03-03 20:03:45 +01:00
|
|
|
<img class="comment__user-image" src="<?= $login['avatar'] ?>">
|
2022-02-21 20:22:21 +01:00
|
|
|
</picture>
|
|
|
|
</a>
|
2022-02-21 01:18:10 +01:00
|
|
|
<form class="comments__form" method="POST" action="<?= $view ?>">
|
|
|
|
<input type="hidden" name="csrf" value="<?= $token ?>">
|
2022-02-21 01:58:58 +01:00
|
|
|
<textarea class="comments__textarea" placeholder="Hazle saber que estuviste aqui" minlength="1" maxlength="255" name="body" required></textarea>
|
2022-02-21 01:18:10 +01:00
|
|
|
<input type="submit" name="comments-form" class="comments__button" value="Enviar">
|
2021-11-09 01:09:14 +01:00
|
|
|
</form>
|
|
|
|
</div>
|
2022-03-03 20:03:45 +01:00
|
|
|
<section class="comments__list">
|
|
|
|
<?php foreach($comments as $comment): ?>
|
|
|
|
<?php $profile = NABU_ROUTES['profile'] . '&user=' . urlencode($comment['username']) ?>
|
|
|
|
<?php $comment['date'] = utils::format_date($comment['date']) ?>
|
|
|
|
<artcile class="comments__item">
|
|
|
|
<a href="<?= $profile ?>" class="comments__user-link">
|
|
|
|
<picture class="author-info__image comment__user-image-container">
|
|
|
|
<img src="<?= utils::url_image('avatar', $comment['avatar']) ?>" class="comment__user-image">
|
|
|
|
</picture>
|
|
|
|
</a>
|
|
|
|
<p class="commnets__text">
|
|
|
|
<?= utils::escape($comment['body']) ?>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<div class="comments__info">
|
|
|
|
<p class="comments__data">
|
|
|
|
<a class="comments__user-name" href="<?= $profile ?>"><?= utils::escape($comment['username']) ?></a>
|
|
|
|
<?= $comment['date']['day'] . ' de ' . $comment['date']['month'] . ' ' . $comment['date']['year'] ?>
|
|
|
|
</p>
|
|
|
|
<?php if ((isset($login['id']) && $login['id'] == $comment['user_id']) || (isset($login['role']) && ($login['role'] == 'admin' || $login['role'] == 'moderator'))): ?>
|
|
|
|
<a href="<?= NABU_ROUTES['delete-comment'] . '&id=' . $comment['id'] ?>" class="comments__delete-btn">Eliminar</a>
|
|
|
|
<?php endif ?>
|
|
|
|
</div>
|
|
|
|
</artcile>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</section>
|
2021-11-09 01:09:14 +01:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
2021-09-21 05:13:35 +02:00
|
|
|
<?php require_once 'views/components/footer.php' ?>
|
2022-03-11 01:02:21 +01:00
|
|
|
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.4.0/highlight.min.js" defer></script>
|
2022-03-10 23:10:14 +01:00
|
|
|
<script src="/assets/scripts/article/article.js" defer></script>
|