Comment area design

This commit is contained in:
Skywt2003 2021-08-02 23:24:17 +08:00
parent a349572b59
commit 6289c79394
1 changed files with 26 additions and 15 deletions

View File

@ -3,16 +3,30 @@
<!-- 评论列表区域 --> <!-- 评论列表区域 -->
<?php $this->comments()->to($comments); ?> <?php #$this->comments()->to($comments); ?>
<?php #if ($comments->have()): ?>
<h2><?php #$this->commentsNum(_t('暂无评论'), _t('仅有一条评论'), _t('已有 %d 条评论')); ?></h2>
<?php #$comments->listComments(); ?>
<?php #$comments->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?>
<?php #endif; ?>
<?php $this->comments('comment')->to($comments); ?>
<?php if ($comments->have()): ?> <?php if ($comments->have()): ?>
<h3><?php $this->commentsNum(_t('暂无评论'), _t('仅有一条评论'), _t('已有 %d 条评论')); ?></h3> <hr>
<?php while ($comments->next()): ?>
<?php $comments->listComments(); ?> <div id="<?php $comments->theId() ?>">
<p>
<?php $comments->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?> <?php $comments->gravatar(32, '', '', 'avatar'); ?>
<span class="font-weight-900"><?php $comments->author() ?></span>
<span class="small"><?php $comments->date('F jS, Y'); ?> at <?php $comments->date('h:i a'); ?><span>
</p>
<p><?php $comments->content() ?></p>
</div>
<hr>
<?php endwhile; ?>
<?php endif; ?> <?php endif; ?>
<!-- 评论提交区域 --> <!-- 评论提交区域 -->
<?php if($this->allow('comment')): ?> <?php if($this->allow('comment')): ?>
@ -20,7 +34,6 @@
<div class="cancel-comment-reply"> <div class="cancel-comment-reply">
<?php $comments->cancelReply(); ?> <?php $comments->cancelReply(); ?>
</div> </div>
<h3 id="response"><?php _e('添加新评论'); ?></h3> <h3 id="response"><?php _e('添加新评论'); ?></h3>
<form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" role="form"> <form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" role="form">
<?php if($this->user->hasLogin()): ?> <?php if($this->user->hasLogin()): ?>
@ -28,17 +41,16 @@
<a href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a>; <a href="<?php $this->options->logoutUrl(); ?>" title="Logout"><?php _e('退出'); ?> &raquo;</a> <a href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a>; <a href="<?php $this->options->logoutUrl(); ?>" title="Logout"><?php _e('退出'); ?> &raquo;</a>
</p> </p>
<?php else: ?> <?php else: ?>
<div class="form-group"> <div class="form-group">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<input type="text" name="author" id="author" class="form-control form-control-alternative" placeholder="Name" value="<?php $this->remember('author'); ?>" required /> <input type="text" name="author" id="author" class="form-control" placeholder="Name" value="<?php $this->remember('author'); ?>" required />
</div> </div>
<div class="col"> <div class="col">
<input type="email" name="mail" id="mail" class="form-control form-control-alternative" placeholder="Email" value="<?php $this->remember('mail'); ?>"<?php if ($this->options->commentsRequireMail): ?> required<?php endif; ?> /> <input type="email" name="mail" id="mail" class="form-control" placeholder="Email" value="<?php $this->remember('mail'); ?>"<?php if ($this->options->commentsRequireMail): ?> required<?php endif; ?> />
</div> </div>
<div class="col"> <div class="col">
<input type="url" name="url" id="url" class="form-control form-control-alternative" placeholder="Website" value="<?php $this->remember('url'); ?>"<?php if ($this->options->commentsRequireURL): ?> required<?php endif; ?> /> <input type="url" name="url" id="url" class="form-control" placeholder="Website" value="<?php $this->remember('url'); ?>"<?php if ($this->options->commentsRequireURL): ?> required<?php endif; ?> />
</div> </div>
<!-- 太困难了!! --> <!-- 太困难了!! -->
<!--<div class="col custom-control custom-checkbox">--> <!--<div class="col custom-control custom-checkbox">-->
@ -47,7 +59,7 @@
<!--</div>--> <!--</div>-->
<div class="col"> <div class="col">
<label class="custom-toggle"> <label class="custom-toggle">
<input type="checkbox" name="receiveMail" id="receiveMail" value="yes" checked /> <input class="shadow" type="checkbox" name="receiveMail" id="receiveMail" value="yes" checked />
<span class="custom-toggle-slider rounded-circle"></span> <span class="custom-toggle-slider rounded-circle"></span>
</label> </label>
<label>接收邮件通知</label> <label>接收邮件通知</label>
@ -55,9 +67,8 @@
</div> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="form-group"> <div class="form-group">
<textarea rows="8" cols="50" name="text" id="textarea" class="form-control form-control-alternative" placeholder="Say something!" required ><?php $this->remember('text'); ?></textarea> <textarea rows="8" cols="50" name="text" id="textarea" class="form-control" placeholder="Say something!" required ><?php $this->remember('text'); ?></textarea>
</div> </div>
<button type="submit" class="btn btn-primary">Submit</button> <button type="submit" class="btn btn-primary">Submit</button>
</form> </form>