Agrega maquetado simple de la página de categoría y edición de perfil, define el tamaño de las imágenes a 2MB

This commit is contained in:
Ricardo García Jiménez 2021-09-22 17:16:50 -05:00
parent 85777de59f
commit 8efc868e6c
8 changed files with 93 additions and 13 deletions

View file

@ -26,7 +26,7 @@ define('NABU_DEFAULT', array(
'background' => NABU_URL . '/assets/images/background.jpg',
'cover' => NABU_URL . '/assets/images/cover.jpg',
'image-formats' => 'image/gif, image/jpeg, image/png, image/svg+xml',
'image-size' => 1048576 * 3, // 3 MB (en bytes).
'image-size' => 1048576 * 2, // 2 MB (en bytes).
));
// Define la zona horario de todas las funciones de fecha/tiempo.

View file

@ -43,7 +43,7 @@
<label for="content"><b>Contenido del artículo <a href="https://www.markdownguide.org/basic-syntax/" target="_blank">formato Markdown</a></b></label>
</div>
<div>
<textarea type="text" id="content" name="content" minlength="1" maxlength="<?= NABU_DEFAULT['article_size'] ?>" rows="32" cols="100" required><?= $article['content'] ?></textarea>
<textarea type="text" id="content" name="content" minlength="1" maxlength="<?= NABU_DEFAULT['article-size'] ?>" rows="32" cols="100" required><?= $article['content'] ?></textarea>
</div>
<div>
<input type="submit" name="edit-article" value="Guardar">

View file

@ -9,7 +9,7 @@
<link rel="icon" href="<?= NABU_DIRECTORY['images'] ?>/buho.svg" type="image/svg+xml" sizes="any">
<link rel="stylesheet" href="<?= NABU_DIRECTORY['styles'] ?>/normalize.css">
<?php foreach ($styles as $style): ?>
<link rel="stylesheet" href="<?= $style ?>">
<link rel="stylesheet" href="<?= $style ?>">
<?php endforeach ?>
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">

View file

@ -25,9 +25,9 @@
<?php else: ?>
<?php $username = $_SESSION['user']['username'] ?>
<?php if (false): ?>
<li class="nav__item">
<a href="<?= NABU_ROUTES['admin'] ?>">Administración</a>
</li>
<li class="nav__item">
<a href="<?= NABU_ROUTES['admin'] ?>">Administración</a>
</li>
<?php endif ?>
<li class="nav__item">
<a href="<?= NABU_ROUTES['sent-articles'] ?>">Artículos enviados</a>

View file

@ -12,7 +12,7 @@
<div>
<p>Autor:</p>
<a href="<?= $author_profile ?>"><img src="<?= $article['author_avatar'] ?>" alt="Foto de perfil del autor" width="8%"></a>
<p><a href="<?= $author_profile ?>"><?= $article['author_username'] ?></a></p>
<p><a href="<?= $author_profile ?>"><?= $article['author-username'] ?></a></p>
<p><?= $article['date'] ?></p>
</div>
@ -23,9 +23,9 @@
<h2>Datos del autor</h2>
<div>
<a href="<?= $author_profile ?>"><img src="<?= $article['author_avatar'] ?>" alt="Foto de perfil del autor" width="8%"></a>
<a href="<?= $author_profile ?>"><img src="<?= $article['author-avatar'] ?>" alt="Foto de perfil del autor" width="8%"></a>
<p><a href="<?= $author_profile ?>"><?= $article['author'] ?></a></p>
<p><?= $article['author_description'] ?></p>
<p><?= $article['author-description'] ?></p>
</div>
<h2>Otros artículos</h2>

View file

