From af95cff4ba8afd63261d2f6792134f0fa33b3bb8 Mon Sep 17 00:00:00 2001 From: fen <fen1211@gmail.com> Date: Tue, 22 Oct 2013 21:13:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A8=A1=E6=9D=BF=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/register.php | 2 +- usr/themes/replica/archive.php | 7 +- usr/themes/replica/author.php | 30 +++++++ usr/themes/replica/category.php | 29 ++++++ usr/themes/replica/comments.php | 60 +++++++------ usr/themes/replica/index.php | 8 +- usr/themes/replica/post.php | 4 +- usr/themes/replica/search.php | 30 +++++++ usr/themes/replica/style.css | 151 ++++++++++++++++++-------------- var/Widget/Comments/Archive.php | 8 +- 10 files changed, 222 insertions(+), 107 deletions(-) create mode 100644 usr/themes/replica/author.php create mode 100644 usr/themes/replica/category.php create mode 100644 usr/themes/replica/search.php diff --git a/admin/register.php b/admin/register.php index 4813a577..b54d55c8 100644 --- a/admin/register.php +++ b/admin/register.php @@ -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> diff --git a/usr/themes/replica/archive.php b/usr/themes/replica/archive.php index e9764d3b..9b98fe41 100644 --- a/usr/themes/replica/archive.php +++ b/usr/themes/replica/archive.php @@ -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('阅读剩余部分...'); ?> diff --git a/usr/themes/replica/author.php b/usr/themes/replica/author.php new file mode 100644 index 00000000..5737528b --- /dev/null +++ b/usr/themes/replica/author.php @@ -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('« 前一页', '后一页 »'); ?> + </div><!-- end #main --> + + <?php $this->need('sidebar.php'); ?> + <?php $this->need('footer.php'); ?> diff --git a/usr/themes/replica/category.php b/usr/themes/replica/category.php new file mode 100644 index 00000000..9b98fe41 --- /dev/null +++ b/usr/themes/replica/category.php @@ -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('« 前一页', '后一页 »'); ?> + </div><!-- end #main --> + + <?php $this->need('sidebar.php'); ?> + <?php $this->need('footer.php'); ?> diff --git a/usr/themes/replica/comments.php b/usr/themes/replica/comments.php index 8127af7d..8252e326 100644 --- a/usr/themes/replica/comments.php +++ b/usr/themes/replica/comments.php @@ -3,42 +3,46 @@ <?php if ($comments->have()): ?> <h3><?php $this->commentsNum(_t('暂无评论'), _t('仅有 1 条评论'), _t('已有 %d 条评论')); ?></h3> - <?php $comments->pageNav('« 前一页', '后一页 »'); ?> - <?php $comments->listComments(); ?> + + <?php $comments->pageNav('« 前一页', '后一页 »'); ?> <?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('退出'); ?> »</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('退出'); ?> »</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> diff --git a/usr/themes/replica/index.php b/usr/themes/replica/index.php index b691ff72..8e03b904 100644 --- a/usr/themes/replica/index.php +++ b/usr/themes/replica/index.php @@ -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('阅读剩余部分...'); ?> diff --git a/usr/themes/replica/post.php b/usr/themes/replica/post.php index ca4a8ab2..9561f6e3 100644 --- a/usr/themes/replica/post.php +++ b/usr/themes/replica/post.php @@ -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"> diff --git a/usr/themes/replica/search.php b/usr/themes/replica/search.php new file mode 100644 index 00000000..25295a3c --- /dev/null +++ b/usr/themes/replica/search.php @@ -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('« 前一页', '后一页 »'); ?> + </div><!-- end #main --> + + <?php $this->need('sidebar.php'); ?> + <?php $this->need('footer.php'); ?> diff --git a/usr/themes/replica/style.css b/usr/themes/replica/style.css index dde527d2..bf88673d 100644 --- a/usr/themes/replica/style.css +++ b/usr/themes/replica/style.css @@ -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 { } -} \ No newline at end of file +} diff --git a/var/Widget/Comments/Archive.php b/var/Widget/Comments/Archive.php index c8a06aeb..fda0082a 100644 --- a/var/Widget/Comments/Archive.php +++ b/var/Widget/Comments/Archive.php @@ -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 }