Merge branch 'dev'

This commit is contained in:
Ricardo García Jiménez 2021-09-22 21:44:54 -05:00
commit 0b0e602e26
3 changed files with 44 additions and 24 deletions

View file

@ -10,5 +10,27 @@
<h1>Artículos envíados</h1>
<?php require_once 'views/components/messages.php' ?>
<?php require_once 'views/components/table-articles.php' ?>
<?php if (!empty($articles)): ?>
<table>
<tr>
<th>Título</th>
<th>Autor</th>
<th></th>
<th></th>
<th></th>
</tr>
<?php foreach ($articles as $article): ?>
<?php $author = $article['author'] ?>
<tr>
<td><?= $article['title'] ?></td>
<td><a href="<?= NABU_ROUTES['profile'] . '&user=' . urlencode($author) ?>" target="_blank"><?= utils::escape($author) ?></a></td>
<td><a href="<?= NABU_ROUTES['authorize-article'] . '&slug=' . $article['slug'] ?>">Publicar</a></td>
<td><a href="<?= NABU_ROUTES['edit-article'] . '&slug=' . $article['slug'] ?>">Editar</a></td>
<td><a href="<?= NABU_ROUTES['delete-article'] . '&slug=' . $article['slug'] ?>">Eliminar</a></td>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>
<?php require_once 'views/components/footer.php' ?>

View file

@ -21,6 +21,26 @@
</span>
</form>
<?php require_once 'views/components/table-articles.php' ?>
<?php if (!empty($articles)): ?>
<table>
<tr>
<td>Título</td>
<td>Autor</td>
<td></td>
<td></td>
</tr>
<?php foreach ($articles as $article): ?>
<?php $author = $article['author'] ?>
<tr>
<td><?= $article['title'] ?></td>
<td><a href="<?= NABU_ROUTES['profile'] . '&user=' . urlencode($author) ?>" target="_blank"><?= utils::escape($author) ?></a></td>
<td><a href="<?= NABU_ROUTES['edit-article'] . '&slug=' . $article['slug'] ?>">Editar</a></td>
<td><a href="<?= NABU_ROUTES['delete-article'] . '&slug=' . $article['slug'] ?>">Eliminar</a></td>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>
<?php require_once 'views/components/pagination.php' ?>
<?php require_once 'views/components/footer.php' ?>
<?php defined('NABU') || exit ?>

View file

@ -1,22 +0,0 @@
<?php defined('NABU') || exit ?>
<?php if (!empty($articles)): ?>
<table>
<tr>
<td>Título</td>
<td>Autor</td>
<td></td>
<td></td>
<td></td>
</tr>
<?php foreach ($articles as $article): ?>
<?php $author = $article['author'] ?>
<tr>
<td><?= $article['title'] ?></td>
<td><a href="<?= NABU_ROUTES['profile'] . '&user=' . urlencode($author) ?>" target="_blank"><?= utils::escape($author) ?></a></td>
<td><a href="<?= NABU_ROUTES['delete-article'] . '&slug=' . $article['slug'] ?>">Eliminar</a></td>
<td><a href="<?= NABU_ROUTES['authorize-article'] . '&slug=' . $article['slug'] ?>">Publicar</a></td>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>