Refacto + adding missing trmplate

This commit is contained in:
Lucas Cimon 2017-08-09 02:52:31 +02:00
parent 38d243106e
commit 484a5ad227
6 changed files with 33 additions and 6 deletions

View File

@ -113,10 +113,13 @@ a {
.mg-tag { .mg-tag {
margin: 0 .5rem; margin: 0 .5rem;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
color: #FF6600; } color: #FF6600; }
.mg-tag:hover { .mg-tag:hover {
text-decoration: none; text-decoration: none;
color: #FF6600; } color: #FF6600; }
.mg-tag > .uk-icon-tag {
margin-right: .2rem; }
.mg-list-title { .mg-list-title {
font-size: 2em; font-size: 2em;

View File

@ -74,8 +74,7 @@
{% if not MG_DISABLE_SUMMARY %}<p class="uk-article-lead" itemprop="description">{{ article.summary|striptags }}</p>{% endif %} {% if not MG_DISABLE_SUMMARY %}<p class="uk-article-lead" itemprop="description">{{ article.summary|striptags }}</p>{% endif %}
<section class="uk-article-content" itemprop="articleBody">{{ article.content }}</section> <section class="uk-article-content" itemprop="articleBody">{{ article.content }}</section>
{% set bullet = joiner(" &bullet; ") %} {% include "partials/inline-tags.html" %}
<div align="right" title="Tags">{% for tag in article.tags %}{{bullet()}}<a class="mg-tag" href="{{tag.url}}"><i class="uk-icon-tag"></i>{{tag.name}}</a>{% endfor %}</div>
<hr class="uk-article-divider"> <hr class="uk-article-divider">
</article> </article>

View File

@ -3,8 +3,7 @@
<p class="uk-article-meta"><time datetime="{{ article.date.strftime('%Y-%m-%d') }}" itemprop="datePublished">{{ article.locale_date }}</time><a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>{% if DISQUS_SITENAME %} • <br class="uk-visible-small"><i class="uk-icon-comment"></i> <a href="{{ SITEURL }}/{{ article.url }}#disqus_thread" itemprop="discussionUrl"></a>{% endif %}</p> <p class="uk-article-meta"><time datetime="{{ article.date.strftime('%Y-%m-%d') }}" itemprop="datePublished">{{ article.locale_date }}</time><a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>{% if DISQUS_SITENAME %} • <br class="uk-visible-small"><i class="uk-icon-comment"></i> <a href="{{ SITEURL }}/{{ article.url }}#disqus_thread" itemprop="discussionUrl"></a>{% endif %}</p>
{% if not MG_DISABLE_SUMMARY %}<p class="uk-article-lead" itemprop="description">{{ article.summary|striptags|striptags }}</p>{% endif %} {% if not MG_DISABLE_SUMMARY %}<p class="uk-article-lead" itemprop="description">{{ article.summary|striptags|striptags }}</p>{% endif %}
<section class="uk-article-content" itemprop="articleBody">{{ article.content }}</section> <section class="uk-article-content" itemprop="articleBody">{{ article.content }}</section>
{% set bullet = joiner(" &bullet; ") %} {% include "partials/inline-tags.html" %}
<div align="right" title="Tags">{% for tag in article.tags %}{{bullet()}}<a class="mg-tag" href="{{tag.url}}"><i class="uk-icon-tag"></i>{{tag.name}}</a>{% endfor %}</div>
<a href="{{ SITEURL }}/{{ article.url }}#disqus_thread"></a> <a href="{{ SITEURL }}/{{ article.url }}#disqus_thread"></a>
<hr class="uk-article-divider"> <hr class="uk-article-divider">
</article> </article>

View File

@ -5,8 +5,7 @@
<p class="uk-article-lead" itemprop="description">{{ article.summary|striptags|striptags }}</p> <p class="uk-article-lead" itemprop="description">{{ article.summary|striptags|striptags }}</p>
{% if not MG_DISABLE_SUMMARY %}<p>{{ ' '.join(article.content.split(' ')[:SUMMARY_MAX_LENGTH ])|striptags|striptags }}...</p>{% endif %} {% if not MG_DISABLE_SUMMARY %}<p>{{ ' '.join(article.content.split(' ')[:SUMMARY_MAX_LENGTH ])|striptags|striptags }}...</p>{% endif %}
<a href="{{ SITEURL }}/{{ article.url }}">Read More</a> <a href="{{ SITEURL }}/{{ article.url }}">Read More</a>
{% set bullet = joiner(" &bullet; ") %} {% include "partials/inline-tags.html" %}
<div align="right" title="Tags">{% for tag in article.tags %}{{bullet()}}<a class="mg-tag" href="{{tag.url}}"><i class="uk-icon-tag"></i>{{tag.name}}</a>{% endfor %}</div>
<hr class="uk-article-divider"> <hr class="uk-article-divider">
</article> </article>

View File

@ -0,0 +1,3 @@
{% set bullet = joiner(" &bullet; ") %}
<div align="right" title="Tags">{% for tag in article.tags %}{{bullet()}}<a class="mg-tag" href="{{tag.url}}"><i class="uk-icon-tag"></i>&nbsp;{{tag.name}}</a>{% endfor %}</div>

24
templates/tag.html Normal file
View File

@ -0,0 +1,24 @@
{% extends "base.html" %}
{% block content_title %}{% endblock %}
{% block content %}
<div class="uk-width-medium-4-5">
{% if articles %}
{% for article in (articles_page.object_list if articles_page else articles) %}
{% include "partials/article-short.html" %}
{% endfor %}
{% if DEFAULT_PAGINATION and articles_paginator.num_pages > 1 %}
<ul class="uk-pagination">
{% if articles_previous_page %}<li><a href="{{ SITEURL }}/{{ articles_previous_page.url }}"><i class="uk-icon-angle-double-left"></i></a></li>{% endif %}
{% if articles_previous_page %}<li><a href="{{ SITEURL }}/{{ articles_previous_page.url }}">{{ articles_previous_page.number }}</a></li>{% endif %}
<li class="uk-active"><span>{{ articles_page.number }}</span></li>
{% if articles_next_page %}<li><a href="{{ SITEURL }}/{{ articles_next_page.url }}"><i class="uk-icon-angle-double-right"></i></a></li>{% endif %}
{% if articles_next_page %}<li><a href="{{ SITEURL }}/{{ articles_next_page.url }}">{{ articles_next_page.number }}</a></li>{% endif %}
</ul>
{% endif %}
{% endif %}
</div>
{% endblock %}