diff --git a/DjangoBlog/settings.py b/DjangoBlog/settings.py index 1149897..605df1d 100644 --- a/DjangoBlog/settings.py +++ b/DjangoBlog/settings.py @@ -35,6 +35,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'pagedown', 'blog', 'accounts', 'comments' @@ -85,7 +86,7 @@ DATABASES = { 'NAME': 'djangoblog', 'USER': 'root', 'PASSWORD': 'root', - 'HOST': '127.0.0.1', + 'HOST': '192.168.33.10', 'PORT': 3306, } } diff --git a/blog/admin.py b/blog/admin.py index 1420ea7..76ecff4 100644 --- a/blog/admin.py +++ b/blog/admin.py @@ -1,8 +1,24 @@ from django.contrib import admin # Register your models here. -from .models import Article,Category,Tag +from .models import Article, Category, Tag, Links +from pagedown.widgets import AdminPagedownWidget +from django import forms -admin.site.register(Article) + +class ArticleForm(forms.ModelForm): + body = forms.CharField(widget=AdminPagedownWidget()) + + class Meta: + model = Article + fields = '__all__' + + +class ArticlelAdmin(admin.ModelAdmin): + form = ArticleForm + + +admin.site.register(Article, ArticlelAdmin) admin.site.register(Category) admin.site.register(Tag) +admin.site.register(Links) diff --git a/blog/context_processors.py b/blog/context_processors.py index 4f1f030..34874f9 100644 --- a/blog/context_processors.py +++ b/blog/context_processors.py @@ -19,5 +19,6 @@ from django.conf import settings def seo_processor(requests): return { 'SITE_NAME': settings.SITE_NAME, - 'SITE_DESCRIPTION': settings.SITE_DESCRIPTION + 'SITE_DESCRIPTION': settings.SITE_DESCRIPTION, + 'SITE_BASE_URL':'http://'+ requests.get_host() + '/', } diff --git a/blog/models.py b/blog/models.py index 198e2d3..635d9bf 100644 --- a/blog/models.py +++ b/blog/models.py @@ -4,18 +4,23 @@ from django.conf import settings class Article(models.Model): + """文章""" STATUS_CHOICES = ( ('d', '草稿'), ('p', '发表'), ) - + COMMENT_STATUS = ( + ('o', '打开'), + ('c', '关闭'), + ) title = models.CharField('标题', max_length=200) body = models.TextField('正文') created_time = models.DateTimeField('创建时间', auto_now_add=True) last_mod_time = models.DateTimeField('修改时间', auto_now=True) pub_time = models.DateTimeField('发布时间', blank=True, null=True, help_text="不指定发布时间则视为草稿,可以指定未来时间,到时将自动发布。") - status = models.CharField('文章状态', max_length=1, choices=STATUS_CHOICES) + status = models.CharField('文章状态', max_length=1, choices=STATUS_CHOICES, default='o') + commentstatus = models.CharField('评论状态', max_length=1, choices=COMMENT_STATUS) summary = models.CharField('摘要', max_length=200, blank=True, help_text="可选,若为空将摘取正文的前300个字符。") views = models.PositiveIntegerField('浏览量', default=0) author = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name='作者', on_delete=models.CASCADE) @@ -55,6 +60,7 @@ class Article(models.Model): class Category(models.Model): + """文章分类""" name = models.CharField('分类名', max_length=30) created_time = models.DateTimeField('创建时间', auto_now_add=True) last_mod_time = models.DateTimeField('修改时间', auto_now=True) @@ -73,6 +79,7 @@ class Category(models.Model): class Tag(models.Model): + """文章标签""" name = models.CharField('标签名', max_length=30) created_time = models.DateTimeField('创建时间', auto_now_add=True) last_mod_time = models.DateTimeField('修改时间', auto_now=True) @@ -90,3 +97,20 @@ class Tag(models.Model): ordering = ['name'] verbose_name = "标签" verbose_name_plural = verbose_name + + +class Links(models.Model): + """友情链接""" + name = models.CharField('链接名称', max_length=30) + link = models.URLField('链接地址') + sequence = models.IntegerField('排序', unique=True) + created_time = models.DateTimeField('创建时间', auto_now_add=True) + last_mod_time = models.DateTimeField('修改时间', auto_now=True) + + class Meta: + ordering = ['sequence'] + verbose_name = '友情链接' + verbose_name_plural = verbose_name + + def __str__(self): + return self.name diff --git a/blog/static/blog/css/style.css b/blog/static/blog/css/style.css index b809f18..b5eddd5 100644 --- a/blog/static/blog/css/style.css +++ b/blog/static/blog/css/style.css @@ -1,109 +1,66 @@ -/* -Theme Name: Twenty Twelve -Theme URI: https://wordpress.org/themes/twentytwelve/ -Author: the WordPress team -Author URI: https://wordpress.org/ -Description: The 2012 theme for WordPress is a fully responsive theme that looks great on any device. Features include a front page template with its own widgets, an optional display font, styling for post formats on both index and single views, and an optional no-sidebar page template. Make it yours with a custom menu, header image, and background. -Version: 2.1 -License: GNU General Public License v2 or later -License URI: http://www.gnu.org/licenses/gpl-2.0.html -Tags: blog, one-column, two-columns, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready -Text Domain: twentytwelve - -This theme, like WordPress, is licensed under the GPL. -Use it to make something cool, have fun, and share what you've learned with others. -*/ - -/* =Notes --------------------------------------------------------------- -This stylesheet uses rem values with a pixel fallback. The rem -values (and line heights) are calculated using two variables: - -$rembase: 14; -$line-height: 24; - ----------- Examples - -* Use a pixel value with a rem fallback for font-size, padding, margins, etc. - padding: 5px 0; - padding: 0.357142857rem 0; (5 / $rembase) - -* Set a font-size and then set a line-height based on the font-size - font-size: 16px - font-size: 1.142857143rem; (16 / $rembase) - line-height: 1.5; ($line-height / 16) - ----------- Vertical spacing - -Vertical spacing between most elements should use 24px or 48px -to maintain vertical rhythm: - -.my-new-div { - margin: 24px 0; - margin: 1.714285714rem 0; ( 24 / $rembase ) -} - ----------- Further reading - -http://snook.ca/archives/html_and_css/font-size-with-rem -http://blog.typekit.com/2011/11/09/type-study-sizing-the-legible-letter/ - - -/* =Reset --------------------------------------------------------------- */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - vertical-align: baseline; + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + vertical-align: baseline; } + body { - line-height: 1; + line-height: 1; } + ol, ul { - list-style: none; + list-style: none; } + blockquote, q { - quotes: none; + quotes: none; } + blockquote:before, blockquote:after, q:before, q:after { - content: ''; - content: none; + content: ''; + content: none; } + table { - border-collapse: collapse; - border-spacing: 0; + border-collapse: collapse; + border-spacing: 0; } + caption, th, td { - font-weight: normal; - text-align: left; + font-weight: normal; + text-align: left; } + h1, h2, h3, h4, h5, h6 { - clear: both; + clear: both; } + html { - overflow-y: scroll; - font-size: 100%; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; + overflow-y: scroll; + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; } + a:focus { - outline: thin dotted; + outline: thin dotted; } + article, aside, details, @@ -114,68 +71,78 @@ header, hgroup, nav, section { - display: block; + display: block; } + audio, canvas, video { - display: inline-block; + display: inline-block; } + audio:not([controls]) { - display: none; + display: none; } + del { - color: #333; + color: #333; } + ins { - background: #fff9c0; - text-decoration: none; + background: #fff9c0; + text-decoration: none; } + hr { - background-color: #ccc; - border: 0; - height: 1px; - margin: 24px; - margin-bottom: 1.714285714rem; + background-color: #ccc; + border: 0; + height: 1px; + margin: 24px; + margin-bottom: 1.714285714rem; } + sub, sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; } + sup { - top: -0.5em; + top: -0.5em; } + sub { - bottom: -0.25em; + bottom: -0.25em; } + small { - font-size: smaller; + font-size: smaller; } + img { - border: 0; - -ms-interpolation-mode: bicubic; + border: 0; + -ms-interpolation-mode: bicubic; } /* Clearing floats */ .clear:after, .wrapper:after, .format-status .entry-header:after { - clear: both; + clear: both; } + .clear:before, .clear:after, .wrapper:before, .wrapper:after, .format-status .entry-header:before, .format-status .entry-header:after { - display: table; - content: ""; + display: table; + content: ""; } - /* =Repeatable patterns -------------------------------------------------------------- */ @@ -185,21 +152,21 @@ img { .widget-title, .entry-content th, .comment-content th { - font-size: 11px; - font-size: 0.785714286rem; - line-height: 2.181818182; - font-weight: bold; - text-transform: uppercase; - color: #636363; + font-size: 11px; + font-size: 0.785714286rem; + line-height: 2.181818182; + font-weight: bold; + text-transform: uppercase; + color: #636363; } /* Shared Post Format styling */ article.format-quote footer.entry-meta, article.format-link footer.entry-meta, article.format-status footer.entry-meta { - font-size: 11px; - font-size: 0.785714286rem; - line-height: 2.181818182; + font-size: 11px; + font-size: 0.785714286rem; + line-height: 2.181818182; } /* Form fields, general styles first */ @@ -207,20 +174,22 @@ button, input, select, textarea { - border: 1px solid #ccc; - border-radius: 3px; - font-family: inherit; - padding: 6px; - padding: 0.428571429rem; + border: 1px solid #ccc; + border-radius: 3px; + font-family: inherit; + padding: 6px; + padding: 0.428571429rem; } + button, input { - line-height: normal; + line-height: normal; } + textarea { - font-size: 100%; - overflow: auto; - vertical-align: top; + font-size: 100%; + overflow: auto; + vertical-align: top; } /* Reset non-text input types */ @@ -230,9 +199,9 @@ input[type="file"], input[type="hidden"], input[type="image"], input[type="color"] { - border: 0; - border-radius: 0; - padding: 0; + border: 0; + border-radius: 0; + padding: 0; } /* Buttons */ @@ -242,35 +211,38 @@ input[type="button"], input[type="reset"], article.post-password-required input[type=submit], .bypostauthor cite span { - padding: 6px 10px; - padding: 0.428571429rem 0.714285714rem; - font-size: 11px; - font-size: 0.785714286rem; - line-height: 1.428571429; - font-weight: normal; - color: #7c7c7c; - background-color: #e6e6e6; - background-repeat: repeat-x; - background-image: -moz-linear-gradient(top, #f4f4f4, #e6e6e6); - background-image: -ms-linear-gradient(top, #f4f4f4, #e6e6e6); - background-image: -webkit-linear-gradient(top, #f4f4f4, #e6e6e6); - background-image: -o-linear-gradient(top, #f4f4f4, #e6e6e6); - background-image: linear-gradient(top, #f4f4f4, #e6e6e6); - border: 1px solid #d2d2d2; - border-radius: 3px; - box-shadow: 0 1px 2px rgba(64, 64, 64, 0.1); + padding: 6px 10px; + padding: 0.428571429rem 0.714285714rem; + font-size: 11px; + font-size: 0.785714286rem; + line-height: 1.428571429; + font-weight: normal; + color: #7c7c7c; + background-color: #e6e6e6; + background-repeat: repeat-x; + background-image: -moz-linear-gradient(top, #f4f4f4, #e6e6e6); + background-image: -ms-linear-gradient(top, #f4f4f4, #e6e6e6); + background-image: -webkit-linear-gradient(top, #f4f4f4, #e6e6e6); + background-image: -o-linear-gradient(top, #f4f4f4, #e6e6e6); + background-image: linear-gradient(top, #f4f4f4, #e6e6e6); + border: 1px solid #d2d2d2; + border-radius: 3px; + box-shadow: 0 1px 2px rgba(64, 64, 64, 0.1); } + .menu-toggle, button, input[type="submit"], input[type="button"], input[type="reset"] { - cursor: pointer; + cursor: pointer; } + button[disabled], input[disabled] { - cursor: default; + cursor: default; } + .menu-toggle:hover, .menu-toggle:focus, button:hover, @@ -278,59 +250,63 @@ input[type="submit"]:hover, input[type="button"]:hover, input[type="reset"]:hover, article.post-password-required input[type=submit]:hover { - color: #5e5e5e; - background-color: #ebebeb; - background-repeat: repeat-x; - background-image: -moz-linear-gradient(top, #f9f9f9, #ebebeb); - background-image: -ms-linear-gradient(top, #f9f9f9, #ebebeb); - background-image: -webkit-linear-gradient(top, #f9f9f9, #ebebeb); - background-image: -o-linear-gradient(top, #f9f9f9, #ebebeb); - background-image: linear-gradient(top, #f9f9f9, #ebebeb); + color: #5e5e5e; + background-color: #ebebeb; + background-repeat: repeat-x; + background-image: -moz-linear-gradient(top, #f9f9f9, #ebebeb); + background-image: -ms-linear-gradient(top, #f9f9f9, #ebebeb); + background-image: -webkit-linear-gradient(top, #f9f9f9, #ebebeb); + background-image: -o-linear-gradient(top, #f9f9f9, #ebebeb); + background-image: linear-gradient(top, #f9f9f9, #ebebeb); } + .menu-toggle:active, .menu-toggle.toggled-on, button:active, input[type="submit"]:active, input[type="button"]:active, input[type="reset"]:active { - color: #757575; - background-color: #e1e1e1; - background-repeat: repeat-x; - background-image: -moz-linear-gradient(top, #ebebeb, #e1e1e1); - background-image: -ms-linear-gradient(top, #ebebeb, #e1e1e1); - background-image: -webkit-linear-gradient(top, #ebebeb, #e1e1e1); - background-image: -o-linear-gradient(top, #ebebeb, #e1e1e1); - background-image: linear-gradient(top, #ebebeb, #e1e1e1); - box-shadow: inset 0 0 8px 2px #c6c6c6, 0 1px 0 0 #f4f4f4; - border-color: transparent; + color: #757575; + background-color: #e1e1e1; + background-repeat: repeat-x; + background-image: -moz-linear-gradient(top, #ebebeb, #e1e1e1); + background-image: -ms-linear-gradient(top, #ebebeb, #e1e1e1); + background-image: -webkit-linear-gradient(top, #ebebeb, #e1e1e1); + background-image: -o-linear-gradient(top, #ebebeb, #e1e1e1); + background-image: linear-gradient(top, #ebebeb, #e1e1e1); + box-shadow: inset 0 0 8px 2px #c6c6c6, 0 1px 0 0 #f4f4f4; + border-color: transparent; } + .bypostauthor cite span { - color: #fff; - background-color: #21759b; - background-image: none; - border: 1px solid #1f6f93; - border-radius: 2px; - box-shadow: none; - padding: 0; + color: #fff; + background-color: #21759b; + background-image: none; + border: 1px solid #1f6f93; + border-radius: 2px; + box-shadow: none; + padding: 0; } /* Responsive images */ .entry-content img, .comment-content img, .widget img { - max-width: 100%; /* Fluid images for posts, comments, and widgets */ + max-width: 100%; /* Fluid images for posts, comments, and widgets */ } + img[class*="align"], img[class*="wp-image-"], img[class*="attachment-"] { - height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */ + height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */ } + img.size-full, img.size-large, img.header-image, img.wp-post-image { - max-width: 100%; - height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */ + max-width: 100%; + height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */ } /* Make sure videos and embeds fit their containers */ @@ -338,416 +314,478 @@ embed, iframe, object, video { - max-width: 100%; + max-width: 100%; } + .entry-content .twitter-tweet-rendered { - max-width: 100% !important; /* Override the Twitter embed fixed width */ + max-width: 100% !important; /* Override the Twitter embed fixed width */ } /* Images */ .alignleft { - float: left; + float: left; } + .alignright { - float: right; + float: right; } + .aligncenter { - display: block; - margin-left: auto; - margin-right: auto; + display: block; + margin-left: auto; + margin-right: auto; } + .entry-content img, .comment-content img, .widget img, img.header-image, .author-avatar img, img.wp-post-image { - /* Add fancy borders to all WordPress-added images but not things like badges and icons and the like */ - border-radius: 3px; - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); + /* Add fancy borders to all WordPress-added images but not things like badges and icons and the like */ + border-radius: 3px; + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); } + .wp-caption { - max-width: 100%; /* Keep wide captions from overflowing their container. */ - padding: 4px; + max-width: 100%; /* Keep wide captions from overflowing their container. */ + padding: 4px; } + .wp-caption .wp-caption-text, .gallery-caption, .entry-caption { - font-style: italic; - font-size: 12px; - font-size: 0.857142857rem; - line-height: 2; - color: #757575; + font-style: italic; + font-size: 12px; + font-size: 0.857142857rem; + line-height: 2; + color: #757575; } + img.wp-smiley, .rsswidget img { - border: 0; - border-radius: 0; - box-shadow: none; - margin-bottom: 0; - margin-top: 0; - padding: 0; + border: 0; + border-radius: 0; + box-shadow: none; + margin-bottom: 0; + margin-top: 0; + padding: 0; } + .entry-content dl.gallery-item { - margin: 0; + margin: 0; } + .gallery-item a, .gallery-caption { - width: 90%; + width: 90%; } + .gallery-item a { - display: block; + display: block; } + .gallery-caption a { - display: inline; + display: inline; } + .gallery-columns-1 .gallery-item a { - max-width: 100%; - width: auto; + max-width: 100%; + width: auto; } + .gallery .gallery-icon img { - height: auto; - max-width: 90%; - padding: 5%; + height: auto; + max-width: 90%; + padding: 5%; } + .gallery-columns-1 .gallery-icon img { - padding: 3%; + padding: 3%; } /* Navigation */ .site-content nav { - clear: both; - line-height: 2; - overflow: hidden; + clear: both; + line-height: 2; + overflow: hidden; } + #nav-above { - padding: 24px 0; - padding: 1.714285714rem 0; + padding: 24px 0; + padding: 1.714285714rem 0; } + #nav-above { - display: none; + display: none; } + .paged #nav-above { - display: block; + display: block; } + .nav-previous, .previous-image { - float: left; - width: 50%; + float: left; + width: 50%; } + .nav-next, .next-image { - float: right; - text-align: right; - width: 50%; + float: right; + text-align: right; + width: 50%; } + .nav-single + .comments-area, #comment-nav-above { - margin: 48px 0; - margin: 3.428571429rem 0; + margin: 48px 0; + margin: 3.428571429rem 0; } /* Author profiles */ .author .archive-header { - margin-bottom: 24px; - margin-bottom: 1.714285714rem; + margin-bottom: 24px; + margin-bottom: 1.714285714rem; } + .author-info { - border-top: 1px solid #ededed; - margin: 24px 0; - margin: 1.714285714rem 0; - padding-top: 24px; - padding-top: 1.714285714rem; - overflow: hidden; + border-top: 1px solid #ededed; + margin: 24px 0; + margin: 1.714285714rem 0; + padding-top: 24px; + padding-top: 1.714285714rem; + overflow: hidden; } + .author-description p { - color: #757575; - font-size: 13px; - font-size: 0.928571429rem; - line-height: 1.846153846; + color: #757575; + font-size: 13px; + font-size: 0.928571429rem; + line-height: 1.846153846; } + .author.archive .author-info { - border-top: 0; - margin: 0 0 48px; - margin: 0 0 3.428571429rem; + border-top: 0; + margin: 0 0 48px; + margin: 0 0 3.428571429rem; } + .author.archive .author-avatar { - margin-top: 0; + margin-top: 0; } - /* =Basic structure -------------------------------------------------------------- */ /* Body, links, basics */ html { - font-size: 87.5%; + font-size: 87.5%; } + body { - font-size: 14px; - font-size: 1rem; - font-family: Helvetica, Arial, sans-serif; - text-rendering: optimizeLegibility; - color: #444; + font-size: 14px; + font-size: 1rem; + font-family: Helvetica, Arial, sans-serif; + text-rendering: optimizeLegibility; + color: #444; } + body.custom-font-enabled { - font-family: "Open Sans", Helvetica, Arial, sans-serif; + font-family: "Open Sans", Helvetica, Arial, sans-serif; } + a { - outline: none; - color: #21759b; + outline: none; + color: #21759b; } + a:hover { - color: #0f3647; + color: #0f3647; } /* Assistive text */ .assistive-text, .site .screen-reader-text { - position: absolute !important; - clip: rect(1px, 1px, 1px, 1px); - overflow: hidden; - height: 1px; - width: 1px; + position: absolute !important; + clip: rect(1px, 1px, 1px, 1px); + overflow: hidden; + height: 1px; + width: 1px; } + .main-navigation .assistive-text:focus, .site .screen-reader-text:hover, .site .screen-reader-text:active, .site .screen-reader-text:focus { - background: #fff; - border: 2px solid #333; - border-radius: 3px; - clip: auto !important; - color: #000; - display: block; - font-size: 12px; - height: auto; - padding: 12px; - position: absolute; - top: 5px; - left: 5px; - width: auto; - z-index: 100000; /* Above WP toolbar */ + background: #fff; + border: 2px solid #333; + border-radius: 3px; + clip: auto !important; + color: #000; + display: block; + font-size: 12px; + height: auto; + padding: 12px; + position: absolute; + top: 5px; + left: 5px; + width: auto; + z-index: 100000; /* Above WP toolbar */ } /* Page structure */ .site { - padding: 0 24px; - padding: 0 1.714285714rem; - background-color: #fff; + padding: 0 24px; + padding: 0 1.714285714rem; + background-color: #fff; } + .site-content { - margin: 24px 0 0; - margin: 1.714285714rem 0 0; + margin: 24px 0 0; + margin: 1.714285714rem 0 0; } + .widget-area { - margin: 24px 0 0; - margin: 1.714285714rem 0 0; + margin: 24px 0 0; + margin: 1.714285714rem 0 0; } /* Header */ .site-header { - padding: 24px 0; - padding: 1.714285714rem 0; + padding: 24px 0; + padding: 1.714285714rem 0; } + .site-header h1, .site-header h2 { - text-align: center; + text-align: center; } + .site-header h1 a, .site-header h2 a { - color: #515151; - display: inline-block; - text-decoration: none; + color: #515151; + display: inline-block; + text-decoration: none; } + .site-header h1 a:hover, .site-header h2 a:hover { - color: #21759b; + color: #21759b; } + .site-header h1 { - font-size: 24px; - font-size: 1.714285714rem; - line-height: 1.285714286; - margin-bottom: 14px; - margin-bottom: 1rem; + font-size: 24px; + font-size: 1.714285714rem; + line-height: 1.285714286; + margin-bottom: 14px; + margin-bottom: 1rem; } + .site-header h2 { - font-weight: normal; - font-size: 13px; - font-size: 0.928571429rem; - line-height: 1.846153846; - color: #757575; + font-weight: normal; + font-size: 13px; + font-size: 0.928571429rem; + line-height: 1.846153846; + color: #757575; } + .header-image { - margin-top: 24px; - margin-top: 1.714285714rem; + margin-top: 24px; + margin-top: 1.714285714rem; } /* Navigation Menu */ .main-navigation { - margin-top: 24px; - margin-top: 1.714285714rem; - text-align: center; + margin-top: 24px; + margin-top: 1.714285714rem; + text-align: center; } + .main-navigation li { - margin-top: 24px; - margin-top: 1.714285714rem; - font-size: 12px; - font-size: 0.857142857rem; - line-height: 1.42857143; + margin-top: 24px; + margin-top: 1.714285714rem; + font-size: 12px; + font-size: 0.857142857rem; + line-height: 1.42857143; } + .main-navigation a { - color: #5e5e5e; + color: #5e5e5e; } + .main-navigation a:hover, .main-navigation a:focus { - color: #21759b; + color: #21759b; } + .main-navigation ul.nav-menu, .main-navigation div.nav-menu > ul { - display: none; + display: none; } + .main-navigation ul.nav-menu.toggled-on, .menu-toggle { - display: inline-block; + display: inline-block; } /* Banner */ section[role="banner"] { - margin-bottom: 48px; - margin-bottom: 3.428571429rem; + margin-bottom: 48px; + margin-bottom: 3.428571429rem; } /* Sidebar */ .widget-area .widget { - -webkit-hyphens: auto; - -moz-hyphens: auto; - hyphens: auto; - margin-bottom: 48px; - margin-bottom: 3.428571429rem; - word-wrap: break-word; + -webkit-hyphens: auto; + -moz-hyphens: auto; + hyphens: auto; + margin-bottom: 48px; + margin-bottom: 3.428571429rem; + word-wrap: break-word; } + .widget-area .widget h3 { - margin-bottom: 24px; - margin-bottom: 1.714285714rem; + margin-bottom: 24px; + margin-bottom: 1.714285714rem; } + .widget-area .widget p, .widget-area .widget li, .widget-area .widget .textwidget { - font-size: 13px; - font-size: 0.928571429rem; - line-height: 1.846153846; + font-size: 13px; + font-size: 0.928571429rem; + line-height: 1.846153846; } + .widget-area .widget p { - margin-bottom: 24px; - margin-bottom: 1.714285714rem; + margin-bottom: 24px; + margin-bottom: 1.714285714rem; } + .widget-area .textwidget ul { - list-style: disc outside; - margin: 0 0 24px; - margin: 0 0 1.714285714rem; + list-style: disc outside; + margin: 0 0 24px; + margin: 0 0 1.714285714rem; } + .widget-area .textwidget li { - margin-left: 36px; - margin-left: 2.571428571rem; + margin-left: 36px; + margin-left: 2.571428571rem; } + .widget-area .widget a { - color: #757575; + color: #757575; } + .widget-area .widget a:hover { - color: #21759b; + color: #21759b; } + .widget-area .widget a:visited { - color: #9f9f9f; + color: #9f9f9f; } + .widget-area #s { - width: 53.66666666666%; /* define a width to avoid dropping a wider submit button */ + width: 53.66666666666%; /* define a width to avoid dropping a wider submit button */ } /* Footer */ footer[role="contentinfo"] { - border-top: 1px solid #ededed; - clear: both; - font-size: 12px; - font-size: 0.857142857rem; - line-height: 2; - max-width: 960px; - max-width: 68.571428571rem; - margin-top: 24px; - margin-top: 1.714285714rem; - margin-left: auto; - margin-right: auto; - padding: 24px 0; - padding: 1.714285714rem 0; + border-top: 1px solid #ededed; + clear: both; + font-size: 12px; + font-size: 0.857142857rem; + line-height: 2; + max-width: 960px; + max-width: 68.571428571rem; + margin-top: 24px; + margin-top: 1.714285714rem; + margin-left: auto; + margin-right: auto; + padding: 24px 0; + padding: 1.714285714rem 0; } + footer[role="contentinfo"] a { - color: #686868; + color: #686868; } + footer[role="contentinfo"] a:hover { - color: #21759b; + color: #21759b; } - /* =Main content and comment content -------------------------------------------------------------- */ .entry-meta { - clear: both; + clear: both; } + .entry-header { - margin-bottom: 24px; - margin-bottom: 1.714285714rem; + margin-bottom: 24px; + margin-bottom: 1.714285714rem; } + .entry-header img.wp-post-image { - margin-bottom: 24px; - margin-bottom: 1.714285714rem; + margin-bottom: 24px; + margin-bottom: 1.714285714rem; } + .entry-header .entry-title { - font-size: 20px; - font-size: 1.428571429rem; - line-height: 1.2; - font-weight: normal; + font-size: 20px; + font-size: 1.428571429rem; + line-height: 1.2; + font-weight: normal; } + .entry-header .entry-title a { - text-decoration: none; + text-decoration: none; } + .entry-header .entry-format { - margin-top: 24px; - margin-top: 1.714285714rem; - font-weight: normal; + margin-top: 24px; + margin-top: 1.714285714rem; + font-weight: normal; } + .entry-header .comments-link { - margin-top: 24px; - margin-top: 1.714285714rem; - font-size: 13px; - font-size: 0.928571429rem; - line-height: 1.846153846; - color: #757575; + margin-top: 24px; + margin-top: 1.714285714rem; + font-size: 13px; + font-size: 0.928571429rem; + line-height: 1.846153846; + color: #757575; } + .comments-link a, .entry-meta a { - color: #757575; + color: #757575; } + .comments-link a:hover, .entry-meta a:hover { - color: #21759b; + color: #21759b; } + article.sticky .featured-post { - border-top: 4px double #ededed; - border-bottom: 4px double #ededed; - color: #757575; - font-size: 13px; - font-size: 0.928571429rem; - line-height: 3.692307692; - margin-bottom: 24px; - margin-bottom: 1.714285714rem; - text-align: center; + border-top: 4px double #ededed; + border-bottom: 4px double #ededed; + color: #757575; + font-size: 13px; + font-size: 0.928571429rem; + line-height: 3.692307692; + margin-bottom: 24px; + margin-bottom: 1.714285714rem; + text-align: center; } + .entry-content, .entry-summary, .mu_register { - line-height: 1.714285714; + line-height: 1.714285714; } + .entry-content h1, .comment-content h1, .entry-content h2, @@ -760,71 +798,82 @@ article.sticky .featured-post { .comment-content h5, .entry-content h6, .comment-content h6 { - margin: 24px 0; - margin: 1.714285714rem 0; - line-height: 1.714285714; + margin: 24px 0; + margin: 1.714285714rem 0; + line-height: 1.714285714; } + .entry-content h1, .comment-content h1 { - font-size: 21px; - font-size: 1.5rem; - line-height: 1.5; + font-size: 21px; + font-size: 1.5rem; + line-height: 1.5; } + .entry-content h2, .comment-content h2, .mu_register h2 { - font-size: 18px; - font-size: 1.285714286rem; - line-height: 1.6; + font-size: 18px; + font-size: 1.285714286rem; + line-height: 1.6; } + .entry-content h3, .comment-content h3 { - font-size: 16px; - font-size: 1.142857143rem; - line-height: 1.846153846; + font-size: 16px; + font-size: 1.142857143rem; + line-height: 1.846153846; } + .entry-content h4, .comment-content h4 { - font-size: 14px; - font-size: 1rem; - line-height: 1.846153846; + font-size: 14px; + font-size: 1rem; + line-height: 1.846153846; } + .entry-content h5, .comment-content h5 { - font-size: 13px; - font-size: 0.928571429rem; - line-height: 1.846153846; + font-size: 13px; + font-size: 0.928571429rem; + line-height: 1.846153846; } + .entry-content h6, .comment-content h6 { - font-size: 12px; - font-size: 0.857142857rem; - line-height: 1.846153846; + font-size: 12px; + font-size: 0.857142857rem; + line-height: 1.846153846; } + .entry-content p, .entry-summary p, .comment-content p, .mu_register p { - margin: 0 0 24px; - margin: 0 0 1.714285714rem; - line-height: 1.714285714; + margin: 0 0 24px; + margin: 0 0 1.714285714rem; + line-height: 1.714285714; } + .entry-content a:visited, .comment-content a:visited { - color: #9f9f9f; + color: #9f9f9f; } + .entry-content .more-link { - white-space: nowrap; + white-space: nowrap; } + .entry-content ol, .comment-content ol, .entry-content ul, .comment-content ul, .mu_register ul { - margin: 0 0 24px; - margin: 0 0 1.714285714rem; - line-height: 1.714285714; + margin: 0 0 24px; + margin: 0 0 1.714285714rem; + line-height: 1.714285714; } + .entry-content ul ul, .comment-content ul ul, .entry-content ol ol, @@ -833,627 +882,704 @@ article.sticky .featured-post { .comment-content ul ol, .entry-content ol ul, .comment-content ol ul { - margin-bottom: 0; + margin-bottom: 0; } + .entry-content ul, .comment-content ul, .mu_register ul { - list-style: disc outside; + list-style: disc outside; } + .entry-content ol, .comment-content ol { - list-style: decimal outside; + list-style: decimal outside; } + .entry-content li, .comment-content li, .mu_register li { - margin: 0 0 0 36px; - margin: 0 0 0 2.571428571rem; + margin: 0 0 0 36px; + margin: 0 0 0 2.571428571rem; } + .entry-content blockquote, .comment-content blockquote { - margin-bottom: 24px; - margin-bottom: 1.714285714rem; - padding: 24px; - padding: 1.714285714rem; - font-style: italic; + margin-bottom: 24px; + margin-bottom: 1.714285714rem; + padding: 24px; + padding: 1.714285714rem; + font-style: italic; } + .entry-content blockquote p:last-child, .comment-content blockquote p:last-child { - margin-bottom: 0; + margin-bottom: 0; } + .entry-content code, .comment-content code { - font-family: Consolas, Monaco, Lucida Console, monospace; - font-size: 12px; - font-size: 0.857142857rem; - line-height: 2; + font-family: Consolas, Monaco, Lucida Console, monospace; + font-size: 12px; + font-size: 0.857142857rem; + line-height: 2; } + .entry-content pre, .comment-content pre { - border: 1px solid #ededed; - color: #666; - font-family: Consolas, Monaco, Lucida Console, monospace; - font-size: 12px; - font-size: 0.857142857rem; - line-height: 1.714285714; - margin: 24px 0; - margin: 1.714285714rem 0; - overflow: auto; - padding: 24px; - padding: 1.714285714rem; + border: 1px solid #ededed; + color: #666; + font-family: Consolas, Monaco, Lucida Console, monospace; + font-size: 12px; + font-size: 0.857142857rem; + line-height: 1.714285714; + margin: 24px 0; + margin: 1.714285714rem 0; + overflow: auto; + padding: 24px; + padding: 1.714285714rem; } + .entry-content pre code, .comment-content pre code { - display: block; + display: block; } + .entry-content abbr, .comment-content abbr, .entry-content dfn, .comment-content dfn, .entry-content acronym, .comment-content acronym { - border-bottom: 1px dotted #666; - cursor: help; + border-bottom: 1px dotted #666; + cursor: help; } + .entry-content address, .comment-content address { - display: block; - line-height: 1.714285714; - margin: 0 0 24px; - margin: 0 0 1.714285714rem; + display: block; + line-height: 1.714285714; + margin: 0 0 24px; + margin: 0 0 1.714285714rem; } + img.alignleft, .wp-caption.alignleft { - margin: 12px 24px 12px 0; - margin: 0.857142857rem 1.714285714rem 0.857142857rem 0; + margin: 12px 24px 12px 0; + margin: 0.857142857rem 1.714285714rem 0.857142857rem 0; } + img.alignright, .wp-caption.alignright { - margin: 12px 0 12px 24px; - margin: 0.857142857rem 0 0.857142857rem 1.714285714rem; + margin: 12px 0 12px 24px; + margin: 0.857142857rem 0 0.857142857rem 1.714285714rem; } + img.aligncenter, .wp-caption.aligncenter { - clear: both; - margin-top: 12px; - margin-top: 0.857142857rem; - margin-bottom: 12px; - margin-bottom: 0.857142857rem; + clear: both; + margin-top: 12px; + margin-top: 0.857142857rem; + margin-bottom: 12px; + margin-bottom: 0.857142857rem; } + .entry-content embed, .entry-content iframe, .entry-content object, .entry-content video { - margin-bottom: 24px; - margin-bottom: 1.714285714rem; + margin-bottom: 24px; + margin-bottom: 1.714285714rem; } + .entry-content dl, .comment-content dl { - margin: 0 24px; - margin: 0 1.714285714rem; + margin: 0 24px; + margin: 0 1.714285714rem; } + .entry-content dt, .comment-content dt { - font-weight: bold; - line-height: 1.714285714; + font-weight: bold; + line-height: 1.714285714; } + .entry-content dd, .comment-content dd { - line-height: 1.714285714; - margin-bottom: 24px; - margin-bottom: 1.714285714rem; + line-height: 1.714285714; + margin-bottom: 24px; + margin-bottom: 1.714285714rem; } + .entry-content table, .comment-content table { - border-bottom: 1px solid #ededed; - color: #757575; - font-size: 12px; - font-size: 0.857142857rem; - line-height: 2; - margin: 0 0 24px; - margin: 0 0 1.714285714rem; - width: 100%; + border-bottom: 1px solid #ededed; + color: #757575; + font-size: 12px; + font-size: 0.857142857rem; + line-height: 2; + margin: 0 0 24px; + margin: 0 0 1.714285714rem; + width: 100%; } + .entry-content table caption, .comment-content table caption { - font-size: 16px; - font-size: 1.142857143rem; - margin: 24px 0; - margin: 1.714285714rem 0; + font-size: 16px; + font-size: 1.142857143rem; + margin: 24px 0; + margin: 1.714285714rem 0; } + .entry-content td, .comment-content td { - border-top: 1px solid #ededed; - padding: 6px 10px 6px 0; + border-top: 1px solid #ededed; + padding: 6px 10px 6px 0; } + .site-content article { - border-bottom: 4px double #ededed; - margin-bottom: 72px; - margin-bottom: 5.142857143rem; - padding-bottom: 24px; - padding-bottom: 1.714285714rem; - word-wrap: break-word; - -webkit-hyphens: auto; - -moz-hyphens: auto; - hyphens: auto; + border-bottom: 4px double #ededed; + margin-bottom: 72px; + margin-bottom: 5.142857143rem; + padding-bottom: 24px; + padding-bottom: 1.714285714rem; + word-wrap: break-word; + -webkit-hyphens: auto; + -moz-hyphens: auto; + hyphens: auto; } + .page-links { - clear: both; - line-height: 1.714285714; + clear: both; + line-height: 1.714285714; } + footer.entry-meta { - margin-top: 24px; - margin-top: 1.714285714rem; - font-size: 13px; - font-size: 0.928571429rem; - line-height: 1.846153846; - color: #757575; + margin-top: 24px; + margin-top: 1.714285714rem; + font-size: 13px; + font-size: 0.928571429rem; + line-height: 1.846153846; + color: #757575; } + .single-author .entry-meta .by-author { - display: none; + display: none; } + .mu_register h2 { - color: #757575; - font-weight: normal; + color: #757575; + font-weight: normal; } - /* =Archives -------------------------------------------------------------- */ .archive-header, .page-header { - margin-bottom: 48px; - margin-bottom: 3.428571429rem; - padding-bottom: 22px; - padding-bottom: 1.571428571rem; - border-bottom: 1px solid #ededed; + margin-bottom: 48px; + margin-bottom: 3.428571429rem; + padding-bottom: 22px; + padding-bottom: 1.571428571rem; + border-bottom: 1px solid #ededed; } + .archive-meta { - color: #757575; - font-size: 12px; - font-size: 0.857142857rem; - line-height: 2; - margin-top: 22px; - margin-top: 1.571428571rem; + color: #757575; + font-size: 12px; + font-size: 0.857142857rem; + line-height: 2; + margin-top: 22px; + margin-top: 1.571428571rem; } /* =Single audio/video attachment view -------------------------------------------------------------- */ .attachment .entry-content .mejs-audio { - max-width: 400px; + max-width: 400px; } .attachment .entry-content .mejs-container { - margin-bottom: 24px; + margin-bottom: 24px; } - /* =Single image attachment view -------------------------------------------------------------- */ .article.attachment { - overflow: hidden; + overflow: hidden; } + .image-attachment div.attachment { - text-align: center; + text-align: center; } + .image-attachment div.attachment p { - text-align: center; + text-align: center; } + .image-attachment div.attachment img { - display: block; - height: auto; - margin: 0 auto; - max-width: 100%; + display: block; + height: auto; + margin: 0 auto; + max-width: 100%; } + .image-attachment .entry-caption { - margin-top: 8px; - margin-top: 0.571428571rem; + margin-top: 8px; + margin-top: 0.571428571rem; } - /* =Aside post format -------------------------------------------------------------- */ article.format-aside h1 { - margin-bottom: 24px; - margin-bottom: 1.714285714rem; + margin-bottom: 24px; + margin-bottom: 1.714285714rem; } + article.format-aside h1 a { - text-decoration: none; - color: #4d525a; + text-decoration: none; + color: #4d525a; } + article.format-aside h1 a:hover { - color: #2e3542; + color: #2e3542; } + article.format-aside .aside { - padding: 24px 24px 0; - padding: 1.714285714rem; - background: #d2e0f9; - border-left: 22px solid #a8bfe8; + padding: 24px 24px 0; + padding: 1.714285714rem; + background: #d2e0f9; + border-left: 22px solid #a8bfe8; } + article.format-aside p { - font-size: 13px; - font-size: 0.928571429rem; - line-height: 1.846153846; - color: #4a5466; + font-size: 13px; + font-size: 0.928571429rem; + line-height: 1.846153846; + color: #4a5466; } + article.format-aside blockquote:last-child, article.format-aside p:last-child { - margin-bottom: 0; + margin-bottom: 0; } - /* =Post formats -------------------------------------------------------------- */ /* Image posts */ article.format-image footer h1 { - font-size: 13px; - font-size: 0.928571429rem; - line-height: 1.846153846; - font-weight: normal; + font-size: 13px; + font-size: 0.928571429rem; + line-height: 1.846153846; + font-weight: normal; } + article.format-image footer h2 { - font-size: 11px; - font-size: 0.785714286rem; - line-height: 2.181818182; + font-size: 11px; + font-size: 0.785714286rem; + line-height: 2.181818182; } + article.format-image footer a h2 { - font-weight: normal; + font-weight: normal; } /* Link posts */ article.format-link header { - padding: 0 10px; - padding: 0 0.714285714rem; - float: right; - font-size: 11px; - font-size: 0.785714286rem; - line-height: 2.181818182; - font-weight: bold; - font-style: italic; - text-transform: uppercase; - color: #848484; - background-color: #ebebeb; - border-radius: 3px; + padding: 0 10px; + padding: 0 0.714285714rem; + float: right; + font-size: 11px; + font-size: 0.785714286rem; + line-height: 2.181818182; + font-weight: bold; + font-style: italic; + text-transform: uppercase; + color: #848484; + background-color: #ebebeb; + border-radius: 3px; } + article.format-link .entry-content { - max-width: 80%; - float: left; + max-width: 80%; + float: left; } + article.format-link .entry-content a { - font-size: 22px; - font-size: 1.571428571rem; - line-height: 1.090909091; - text-decoration: none; + font-size: 22px; + font-size: 1.571428571rem; + line-height: 1.090909091; + text-decoration: none; } /* Quote posts */ article.format-quote .entry-content p { - margin: 0; - padding-bottom: 24px; - padding-bottom: 1.714285714rem; + margin: 0; + padding-bottom: 24px; + padding-bottom: 1.714285714rem; } + article.format-quote .entry-content blockquote { - display: block; - padding: 24px 24px 0; - padding: 1.714285714rem 1.714285714rem 0; - font-size: 15px; - font-size: 1.071428571rem; - line-height: 1.6; - font-style: normal; - color: #6a6a6a; - background: #efefef; + display: block; + padding: 24px 24px 0; + padding: 1.714285714rem 1.714285714rem 0; + font-size: 15px; + font-size: 1.071428571rem; + line-height: 1.6; + font-style: normal; + color: #6a6a6a; + background: #efefef; } /* Status posts */ .format-status .entry-header { - margin-bottom: 24px; - margin-bottom: 1.714285714rem; + margin-bottom: 24px; + margin-bottom: 1.714285714rem; } + .format-status .entry-header header { - display: inline-block; + display: inline-block; } + .format-status .entry-header h1 { - font-size: 15px; - font-size: 1.071428571rem; - font-weight: normal; - line-height: 1.6; - margin: 0; + font-size: 15px; + font-size: 1.071428571rem; + font-weight: normal; + line-height: 1.6; + margin: 0; } + .format-status .entry-header h2 { - font-size: 12px; - font-size: 0.857142857rem; - font-weight: normal; - line-height: 2; - margin: 0; + font-size: 12px; + font-size: 0.857142857rem; + font-weight: normal; + line-height: 2; + margin: 0; } + .format-status .entry-header header a { - color: #757575; + color: #757575; } + .format-status .entry-header header a:hover { - color: #21759b; + color: #21759b; } + .format-status .entry-header img { - float: left; - margin-right: 21px; - margin-right: 1.5rem; + float: left; + margin-right: 21px; + margin-right: 1.5rem; } - /* =Comments -------------------------------------------------------------- */ .comments-title { - margin-bottom: 48px; - margin-bottom: 3.428571429rem; - font-size: 16px; - font-size: 1.142857143rem; - line-height: 1.5; - font-weight: normal; + margin-bottom: 48px; + margin-bottom: 3.428571429rem; + font-size: 16px; + font-size: 1.142857143rem; + line-height: 1.5; + font-weight: normal; } + .comments-area article { - margin: 24px 0; - margin: 1.714285714rem 0; + margin: 24px 0; + margin: 1.714285714rem 0; } + .comments-area article header { - margin: 0 0 48px; - margin: 0 0 3.428571429rem; - overflow: hidden; - position: relative; + margin: 0 0 48px; + margin: 0 0 3.428571429rem; + overflow: hidden; + position: relative; } + .comments-area article header img { - float: left; - padding: 0; - line-height: 0; + float: left; + padding: 0; + line-height: 0; } + .comments-area article header cite, .comments-area article header time { - display: block; - margin-left: 85px; - margin-left: 6.071428571rem; + display: block; + margin-left: 85px; + margin-left: 6.071428571rem; } + .comments-area article header cite { - font-style: normal; - font-size: 15px; - font-size: 1.071428571rem; - line-height: 1.42857143; + font-style: normal; + font-size: 15px; + font-size: 1.071428571rem; + line-height: 1.42857143; } + .comments-area cite b { - font-weight: normal; + font-weight: normal; } + .comments-area article header time { - line-height: 1.714285714; - text-decoration: none; - font-size: 12px; - font-size: 0.857142857rem; - color: #5e5e5e; + line-height: 1.714285714; + text-decoration: none; + font-size: 12px; + font-size: 0.857142857rem; + color: #5e5e5e; } + .comments-area article header a { - text-decoration: none; - color: #5e5e5e; + text-decoration: none; + color: #5e5e5e; } + .comments-area article header a:hover { - color: #21759b; + color: #21759b; } + .comments-area article header cite a { - color: #444; + color: #444; } + .comments-area article header cite a:hover { - text-decoration: underline; + text-decoration: underline; } + .comments-area article header h4 { - position: absolute; - top: 0; - right: 0; - padding: 6px 12px; - padding: 0.428571429rem 0.857142857rem; - font-size: 12px; - font-size: 0.857142857rem; - font-weight: normal; - color: #fff; - background-color: #0088d0; - background-repeat: repeat-x; - background-image: -moz-linear-gradient(top, #009cee, #0088d0); - background-image: -ms-linear-gradient(top, #009cee, #0088d0); - background-image: -webkit-linear-gradient(top, #009cee, #0088d0); - background-image: -o-linear-gradient(top, #009cee, #0088d0); - background-image: linear-gradient(top, #009cee, #0088d0); - border-radius: 3px; - border: 1px solid #007cbd; + position: absolute; + top: 0; + right: 0; + padding: 6px 12px; + padding: 0.428571429rem 0.857142857rem; + font-size: 12px; + font-size: 0.857142857rem; + font-weight: normal; + color: #fff; + background-color: #0088d0; + background-repeat: repeat-x; + background-image: -moz-linear-gradient(top, #009cee, #0088d0); + background-image: -ms-linear-gradient(top, #009cee, #0088d0); + background-image: -webkit-linear-gradient(top, #009cee, #0088d0); + background-image: -o-linear-gradient(top, #009cee, #0088d0); + background-image: linear-gradient(top, #009cee, #0088d0); + border-radius: 3px; + border: 1px solid #007cbd; } + .comments-area .bypostauthor cite span { - position: absolute; - margin-left: 5px; - margin-left: 0.357142857rem; - padding: 2px 5px; - padding: 0.142857143rem 0.357142857rem; - font-size: 10px; - font-size: 0.714285714rem; + position: absolute; + margin-left: 5px; + margin-left: 0.357142857rem; + padding: 2px 5px; + padding: 0.142857143rem 0.357142857rem; + font-size: 10px; + font-size: 0.714285714rem; } + .comments-area .bypostauthor cite b { - font-weight: bold; + font-weight: bold; } + a.comment-reply-link, a.comment-edit-link { - color: #686868; - font-size: 13px; - font-size: 0.928571429rem; - line-height: 1.846153846; + color: #686868; + font-size: 13px; + font-size: 0.928571429rem; + line-height: 1.846153846; } + a.comment-reply-link:hover, a.comment-edit-link:hover { - color: #21759b; + color: #21759b; } + .commentlist .pingback { - line-height: 1.714285714; - margin-bottom: 24px; - margin-bottom: 1.714285714rem; + line-height: 1.714285714; + margin-bottom: 24px; + margin-bottom: 1.714285714rem; } /* Comment form */ #respond { - margin-top: 48px; - margin-top: 3.428571429rem; + margin-top: 48px; + margin-top: 3.428571429rem; } + #respond h3#reply-title { - font-size: 16px; - font-size: 1.142857143rem; - line-height: 1.5; + font-size: 16px; + font-size: 1.142857143rem; + line-height: 1.5; } + #respond h3#reply-title #cancel-comment-reply-link { - margin-left: 10px; - margin-left: 0.714285714rem; - font-weight: normal; - font-size: 12px; - font-size: 0.857142857rem; + margin-left: 10px; + margin-left: 0.714285714rem; + font-weight: normal; + font-size: 12px; + font-size: 0.857142857rem; } + #respond form { - margin: 24px 0; - margin: 1.714285714rem 0; + margin: 24px 0; + margin: 1.714285714rem 0; } + #respond form p { - margin: 11px 0; - margin: 0.785714286rem 0; + margin: 11px 0; + margin: 0.785714286rem 0; } + #respond form p.logged-in-as { - margin-bottom: 24px; - margin-bottom: 1.714285714rem; + margin-bottom: 24px; + margin-bottom: 1.714285714rem; } + #respond form label { - display: block; - line-height: 1.714285714; + display: block; + line-height: 1.714285714; } + #respond form input[type="text"], #respond form textarea { - -moz-box-sizing: border-box; - box-sizing: border-box; - font-size: 12px; - font-size: 0.857142857rem; - line-height: 1.714285714; - padding: 10px; - padding: 0.714285714rem; - width: 100%; + -moz-box-sizing: border-box; + box-sizing: border-box; + font-size: 12px; + font-size: 0.857142857rem; + line-height: 1.714285714; + padding: 10px; + padding: 0.714285714rem; + width: 100%; } + #respond form p.form-allowed-tags { - margin: 0; - font-size: 12px; - font-size: 0.857142857rem; - line-height: 2; - color: #5e5e5e; + margin: 0; + font-size: 12px; + font-size: 0.857142857rem; + line-height: 2; + color: #5e5e5e; } + .required { - color: red; + color: red; } - /* =Front page template -------------------------------------------------------------- */ .entry-page-image { - margin-bottom: 14px; - margin-bottom: 1rem; + margin-bottom: 14px; + margin-bottom: 1rem; } + .template-front-page .site-content article { - border: 0; - margin-bottom: 0; + border: 0; + margin-bottom: 0; } + .template-front-page .widget-area { - clear: both; - float: none; - width: auto; - padding-top: 24px; - padding-top: 1.714285714rem; - border-top: 1px solid #ededed; + clear: both; + float: none; + width: auto; + padding-top: 24px; + padding-top: 1.714285714rem; + border-top: 1px solid #ededed; } + .template-front-page .widget-area .widget li { - margin: 8px 0 0; - margin: 0.571428571rem 0 0; - font-size: 13px; - font-size: 0.928571429rem; - line-height: 1.714285714; - list-style-type: square; - list-style-position: inside; + margin: 8px 0 0; + margin: 0.571428571rem 0 0; + font-size: 13px; + font-size: 0.928571429rem; + line-height: 1.714285714; + list-style-type: square; + list-style-position: inside; } + .template-front-page .widget-area .widget li a { - color: #757575; + color: #757575; } + .template-front-page .widget-area .widget li a:hover { - color: #21759b; + color: #21759b; } + .template-front-page .widget-area .widget_text img { - float: left; - margin: 8px 24px 8px 0; - margin: 0.571428571rem 1.714285714rem 0.571428571rem 0; + float: left; + margin: 8px 24px 8px 0; + margin: 0.571428571rem 1.714285714rem 0.571428571rem 0; } - /* =Widgets -------------------------------------------------------------- */ .widget-area .widget ul ul { - margin-left: 12px; - margin-left: 0.857142857rem; + margin-left: 12px; + margin-left: 0.857142857rem; } + .widget_rss li { - margin: 12px 0; - margin: 0.857142857rem 0; + margin: 12px 0; + margin: 0.857142857rem 0; } + .widget_recent_entries .post-date, .widget_rss .rss-date { - color: #aaa; - font-size: 11px; - font-size: 0.785714286rem; - margin-left: 12px; - margin-left: 0.857142857rem; + color: #aaa; + font-size: 11px; + font-size: 0.785714286rem; + margin-left: 12px; + margin-left: 0.857142857rem; } + #wp-calendar { - margin: 0; - width: 100%; - font-size: 13px; - font-size: 0.928571429rem; - line-height: 1.846153846; - color: #686868; + margin: 0; + width: 100%; + font-size: 13px; + font-size: 0.928571429rem; + line-height: 1.846153846; + color: #686868; } + #wp-calendar th, #wp-calendar td, #wp-calendar caption { - text-align: left; + text-align: left; } + #wp-calendar #next { - padding-right: 24px; - padding-right: 1.714285714rem; - text-align: right; + padding-right: 24px; + padding-right: 1.714285714rem; + text-align: right; } + .widget_search label { - display: block; - font-size: 13px; - font-size: 0.928571429rem; - line-height: 1.846153846; + display: block; + font-size: 13px; + font-size: 0.928571429rem; + line-height: 1.846153846; } + .widget_twitter li { - list-style-type: none; + list-style-type: none; } + .widget_twitter .timesince { - display: block; - text-align: right; + display: block; + text-align: right; } - /* =Plugins ----------------------------------------------- */ img#wpstats { - display: block; - margin: 0 auto 24px; - margin: 0 auto 1.714285714rem; + display: block; + margin: 0 auto 24px; + margin: 0 auto 1.714285714rem; } - /* =Media queries -------------------------------------------------------------- */ @@ -1463,316 +1589,411 @@ img#wpstats { * the meta tag. See https://core.trac.wordpress.org/ticket/25888. */ @-ms-viewport { - width: device-width; + width: device-width; } + @viewport { - width: device-width; + width: device-width; } /* Minimum width of 600 pixels. */ @media screen and (min-width: 600px) { - .author-avatar { - float: left; - margin-top: 8px; - margin-top: 0.571428571rem; - } - .author-description { - float: right; - width: 80%; - } - .site { - margin: 0 auto; - max-width: 960px; - max-width: 68.571428571rem; - overflow: hidden; - } - .site-content { - float: left; - width: 65.104166667%; - } - body.template-front-page .site-content, - body.attachment .site-content, - body.full-width .site-content { - width: 100%; - } - .widget-area { - float: right; - width: 26.041666667%; - } - .site-header h1, - .site-header h2 { - text-align: left; - } - .site-header h1 { - font-size: 26px; - font-size: 1.857142857rem; - line-height: 1.846153846; - margin-bottom: 0; - } - .main-navigation ul.nav-menu, - .main-navigation div.nav-menu > ul { - border-bottom: 1px solid #ededed; - border-top: 1px solid #ededed; - display: inline-block !important; - text-align: left; - width: 100%; - } - .main-navigation ul { - margin: 0; - text-indent: 0; - } - .main-navigation li a, - .main-navigation li { - display: inline-block; - text-decoration: none; - } - .main-navigation li a { - border-bottom: 0; - color: #6a6a6a; - line-height: 3.692307692; - text-transform: uppercase; - white-space: nowrap; - } - .main-navigation li a:hover, - .main-navigation li a:focus { - color: #000; - } - .main-navigation li { - margin: 0 40px 0 0; - margin: 0 2.857142857rem 0 0; - position: relative; - } - .main-navigation li ul { - margin: 0; - padding: 0; - position: absolute; - top: 100%; - z-index: 1; - height: 1px; - width: 1px; - overflow: hidden; - clip: rect(1px, 1px, 1px, 1px); - } - .main-navigation li ul ul { - top: 0; - left: 100%; - } - .main-navigation ul li:hover > ul, - .main-navigation ul li:focus > ul, - .main-navigation .focus > ul { - border-left: 0; - clip: inherit; - overflow: inherit; - height: inherit; - width: inherit; - } - .main-navigation li ul li a { - background: #efefef; - border-bottom: 1px solid #ededed; - display: block; - font-size: 11px; - font-size: 0.785714286rem; - line-height: 2.181818182; - padding: 8px 10px; - padding: 0.571428571rem 0.714285714rem; - width: 180px; - width: 12.85714286rem; - white-space: normal; - } - .main-navigation li ul li a:hover, - .main-navigation li ul li a:focus { - background: #e3e3e3; - color: #444; - } - .main-navigation .current-menu-item > a, - .main-navigation .current-menu-ancestor > a, - .main-navigation .current_page_item > a, - .main-navigation .current_page_ancestor > a { - color: #636363; - font-weight: bold; - } - .menu-toggle { - display: none; - } - .entry-header .entry-title { - font-size: 22px; - font-size: 1.571428571rem; - } - #respond form input[type="text"] { - width: 46.333333333%; - } - #respond form textarea.blog-textarea { - width: 79.666666667%; - } - .template-front-page .site-content, - .template-front-page article { - overflow: hidden; - } - .template-front-page.has-post-thumbnail article { - float: left; - width: 47.916666667%; - } - .entry-page-image { - float: right; - margin-bottom: 0; - width: 47.916666667%; - } - .template-front-page .widget-area .widget, - .template-front-page.two-sidebars .widget-area .front-widgets { - float: left; - width: 51.875%; - margin-bottom: 24px; - margin-bottom: 1.714285714rem; - } - .template-front-page .widget-area .widget:nth-child(odd) { - clear: right; - } - .template-front-page .widget-area .widget:nth-child(even), - .template-front-page.two-sidebars .widget-area .front-widgets + .front-widgets { - float: right; - width: 39.0625%; - margin: 0 0 24px; - margin: 0 0 1.714285714rem; - } - .template-front-page.two-sidebars .widget, - .template-front-page.two-sidebars .widget:nth-child(even) { - float: none; - width: auto; - } - .commentlist .children { - margin-left: 48px; - margin-left: 3.428571429rem; - } + .author-avatar { + float: left; + margin-top: 8px; + margin-top: 0.571428571rem; + } + + .author-description { + float: right; + width: 80%; + } + + .site { + margin: 0 auto; + max-width: 960px; + max-width: 68.571428571rem; + overflow: hidden; + } + + .site-content { + float: left; + width: 65.104166667%; + } + + body.template-front-page .site-content, + body.attachment .site-content, + body.full-width .site-content { + width: 100%; + } + + .widget-area { + float: right; + width: 26.041666667%; + } + + .site-header h1, + .site-header h2 { + text-align: left; + } + + .site-header h1 { + font-size: 26px; + font-size: 1.857142857rem; + line-height: 1.846153846; + margin-bottom: 0; + } + + .main-navigation ul.nav-menu, + .main-navigation div.nav-menu > ul { + border-bottom: 1px solid #ededed; + border-top: 1px solid #ededed; + display: inline-block !important; + text-align: left; + width: 100%; + } + + .main-navigation ul { + margin: 0; + text-indent: 0; + } + + .main-navigation li a, + .main-navigation li { + display: inline-block; + text-decoration: none; + } + + .main-navigation li a { + border-bottom: 0; + color: #6a6a6a; + line-height: 3.692307692; + text-transform: uppercase; + white-space: nowrap; + } + + .main-navigation li a:hover, + .main-navigation li a:focus { + color: #000; + } + + .main-navigation li { + margin: 0 40px 0 0; + margin: 0 2.857142857rem 0 0; + position: relative; + } + + .main-navigation li ul { + margin: 0; + padding: 0; + position: absolute; + top: 100%; + z-index: 1; + height: 1px; + width: 1px; + overflow: hidden; + clip: rect(1px, 1px, 1px, 1px); + } + + .main-navigation li ul ul { + top: 0; + left: 100%; + } + + .main-navigation ul li:hover > ul, + .main-navigation ul li:focus > ul, + .main-navigation .focus > ul { + border-left: 0; + clip: inherit; + overflow: inherit; + height: inherit; + width: inherit; + } + + .main-navigation li ul li a { + background: #efefef; + border-bottom: 1px solid #ededed; + display: block; + font-size: 11px; + font-size: 0.785714286rem; + line-height: 2.181818182; + padding: 8px 10px; + padding: 0.571428571rem 0.714285714rem; + width: 180px; + width: 12.85714286rem; + white-space: normal; + } + + .main-navigation li ul li a:hover, + .main-navigation li ul li a:focus { + background: #e3e3e3; + color: #444; + } + + .main-navigation .current-menu-item > a, + .main-navigation .current-menu-ancestor > a, + .main-navigation .current_page_item > a, + .main-navigation .current_page_ancestor > a { + color: #636363; + font-weight: bold; + } + + .menu-toggle { + display: none; + } + + .entry-header .entry-title { + font-size: 22px; + font-size: 1.571428571rem; + } + + #respond form input[type="text"] { + width: 46.333333333%; + } + + #respond form textarea.blog-textarea { + width: 79.666666667%; + } + + .template-front-page .site-content, + .template-front-page article { + overflow: hidden; + } + + .template-front-page.has-post-thumbnail article { + float: left; + width: 47.916666667%; + } + + .entry-page-image { + float: right; + margin-bottom: 0; + width: 47.916666667%; + } + + .template-front-page .widget-area .widget, + .template-front-page.two-sidebars .widget-area .front-widgets { + float: left; + width: 51.875%; + margin-bottom: 24px; + margin-bottom: 1.714285714rem; + } + + .template-front-page .widget-area .widget:nth-child(odd) { + clear: right; + } + + .template-front-page .widget-area .widget:nth-child(even), + .template-front-page.two-sidebars .widget-area .front-widgets + .front-widgets { + float: right; + width: 39.0625%; + margin: 0 0 24px; + margin: 0 0 1.714285714rem; + } + + .template-front-page.two-sidebars .widget, + .template-front-page.two-sidebars .widget:nth-child(even) { + float: none; + width: auto; + } + + .commentlist .children { + margin-left: 48px; + margin-left: 3.428571429rem; + } } /* Minimum width of 960 pixels. */ @media screen and (min-width: 960px) { - body { - background-color: #e6e6e6; - } - body .site { - padding: 0 40px; - padding: 0 2.857142857rem; - margin-top: 48px; - margin-top: 3.428571429rem; - margin-bottom: 48px; - margin-bottom: 3.428571429rem; - box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3); - } - body.custom-background-empty { - background-color: #fff; - } - body.custom-background-empty .site, - body.custom-background-white .site { - padding: 0; - margin-top: 0; - margin-bottom: 0; - box-shadow: none; - } + body { + background-color: #e6e6e6; + } + + body .site { + padding: 0 40px; + padding: 0 2.857142857rem; + margin-top: 48px; + margin-top: 3.428571429rem; + margin-bottom: 48px; + margin-bottom: 3.428571429rem; + box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3); + } + + body.custom-background-empty { + background-color: #fff; + } + + body.custom-background-empty .site, + body.custom-background-white .site { + padding: 0; + margin-top: 0; + margin-bottom: 0; + box-shadow: none; + } } - /* =Print ----------------------------------------------- */ @media print { - body { - background: none !important; - color: #000; - font-size: 10pt; - } - footer a[rel=bookmark]:link:after, - footer a[rel=bookmark]:visited:after { - content: " [" attr(href) "] "; /* Show URLs */ - } - a { - text-decoration: none; - } - .entry-content img, - .comment-content img, - .author-avatar img, - img.wp-post-image { - border-radius: 0; - box-shadow: none; - } - .site { - clear: both !important; - display: block !important; - float: none !important; - max-width: 100%; - position: relative !important; - } - .site-header { - margin-bottom: 72px; - margin-bottom: 5.142857143rem; - text-align: left; - } - .site-header h1 { - font-size: 21pt; - line-height: 1; - text-align: left; - } - .site-header h2 { - color: #000; - font-size: 10pt; - text-align: left; - } - .site-header h1 a, - .site-header h2 a { - color: #000; - } - .author-avatar, - #colophon, - #respond, - .commentlist .comment-edit-link, - .commentlist .reply, - .entry-header .comments-link, - .entry-meta .edit-link a, - .page-link, - .site-content nav, - .widget-area, - img.header-image, - .main-navigation { - display: none; - } - .wrapper { - border-top: none; - box-shadow: none; - } - .site-content { - margin: 0; - width: auto; - } - - .entry-header .entry-title, - .entry-title { - font-size: 21pt; - } - footer.entry-meta, - footer.entry-meta a { - color: #444; - font-size: 10pt; - } - .author-description { - float: none; - width: auto; - } - - /* Comments */ - .commentlist > li.comment { - background: none; - position: relative; - width: auto; - } - .commentlist .avatar { - height: 39px; - left: 2.2em; - top: 2.2em; - width: 39px; - } - .comments-area article header cite, - .comments-area article header time { - margin-left: 50px; - margin-left: 3.57142857rem; - } -} + body { + background: none !important; + color: #000; + font-size: 10pt; + } + + footer a[rel=bookmark]:link:after, + footer a[rel=bookmark]:visited:after { + content: " [" attr(href) "] "; /* Show URLs */ + } + + a { + text-decoration: none; + } + + .entry-content img, + .comment-content img, + .author-avatar img, + img.wp-post-image { + border-radius: 0; + box-shadow: none; + } + + .site { + clear: both !important; + display: block !important; + float: none !important; + max-width: 100%; + position: relative !important; + } + + .site-header { + margin-bottom: 72px; + margin-bottom: 5.142857143rem; + text-align: left; + } + + .site-header h1 { + font-size: 21pt; + line-height: 1; + text-align: left; + } + + .site-header h2 { + color: #000; + font-size: 10pt; + text-align: left; + } + + .site-header h1 a, + .site-header h2 a { + color: #000; + } + + .author-avatar, + #colophon, + #respond, + .commentlist .comment-edit-link, + .commentlist .reply, + .entry-header .comments-link, + .entry-meta .edit-link a, + .page-link, + .site-content nav, + .widget-area, + img.header-image, + .main-navigation { + display: none; + } + + .wrapper { + border-top: none; + box-shadow: none; + } + + .site-content { + margin: 0; + width: auto; + } + + .entry-header .entry-title, + .entry-title { + font-size: 21pt; + } + + footer.entry-meta, + footer.entry-meta a { + color: #444; + font-size: 10pt; + } + + .author-description { + float: none; + width: auto; + } + + /* Comments */ + .commentlist > li.comment { + background: none; + position: relative; + width: auto; + } + + .commentlist .avatar { + height: 39px; + left: 2.2em; + top: 2.2em; + width: 39px; + } + + .comments-area article header cite, + .comments-area article header time { + margin-left: 50px; + margin-left: 3.57142857rem; + } +} + +.breadcrumb +div { + display: inline; + font-size: 13px; + margin-left: -3px; +} + +#wp-auto-top { + position: fixed; + top: 45%; + right: 50%; + display: block; + margin-right: -540px; + z-index: 9999; +} + +#wp-auto-top-top, #wp-auto-top-comment, #wp-auto-top-bottom { + background: url(https://www.lylinux.org/wp-content/plugins/wp-auto-top/img/1.png) no-repeat; + position: relative; + cursor: pointer; + height: 25px; + width: 29px; + margin: 10px 0 0; +} + +#wp-auto-top-comment { + background-position: left -30px; + height: 32px; +} + +#wp-auto-top-bottom { + background-position: left -68px; +} + +#wp-auto-top-comment:hover { + background-position: right -30px; +} + +#wp-auto-top-top:hover { + background-position: right 0; +} + +#wp-auto-top-bottom:hover { + background-position: right -68px; +} \ No newline at end of file diff --git a/blog/templatetags/blog_tags.py b/blog/templatetags/blog_tags.py index 1eb6908..cd6e6e1 100644 --- a/blog/templatetags/blog_tags.py +++ b/blog/templatetags/blog_tags.py @@ -19,7 +19,7 @@ import markdown2 from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe import random -from blog.models import Article, Category, Tag +from blog.models import Article, Category, Tag, Links from django.utils.encoding import force_text register = template.Library() @@ -58,18 +58,21 @@ def custom_markdown(content): """ -@register.inclusion_tag('blog/breadcrumb.html') -def parsecategoryname(article): +@register.inclusion_tag('blog/tags/breadcrumb.html') +def load_breadcrumb(article): names = article.get_category_tree() names.append((settings.SITE_NAME, 'http://127.0.0.1:8000')) names = names[::-1] - print(names) - return {'names': names} + + return { + 'names': names, + 'title': article.title + } -@register.inclusion_tag('blog/articletaglist.html') -def loadarticletags(article): +@register.inclusion_tag('blog/tags/articletaglist.html') +def load_articletags(article): tags = article.tags.all() tags_list = [] for tag in tags: @@ -83,24 +86,25 @@ def loadarticletags(article): } -@register.inclusion_tag('blog/sidebar.html') -def loadsidebartags(): +@register.inclusion_tag('blog/tags/sidebar.html') +def load_sidebar(): recent_articles = Article.objects.filter(status='p')[:settings.SIDEBAR_ARTICLE_COUNT] sidebar_categorys = Category.objects.all() most_read_articles = Article.objects.filter(status='p').order_by('-views')[:settings.SIDEBAR_ARTICLE_COUNT] dates = Article.objects.datetimes('created_time', 'month', order='DESC') - print(dates) + links = Links.objects.all() # tags= return { 'recent_articles': recent_articles, 'sidebar_categorys': sidebar_categorys, 'most_read_articles': most_read_articles, - 'article_dates': dates + 'article_dates': dates, + 'sidabar_links': links } @register.inclusion_tag('blog/tags/article_meta_info.html') -def loadarticlemetas(article): +def load_article_metas(article): return { 'article': article } diff --git a/blog/views.py b/blog/views.py index c55164b..3696a85 100644 --- a/blog/views.py +++ b/blog/views.py @@ -10,6 +10,7 @@ from django.conf import settings import markdown from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe +from django.core.exceptions import ObjectDoesNotExist class ArticleListView(ListView): @@ -19,8 +20,8 @@ class ArticleListView(ListView): # context_object_name属性用于给上下文变量取名(在模板中使用该名字) context_object_name = 'article_list' - def __init__(self): - self.page_description = '' + # 页面类型,分类目录或标签列表等 + page_type = '' class IndexView(ArticleListView): @@ -46,36 +47,56 @@ class ArticleDetailView(DetailView): # obj.body = markdown2.markdown(obj.body) return obj + def get_context_data(self, **kwargs): + articleid = int(self.kwargs['article_id']) + + def get_article(id): + try: + return Article.objects.get(pk=id) + except ObjectDoesNotExist: + return None + + next_article = get_article(articleid + 1) + prev_article = get_article(articleid - 1) + kwargs['next_article'] = next_article + kwargs['prev_article'] = prev_article + + return super(ArticleDetailView, self).get_context_data(**kwargs) + class CategoryDetailView(ArticleListView): # template_name = 'index.html' # context_object_name = 'article_list' # pk_url_kwarg = 'article_name' + page_type = "分类目录归档" def get_queryset(self): categoryname = self.kwargs['category_name'] - # print(categoryname) - self.page_description = '分类目录归档: %s ' % categoryname article_list = Article.objects.filter(category__name=categoryname, status='p') return article_list def get_context_data(self, **kwargs): - # 增加额外的数据 - kwargs['page_description'] = self.page_description + categoryname = self.kwargs['category_name'] + + kwargs['page_type'] = CategoryDetailView.page_type + kwargs['tag_name'] = categoryname return super(CategoryDetailView, self).get_context_data(**kwargs) class AuthorDetailView(ArticleListView): + page_type = '作者文章归档' + def get_queryset(self): author_name = self.kwargs['author_name'] - self.page_description = '作者文章归档: %s ' % author_name article_list = Article.objects.filter(author__username=author_name) return article_list def get_context_data(self, **kwargs): - kwargs['page_description'] = self.page_description + author_name = self.kwargs['author_name'] + kwargs['page_type'] = AuthorDetailView.page_type + kwargs['tag_name'] = author_name return super(AuthorDetailView, self).get_context_data(**kwargs) @@ -91,12 +112,16 @@ class TagListView(ListView): class TagDetailView(ArticleListView): + page_type = '分类标签归档' + def get_queryset(self): tag_name = self.kwargs['tag_name'] - self.page_description = '分类标签: %s ' % tag_name + article_list = Article.objects.filter(tags__name=tag_name) return article_list def get_context_data(self, **kwargs): - kwargs['page_description'] = self.page_description + tag_name = self.kwargs['tag_name'] + kwargs['page_type'] = TagDetailView.page_type + kwargs['tag_name'] = tag_name return super(TagDetailView, self).get_context_data(**kwargs) diff --git a/comments/models.py b/comments/models.py index 075df24..218b6d7 100644 --- a/comments/models.py +++ b/comments/models.py @@ -11,8 +11,8 @@ class Comment(models.Model): created_time = models.DateTimeField('创建时间', auto_now_add=True) last_mod_time = models.DateTimeField('修改时间', auto_now=True) author = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name='作者', on_delete=models.CASCADE) - article = models.ForeignKey(Article, verbose_name='文章', on_delete=models.CASCADE) + parant_comment = models.ForeignKey('self', verbose_name="上级评论", blank=True, null=True) class Meta: ordering = ['created_time'] diff --git a/comments/templatetags/comments_tags.py b/comments/templatetags/comments_tags.py index 9a3317d..1d3e766 100644 --- a/comments/templatetags/comments_tags.py +++ b/comments/templatetags/comments_tags.py @@ -25,3 +25,10 @@ register = template.Library() def GetCommentCount(parser, token): commentcount = Comment.objects.filter(article__author_id=token).count() return "0" if commentcount == 0 else str(commentcount) + " comments" + + +@register.inclusion_tag('comments/tags/post_comment.html') +def load_post_comment(article): + return { + 'article': article + } diff --git a/templates/base.html b/templates/base.html index 1ea8663..b723a8a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -39,14 +39,14 @@ - +
- + - - - - + + + + - \ No newline at end of file diff --git a/templates/blog/articledetail.html b/templates/blog/articledetail.html index f95cd69..2fbefda 100644 --- a/templates/blog/articledetail.html +++ b/templates/blog/articledetail.html @@ -6,21 +6,37 @@
{% load_article_detail article False %} - {% endcomment %} + + {% if article.commentstatus == "o" %} + {% load comments_tags %} + {% load_post_comment article %} + {% endif %}
{% endblock %} {% block sidebar %} - {% loadsidebartags %} + {% load_sidebar %} {% endblock %} diff --git a/templates/blog/breadcrumb.html b/templates/blog/breadcrumb.html deleted file mode 100644 index 47db4b8..0000000 --- a/templates/blog/breadcrumb.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/templates/blog/index.html b/templates/blog/index.html index 763d6e8..3e7580f 100644 --- a/templates/blog/index.html +++ b/templates/blog/index.html @@ -4,51 +4,17 @@ {% block content %}
- {% for article in article_list %} - {% load_article_detail article True %} - {% comment %}
-
- -

