添加模板评论样式

This commit is contained in:
fen 2013-10-22 21:13:58 +08:00
parent 1fe96bb708
commit af95cff4ba
10 changed files with 222 additions and 107 deletions

View File

@ -42,7 +42,7 @@ Typecho_Cookie::delete('__typecho_remember_mail');
<h1>Typecho</h2>
<form action="<?php $options->registerAction(); ?>" method="post" name="register">
<p><input type="text" id="name" name="name" placeholder="<?php _e('用户名'); ?>" value="<?php echo $rememberName; ?>" class="text-l w-100" /></p>
<p><input type="email" id="mail" name="mail" placeholder="<?php _e('电子邮件'); ?>" value="<?php echo $rememberMail; ?>" class="text-l w-100" /></p>
<p><input type="email" id="mail" name="mail" placeholder="<?php _e('Email'); ?>" value="<?php echo $rememberMail; ?>" class="text-l w-100" /></p>
<p class="submit">
<!-- <label for="remember"><input type="checkbox" name="remember" class="checkbox" value="1" id="remember" /> <?php _e('记住我'); ?></label> -->
<button type="submit" class="btn-l w-100 primary"><?php _e('注册'); ?></button>

View File

@ -6,9 +6,10 @@
<article class="post">
<h2 class="post-title"><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
<div class="post-meta">
<span><?php _e('作者:'); ?><?php $this->author(); ?></span>
<span><?php _e('时间:'); ?><?php $this->date('F j, Y'); ?></span>
<?php _e('分类:'); ?><?php $this->category(','); ?>
<?php _e('作者:'); ?><a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a> <i></i>
<?php _e('时间:'); ?><?php $this->date('F j, Y'); ?> <i></i>
<?php _e('分类:'); ?><?php $this->category(','); ?> <i></i>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?></a>
</div>
<div class="post-content">
<?php $this->content('阅读剩余部分...'); ?>

View File

@ -0,0 +1,30 @@
<?php $this->need('header.php'); ?>
<div class="col-mb-12 col-8" id="main">
<?php _e('%s 发布的文章', $this->author()); ?>
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<article class="post">
<h2 class="post-title"><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
<div class="post-meta">
<?php _e('作者:'); ?><a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a> <i></i>
<?php _e('时间:'); ?><?php $this->date('F j, Y'); ?> <i></i>
<?php _e('分类:'); ?><?php $this->category(','); ?>
</div>
<div class="post-content">
<?php $this->content('阅读剩余部分...'); ?>
</div>
</article>
<?php endwhile; ?>
<?php else: ?>
<article class="post">
<h2 class="post-title"><?php _e('没有找到内容'); ?></h2>
</article>
<?php endif; ?>
<?php $this->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?>
</div><!-- end #main -->
<?php $this->need('sidebar.php'); ?>
<?php $this->need('footer.php'); ?>

View File

@ -0,0 +1,29 @@
<?php $this->need('header.php'); ?>
<div class="col-mb-12 col-8" id="main">
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<article class="post">
<h2 class="post-title"><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
<div class="post-meta">
<?php _e('作者:'); ?><a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a> <i></i>
<?php _e('时间:'); ?><?php $this->date('F j, Y'); ?> <i></i>
<?php _e('分类:'); ?><?php $this->category(','); ?> <i></i>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?></a>
</div>
<div class="post-content">
<?php $this->content('阅读剩余部分...'); ?>
</div>
</article>
<?php endwhile; ?>
<?php else: ?>
<article class="post">
<h2 class="post-title"><?php _e('没有找到内容'); ?></h2>
</article>
<?php endif; ?>
<?php $this->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?>
</div><!-- end #main -->
<?php $this->need('sidebar.php'); ?>
<?php $this->need('footer.php'); ?>

View File

