fix: correction de l'affichage des articles

This commit is contained in:
Kazhnuz 2020-12-30 22:42:54 +01:00
parent 013440fe2e
commit e06c12268c
5 changed files with 98 additions and 108 deletions

View file

@ -22,22 +22,18 @@ $oddcomment = 'alt';
<section class="comment-list"> <section class="comment-list">
<?php if ($comments) : ?> <?php if ($comments) : ?>
<h1 class="page-title" id="comments"><i class="fa fa-fw fa-comments"></i> <?php comments_number('Pas de commentaire', 'Un commentaire', '% commentaires' );?></h1> <h1 class="page-title" id="comments"><?php comments_number('Pas de commentaire', 'Un commentaire', '% commentaires' );?></h1>
<?php foreach ($comments as $comment) : ?> <?php foreach ($comments as $comment) : ?>
<article class="card card-comment <?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>"> <article class="card comment">
<aside class="media card-meta"> <div class="author-area">
<div class="media-left"> <? echo get_avatar( get_the_author_meta('user_email'), $size = '50'); ?></div> <? echo get_avatar( get_the_author_meta('user_email'), $size = '120'); ?>
<div class="media-body"><author class="media-heading">Post&eacute; par <?php comment_author_link() ?></author><time> Le <?php comment_date('j F, Y') ?> <?php _e('&agrave;');?> <?php comment_time() ?> </time></div> <div class="author-metadata">
</aside> <div class="author-pseudo">Écrit par <a href="" >Pseudo</a></div>
<?php if ($comment->comment_approved == '0') : ?> <small class="author-date">Le vendredi 19 septembre 2014 à 07:16</small>
<div class="alert alert-warning"><?php _e('Votre commentaire est en cours de mod&eacute;ration'); ?></div> </div>
<?php endif; ?> </div>
<div class="card-body">
<div class="comment-body">
<?php comment_text() ?> <?php comment_text() ?>
<p class="mb-0 align-right"><?php edit_comment_link('<i class="fa fa-fw fa-pencil"></i>','',''); ?></p>
</div> </div>
</article> </article>
@ -55,72 +51,60 @@ $oddcomment = 'alt';
<?php else : // comments are closed ?> <?php else : // comments are closed ?>
<!-- If comments are closed. --> <!-- If comments are closed. -->
<p class="nocomments alert alert-danger">Les commentaires sont fermŽs !</p> <p class="nocomments toast toast-danger">Les commentaires sont fermŽs !</p>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
<?php if ('open' == $post->comment_status) : ?> <?php if ('open' == $post->comment_status) : ?>
<div class="card card-primary">
<h2 id="respond" class="card-header">Laissez un commentaire</h2>
<h1 id="respond" class="page-title"><i class="fa fa-fw fa-plus"></i> Laissez un commentaire</h1> <!-- Cas du besoin de s'enregistrer -->
<?php if ( get_option('comment_registration') && !$user_ID ) : ?> <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">connect&eacute;</a> pour laisser un commentaire.</p> <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">connect&eacute;</a> pour laisser un commentaire.</p>
<!-- Utilisateur enregistré -->
<?php else : ?> <?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?> <?php if ( $user_ID ) : ?>
<div class="alert alert-info alert-flex" role="alert"> <div class="toast toast-info alert-flex" role="alert">
<p class="mb-0"><i class="fa fa-info fa-fw" ></i> Connect&eacute; en tant que <a class="alert-link" href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>.</p> <p class="mb-0"><i class="fa fa-info fa-fw" ></i> Connect&eacute; en tant que <a class="alert-link" href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>.</p>
<p class="mb-0 align-right"><a class="alert-link" href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="D&eacute;connect&eacute; de ce compte"><i class="fa fa-fw fa-power-off"></i></a></p> <p class="mb-0 align-right"><a class="alert-link" href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="D&eacute;connect&eacute; de ce compte"><i class="fa fa-fw fa-power-off"></i></a></p>
</div> </div>
<!-- Commentaire non-enregistré -->
<?php else : ?> <?php else : ?>
<div class="toast toast-info"><p>Ce site utilise Akismet pour réduire les contenus indésirables (spam, etc). <a href="https://akismet.com/privacy/">En savoir plus sur la façon dont les données de vos commentaires sont traitées.</a></p></div>
<div class="input-group mb-3"> <div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="fa fa-fw fa-user"></i></span>
</div>
<input type="text" class="form-control" name="author" id="author" placeholder="Nom <?php if ($req) echo "(requis)"; ?>" aria-label="Username" value="<?php echo $comment_author; ?>" size="40" tabindex="1" /> <input type="text" class="form-control" name="author" id="author" placeholder="Nom <?php if ($req) echo "(requis)"; ?>" aria-label="Username" value="<?php echo $comment_author; ?>" size="40" tabindex="1" />
</div> </div>
<div class="input-group mb-3"> <div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="fa fa-fw fa-envelope"></i></span>
</div>
<input type="text" class="form-control" name="email" id="email" placeholder="Courriel (ne sera pas publi&eacute;) <?php if ($req) echo "(requis)"; ?>" value="<?php echo $comment_author_email; ?>" size="40" tabindex="2" /> <input type="text" class="form-control" name="email" id="email" placeholder="Courriel (ne sera pas publi&eacute;) <?php if ($req) echo "(requis)"; ?>" value="<?php echo $comment_author_email; ?>" size="40" tabindex="2" />
</div> </div>
<div class="input-group mb-3"> <div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="fa fa-fw fa-globe"></i></span>
</div>
<input type="text" class="form-control" name="url" id="url" placeholder="Site Web" value="<?php echo $comment_author_url; ?>" size="40" tabindex="2" /> <input type="text" class="form-control" name="url" id="url" placeholder="Site Web" value="<?php echo $comment_author_url; ?>" size="40" tabindex="2" />
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="input-group mb-3"> <div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-comment"></i></span>
</div>
<textarea class="form-control" name="comment" id="comment" aria-label="Contenu du commentaire" placeholder="Contenu du commentaire" tabindex="4"></textarea> <textarea class="form-control" name="comment" id="comment" aria-label="Contenu du commentaire" placeholder="Contenu du commentaire" tabindex="4"></textarea>
</div> </div>
<p class="comment-info">Ce site utilise Akismet pour réduire les contenus indésirables (spam, etc). <a href="https://akismet.com/privacy/">En savoir plus sur la façon dont les données de vos commentaires sont traitées.</a></p>
<p class="align-right"><input name="submit" class="btn btn-primary" type="submit" id="submit" tabindex="5" value="Envoyer" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</p>
<?php do_action('comment_form', $post->ID); ?> <?php do_action('comment_form', $post->ID); ?>
<p class="align-right"><button name="submit" class="btn btn-primary" type="submit" id="submit" tabindex="5" value="Envoyer" >Envoyer</button>
</p>
</form> </form>
</div>
<?php endif; // If registration required and not logged in ?> <?php endif; // If registration required and not logged in ?>