- {{ article.title }} -

- -
- - + {% if page_type and tag_name %} +
-
+

{{ page_type }}:{{ tag_name }}

+
+ {% endif %} -
- {{ article.summary|custom_markdown }} - -

Read more

-
- {% loadarticlemetas article %} -
{% endcomment %} + {% for article in article_list %} + {% load_article_detail article True %} {% endfor %} - - -

- - - + {% if not isindex %} + {% load_breadcrumb article %} + {% endif %}
@@ -39,5 +30,5 @@ {% endif %}
- {% loadarticlemetas article %} + {% load_article_metas article %} \ No newline at end of file diff --git a/templates/blog/tags/article_meta_info.html b/templates/blog/tags/article_meta_info.html index 3938409..8fa8424 100644 --- a/templates/blog/tags/article_meta_info.html +++ b/templates/blog/tags/article_meta_info.html @@ -9,7 +9,7 @@ 。属于{{ article.category.name }}分类, {% if article.tags.all %} 被贴了 - {% comment %}{% endcomment %} + {% for t in article.tags.all %} {% if t != article.tags.all.last %} @@ -20,7 +20,7 @@ 标签。 {% endif %} 作者是 \ No newline at end of file diff --git a/templates/blog/tags/sidebar.html b/templates/blog/tags/sidebar.html new file mode 100755 index 0000000..b70675f --- /dev/null +++ b/templates/blog/tags/sidebar.html @@ -0,0 +1,65 @@ + \ No newline at end of file diff --git a/templates/comments/tags/post_comment.html b/templates/comments/tags/post_comment.html new file mode 100644 index 0000000..16f6944 --- /dev/null +++ b/templates/comments/tags/post_comment.html @@ -0,0 +1,35 @@ +
+ +
+

发表评论 + +

+
+

电子邮件地址不会被公开。 必填项已用*标注 +

+

+

+

+ +

+

+ +

+

+

+
+ +
\ No newline at end of file