@ -3,42 +3,46 @@
<?php if ($comments->have()): ?>
<h3><?php $this->commentsNum(_t('暂无评论'), _t('仅有 1 条评论'), _t('已有 %d 条评论')); ?></h3>
<?php $comments->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?>
<?php $comments->listComments(); ?>
<?php $comments->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?>
<?php endif; ?>
<?php if($this->allow('comment')): ?>
<div id="<?php $this->respondId(); ?>" class="respond">
<div class="cancel-comment-reply">
<?php $comments->cancelReply(); ?>
</div>
<div class="cancel-comment-reply">
<?php $comments->cancelReply(); ?>
</div>
<h3 id="response"><?php _e('添加新评论'); ?></h3>
<form method="post" action="<?php $this->commentUrl() ?>" id="comment-form">
<?php if($this->user->hasLogin()): ?>
<p><?php _e('登录身份:'); ?><a href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a>. <a href="<?php $this->options->logoutUrl(); ?>" title="Logout"><?php _e('退出'); ?> &raquo;</a></p>
<?php else: ?>
<p>
<label for="author"><?php _e('称呼'); ?><span class="required">*</span></label>
<input type="text" name="author" id="author" class="text" size="15" value="<?php $this->remember('author'); ?>" />
</p>
<p>
<label for="mail"><?php _e('电子邮件'); ?><?php if ($this->options->commentsRequireMail): ?><span class="required">*</span><?php endif; ?></label>
<input type="email" name="mail" id="mail" class="text" size="15" value="<?php $this->remember('mail'); ?>" />
</p>
<p>
<label for="url"><?php _e('网站'); ?><?php if ($this->options->commentsRequireURL): ?><span class="required">*</span><?php endif; ?></label>
<input type="url" name="url" id="url" class="text" size="15" value="<?php $this->remember('url'); ?>" />
</p>
<?php endif; ?>
<p><textarea rows="8" cols="50" name="text" class="textarea"><?php $this->remember('text'); ?></textarea></p>
<p><button type="submit" class="submit"><?php _e('提交评论'); ?></button></p>
</form>
<h3 id="response"><?php _e('添加新评论'); ?></h3>
<form method="post" action="<?php $this->commentUrl() ?>" id="comment-form">
<?php if($this->user->hasLogin()): ?>
<p><?php _e('登录身份:'); ?><a href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a>. <a href="<?php $this->options->logoutUrl(); ?>" title="Logout"><?php _e('退出'); ?> &raquo;</a></p>
<?php else: ?>
<p>
<label for="author" class="required"><?php _e('称呼'); ?></label>
<input type="text" name="author" id="author" class="text" value="<?php $this->remember('author'); ?>" />
</p>
<p>
<label for="mail"<?php if ($this->options->commentsRequireMail): ?> class="required"<?php endif; ?>><?php _e('Email'); ?></label>
<input type="email" name="mail" id="mail" class="text" value="<?php $this->remember('mail'); ?>" />
</p>
<p>
<label for="url"<?php if ($this->options->commentsRequireURL): ?> class="required"<?php endif; ?>><?php _e('网站'); ?></label>
<input type="url" name="url" id="url" class="text" placeholder="<?php _e('http://example.com'); ?>" value="<?php $this->remember('url'); ?>" />
</p>
<?php endif; ?>
<p>
<label for="textarea" class="required"><?php _e('内容'); ?></label>
<textarea rows="8" cols="50" name="text" class="textarea"><?php $this->remember('text'); ?></textarea>
</p>
<p>
<button type="submit" class="submit"><?php _e('提交评论'); ?></button>
</p>
</form>
</div>
<?php else: ?>
<h4><?php _e('评论已关闭'); ?></h4>
<h3><?php _e('评论已关闭'); ?></h3>
<?php endif; ?>
</div>

View File