View file

@ -95,3 +95,15 @@ a.article-nav-link-wrap {
.card-select { .card-select {
width:100%; width:100%;
} }
.input-group {
padding-bottom:1.5rem;
input, textarea {
width:100%;
background-color:$color-light;
border-radius:0px;
border: 1px solid rgba(0,0,0,0.2);
padding:0.375rem;
}
}

View file

@ -190,7 +190,7 @@ $preview-height: 8*$lineheight;
.author-area { .author-area {
display:flex; display:flex;
img.author-avatar { img.author-avatar, img.avatar {
display:block; display:block;
height: 4.5rem; height: 4.5rem;
width:auto; width:auto;

View file

@ -2,42 +2,27 @@
<main class="col-md-8"> <main class="col-md-8">
<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?> <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
<article class="article-content" id="post-<?php the_ID(); ?>"> <article class="article" id="post-<?php the_ID(); ?>">
<h1 class="page-title"><i class="fa fa-fw fa-file-text"></i> <?php the_title(); ?></h1> <h1 class="page-title"><?php the_title(); ?></h1>
<aside class="article-metadata"> <div class="article-entry">
<div class="article-thumbnail" ><?php the_post_thumbnail(); ?></div>
<aside class="card card-darker article-author bypass-flex-fontsize">
<div class="media card-meta">
<div class="media-left"> <? echo get_avatar( get_the_author_meta('user_email'), $size = '50'); ?></div>
<div class="media-body"><author class="media-heading">Écrit par <?php the_author() ?></author><time> Le <?php the_time('l j F Y à H:i') ?> </time></div>
</div>
</aside>
<div class="article-excerpt"><?php the_excerpt(); ?></div>
<section class="article-taxonomies">
<div class="article-categories article-taxonomies-container">
<?php $categories = get_the_category();
foreach( $categories as $category ) {
echo "<a href= '" . esc_url( get_category_link( $category->term_id ) ) . "' class='badge badge-category'>" . $category->cat_name . "</a>";
} ?>
</div>
<div class="article-tags article-taxonomies-container">
<?php $tags = get_the_tags();
if ($tags) {
foreach( $tags as $tag ) {
echo "<a href= '" . esc_url( get_tag_link( $tag->term_id ) ) . "' class='badge badge-tag'>" . $tag->name . "</a>";
}
} ?>
</div>
</section>
<hr />
</aside>
<div class="article-body">
<?php the_content(); ?> <?php the_content(); ?>
</div> </div>
<section class="card card-noheader">
<div class="author-area">
<? echo get_avatar( get_the_author_meta('user_email'), $size = '120'); ?>
<div class="author-metadata">
<div class="author-pseudo">Écrit par <a href="https://kazhnuz.space"><?php the_author() ?></a></div>
<small class="author-date">Le <?php the_time('l j F Y à H:i') ?></small>
</div>
</div>
<?php $categories = get_the_category();
foreach( $categories as $category ) {
echo "<a href= '" . esc_url( get_category_link( $category->term_id ) ) . "' class=''>" . $category->cat_name . "</a>";
} ?>
</section>
</article> </article>
<?php comments_template(); ?> <?php comments_template(); ?>

View file

@ -2038,7 +2038,7 @@ ul.breadcrumb, ol.breadcrumb, .breadcrumb {
.author-area { .author-area {
display: flex; } display: flex; }
.author-area img.author-avatar { .author-area img.author-avatar, .author-area img.avatar {
display: block; display: block;
height: 4.5rem; height: 4.5rem;
width: auto; width: auto;
@ -2413,3 +2413,12 @@ a.article-nav-link-wrap {
.card-select { .card-select {
width: 100%; } width: 100%; }
.input-group {
padding-bottom: 1.5rem; }
.input-group input, .input-group textarea {
width: 100%;
background-color: #fdf6e3;
border-radius: 0px;
border: 1px solid rgba(0, 0, 0, 0.2);
padding: 0.375rem; }