@ -1,11 +1,16 @@
<?php defined('NABU') || exit ?>
<?php $head_title = 'Categorías' ?>
<?php $head_title = 'Categoría' ?>
<?php $styles = array(
NABU_DIRECTORY['styles'] . '/pages/category/category.css',
NABU_DIRECTORY['styles'] . '/pages/category/category-desktop.css',
NABU_DIRECTORY['styles'] . '/components/articles/articles.css',
) ?>
<?php require_once 'views/components/head.php' ?>
<?php require_once 'views/components/navbar.php' ?>
<h1>Categorías</h1>
<h1>Categoría</h1>
<?php require_once 'views/components/search.php' ?>
<?php require_once 'views/components/articles.php' ?>
<?php require_once 'views/components/pagination.php' ?>
<?php require_once 'views/components/footer.php' ?>

View file

@ -21,8 +21,8 @@
<input type="password" id="password" name="password" minleght="6" maxlenght="255" required>
</div>
<div>
<label for="password-confirm">Confirmar contraseña</label>
<input type="password" id="password-confirm" name="password-confirm" minlenght="6" maxlenght="255" required>
<label for="confirm-password">Confirmar contraseña</label>
<input type="password" id="confirm-password" name="confirm-password" minlenght="6" maxlenght="255" required>
</div>
<div>
<input type="submit" name="confirm-password-submit" value="Enviar">

View file

@ -0,0 +1,75 @@
<?php defined('NABU') || exit ?>
<?php $head_title = 'Editar perfil' ?>
<?php $styles = array(
NABU_DIRECTORY['styles'] . '/pages/edit-profile/edit-profile.css',
NABU_DIRECTORY['styles'] . '/pages/edit-profile/edit-profile-desktop.css',
) ?>
<?php require_once 'views/components/head.php' ?>
<h1>Editar perfil</h1>
<p><a href="<?= $back ?>">Volver</a></p>
<?php require_once 'views/components/messages.php' ?>
<form method="POST" action="<?= NABU_ROUTES['edit-profile'] ?>" enctype="multipart/form-data">
<fieldset>
<legend>Perfil</legend>
<input type="hidden" name="csrf" value="<?= $token ?>">
<div>
<div>
<label for="avatar"><b>Editar foto de perfil</b></label>
</div>
<div>
<img src="<?= $user['avatar'] ?>" alt="Foto de perfil" width="8%">
</div>
<div>
<input type="file" id="avatar" name="avatar" accept="<?= NABU_DEFAULT['image-formats'] ?>">
</div>
</div>
<div>
<div>
<label for="background"><b>Editar fondo de perfil</b></label>
</div>
<div>
<img src="<?= $user['background'] ?>" alt="Fondo de perfil" width="32%">
</div>
<div>
<input type="file" id="background" name="background" accept="<?= NABU_DEFAULT['image-formats'] ?>">
</div>
</div>
<div>
<div>
<label for="description"><b>Descripción</b></label>
</div>
<div>
<textarea id="description" name="description" maxlength="255" rows="5" cols="51"><?= $user['description'] ?></textarea>
</div>
</div>
</fieldset>
<fieldset>
<legend>Datos personales</legend>
<div>
<label for="name"><b>Nombre completo</b></label>
<input type="text" id="name" name="name" minlength="5" maxlength="255" value="<?= $user['name'] ?>">
</div>
<div>
<label for="username"><b>Apodo</b></label>
<input type="text" id="username" name="username" minlength="1" value="<?= $user['username'] ?>" maxlength="255">
</div>
<div>
<label for="password"><b>Nueva constraseña</b></label>
<input type="password" id="password" name="password" minlength="6" maxlength="255">
</div>
<div>
<label for="confirm-password"><b>Confirmar contraseña</b></label>
<input type="password" id="confirm-password" name="confirm-password" minlength="6" maxlength="255">
</div>
</fieldset>
<div>
<a href="<?= NABU_ROUTES['delete-profile'] ?>">Eliminar cuenta</a>
<input type="submit" name="edit-profile-submit" value="Guardar">
</div>
</form>
<?php require_once 'views/components/footer.php' ?>