@ -16,10 +16,10 @@
<article class="post">
<h2 class="post-title"><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
<div class="post-meta">
<span><?php _e('作者:'); ?><?php $this->author(); ?></span>
<span><?php _e('时间:'); ?><?php $this->date('F j, Y'); ?></span>
<span><?php _e('分类:'); ?><?php $this->category(','); ?></span>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('添加评论', '1 条评论', '%d 条评论'); ?></a>
<?php _e('作者:'); ?><a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a> <i></i>
<?php _e('时间:'); ?><?php $this->date('F j, Y'); ?> <i></i>
<?php _e('分类:'); ?><?php $this->category(','); ?> <i></i>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?></a>
</div>
<div class="post-content">
<?php $this->content('阅读剩余部分...'); ?>

View File

@ -4,8 +4,8 @@
<article class="post">
<h1 class="post-title"><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h1>
<div class="post-meta">
<span><?php _e('作者:'); ?><?php $this->author(); ?></span>
<span><?php _e('时间:'); ?><?php $this->date('F j, Y'); ?></span>
<?php _e('作者:'); ?><?php $this->author(); ?> <i></i>
<?php _e('时间:'); ?><?php $this->date('F j, Y'); ?> <i></i>
<?php _e('分类:'); ?><?php $this->category(','); ?>
</div>
<div class="post-content">

View File

@ -0,0 +1,30 @@
<?php $this->need('header.php'); ?>
<div class="col-mb-12 col-8" id="main">
<?php _e('%s 相关的搜索结果', $this->keywords()); ?>
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<article class="post">
<h2 class="post-title"><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
<div class="post-meta">
<?php _e('作者:'); ?><a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a> <i></i>
<?php _e('时间:'); ?><?php $this->date('F j, Y'); ?> <i></i>
<?php _e('分类:'); ?><?php $this->category(','); ?> <i></i>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?></a>
</div>
<div class="post-content">
<?php $this->content('阅读剩余部分...'); ?>
</div>
</article>
<?php endwhile; ?>
<?php else: ?>
<article class="post">
<h2 class="post-title"><?php _e('没有找到内容'); ?></h2>
</article>
<?php endif; ?>
<?php $this->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?>
</div><!-- end #main -->
<?php $this->need('sidebar.php'); ?>
<?php $this->need('footer.php'); ?>

View File

@ -19,7 +19,7 @@ body {
}
.container {
margin: 50px auto 30px;
margin-bottom: 30px;
background-color: #FFF;
-webkit-box-sizing: border-box;
@ -36,10 +36,27 @@ a:hover {
text-decoration: underline;
}
pre, code {
padding: 2px 4px;
background: #F3F3F0;
font-family: Menlo, Monaco, Consolas, "Lucida Console", "Courier New", monospace;
font-size: .92857em;
}
pre {
padding: 8px;
overflow: auto;
max-height: 400px;
}
input[type="text"], input[type="email"], input[type="url"],
blockquote {
margin: 1em 1.5em;
padding-left: 1.5em;
border-left: 4px solid #E9E9E6;
color: #777;
}
input[type="text"],
input[type="email"],
input[type="url"],
textarea {
padding: 5px;
border: 1px solid #E3E3E0;
@ -127,9 +144,10 @@ textarea {
color: #999;
font-size: .92857em;
}
.post-meta span {
margin-right: 6px;
padding-right: 10px;
.post-meta i {
display: inline-block;
margin: 0 8px;
height: 12px;
border-right: 1px solid #E9E9E6;
}
.post-content {
@ -143,115 +161,105 @@ textarea {
.page-navigator {
list-style: none;
margin: 30px 0 0;
margin: 25px 0;
padding: 0;
text-align: center;
}
.page-navigator li {
display: inline;
margin: 0 10px;
display: inline-block;
margin: 0 8px;
}
.page-navigator a {
display: inline-block;
padding: 0 5px;
padding: 0 8px;
height: 24px;
line-height: 24px;
}
.page-navigator a:hover {
background: #F3F3F0;
text-decoration: none;
}
.page-navigator .current a {
color: #444;
background: #F3F3F0;
}
/* ------------------
* comment list
* --------------- */
#comments {
margin-top: 20px;
margin-top: 30px;
}
#comments h4 {
}
ol.comment-list, ol.comment-list ol {
margin: 0;
.comment-list, .comment-list ol {
list-style: none;
}
ol.comment-list ol {
padding-top: 10px;
}
ol.comment-list li {
margin: 0;
padding-bottom: 10px;
padding: 0;
}
ol.comment-list li {
padding: 10px 15px;
.comment-list li {
padding: 14px;
margin-top: 10px;
border: 1px solid #eee;
background: #FAFAFA;
overflow: hidden;
border: 1px solid #E9E9E6;
}
ol.comment-list li.comment-level-odd {
background: #fff;
.comment-list li.comment-level-odd {
background: #F6F6F3;
}
ol.comment-list li.comment-level-even {
background: #FAFAFA;
.comment-list li.comment-level-even {
background: #FFF;
}
ol.comment-list li.comment-by-author {
border: 1px dashed #AAA;
.comment-list li.comment-by-author {
background: #FFF9E8;
}
ol.comment-list li .comment-reply {
.comment-list li .comment-reply {
text-align: right;
font-size: .92857em;
}
ol.comment-list li .comment-reply a {
border: none;
color: #aaa;
.comment-list li .comment-reply a {
}
ol.comment-list li .comment-reply a:hover {
color: #444;
.comment-list li .comment-reply a:hover {
}
.comment-meta {
padding-bottom: 8px;
/*border-bottom: 1px dashed #eee;
*/
color: #999;
.comment-meta a {
color: #999;
font-size: .92857em;
}
.comment-author {
display: block;
margin-bottom: 4px;
color: #444;
}
.comment-author cite.fn {
}
.comment-body {
overflow: hidden;
}
img.avatar {
.comment-author .avatar {
float: left;
margin: 6px 10px 0 0;
margin-right: 10px;
}
.respond {
margin-top: 20px;
.comment-author cite {
font-weight: bold;
font-style: normal;
}
ol.comment-list li .respond {
border-top: 1px solid #ddd;
padding-top: 10px;
.comment-content img {
max-width: 100%;
}
#comment-form {
.comment-children li {
}
.comment-list .respond {
margin-top: 15px;
border-top: 1px solid #E9E9E6;
}
.respond .cancel-comment-reply {
float: right;
margin-top: 15px;
font-size: .92857em;
}
.respond .cancel-comment-reply a {
border: none;
color: #aaa;
}
.respond .cancel-comment-reply a:hover {
color: #444;
#comment-form {
}
#comment-form label {
color: #555;
display: block;
margin-bottom: .5em;
font-weight: bold;
}
#comment-form label .required {
color: #C04E37;
padding-left: 5px;
#comment-form .required:after {
content: " *";
color: #C00;
}
/* ------------------
@ -291,6 +299,13 @@ ol.comment-list li .respond {
#footer a {
}
/* -----------------
* Content format
*--------------- */
.post-content, .comment-content {
line-height: 1.5;
}
/* -----------------
* misc
*--------------- */
@ -318,6 +333,7 @@ img.alignright {
@media (min-width: 768px) {
.container {
margin-top: 50px;
padding: 60px;
}
}
@ -328,6 +344,9 @@ img.alignright {
}
@media (min-width: 1200px) {
body {
font-size: 100%;
}
.container {
}
}
}

View File

@ -119,15 +119,17 @@ class Widget_Comments_Archive extends Widget_Abstract_Comments
<em class="comment-awaiting-moderation"><?php $singleCommentOptions->commentStatus(); ?></em>
<?php } ?>
</div>
<div class="comment-content">
<?php $this->content(); ?>
</div>
<div class="comment-reply">
<?php $this->reply($singleCommentOptions->replyWord); ?>
</div>
<?php if ($this->children) { ?>
<div class="comment-children">
<?php $this->threadedComments($singleCommentOptions); ?>
</div>
<?php } ?>
<div class="comment-reply">
<?php $this->reply($singleCommentOptions->replyWord); ?>
</div>
</li>
<?php
}