From 484a5ad227f1a95cb1191867847fe43c65325c79 Mon Sep 17 00:00:00 2001 From: Lucas Cimon Date: Wed, 9 Aug 2017 02:52:31 +0200 Subject: [PATCH] Refacto + adding missing trmplate --- static/css/main.css | 3 +++ templates/article.html | 3 +-- templates/partials/article-excerpt.html | 3 +-- templates/partials/article-short.html | 3 +-- templates/partials/inline-tags.html | 3 +++ templates/tag.html | 24 ++++++++++++++++++++++++ 6 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 templates/partials/inline-tags.html create mode 100644 templates/tag.html diff --git a/static/css/main.css b/static/css/main.css index 2c90b34..e327bcd 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -113,10 +113,13 @@ a { .mg-tag { margin: 0 .5rem; + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; color: #FF6600; } .mg-tag:hover { text-decoration: none; color: #FF6600; } + .mg-tag > .uk-icon-tag { + margin-right: .2rem; } .mg-list-title { font-size: 2em; diff --git a/templates/article.html b/templates/article.html index 7c3a0af..671c512 100644 --- a/templates/article.html +++ b/templates/article.html @@ -74,8 +74,7 @@ {% if not MG_DISABLE_SUMMARY %}

{{ article.summary|striptags }}

{% endif %}
{{ article.content }}
- {% set bullet = joiner(" • ") %} -
{% for tag in article.tags %}{{bullet()}}{{tag.name}}{% endfor %}
+ {% include "partials/inline-tags.html" %}
diff --git a/templates/partials/article-excerpt.html b/templates/partials/article-excerpt.html index 04d2d33..c81903d 100644 --- a/templates/partials/article-excerpt.html +++ b/templates/partials/article-excerpt.html @@ -3,8 +3,7 @@

{{ article.category }}{% if DISQUS_SITENAME %} •
{% endif %}

{% if not MG_DISABLE_SUMMARY %}

{{ article.summary|striptags|striptags }}

{% endif %}
{{ article.content }}
- {% set bullet = joiner(" • ") %} -
{% for tag in article.tags %}{{bullet()}}{{tag.name}}{% endfor %}
+ {% include "partials/inline-tags.html" %}
diff --git a/templates/partials/article-short.html b/templates/partials/article-short.html index b1b5a6b..a8ce996 100644 --- a/templates/partials/article-short.html +++ b/templates/partials/article-short.html @@ -5,8 +5,7 @@

{{ article.summary|striptags|striptags }}

{% if not MG_DISABLE_SUMMARY %}

{{ ' '.join(article.content.split(' ')[:SUMMARY_MAX_LENGTH ])|striptags|striptags }}...

{% endif %} Read More - {% set bullet = joiner(" • ") %} -
{% for tag in article.tags %}{{bullet()}}{{tag.name}}{% endfor %}
+ {% include "partials/inline-tags.html" %}
diff --git a/templates/partials/inline-tags.html b/templates/partials/inline-tags.html new file mode 100644 index 0000000..62fd5d8 --- /dev/null +++ b/templates/partials/inline-tags.html @@ -0,0 +1,3 @@ +{% set bullet = joiner(" • ") %} +
{% for tag in article.tags %}{{bullet()}} {{tag.name}}{% endfor %}
+ diff --git a/templates/tag.html b/templates/tag.html new file mode 100644 index 0000000..2269593 --- /dev/null +++ b/templates/tag.html @@ -0,0 +1,24 @@ +{% extends "base.html" %} +{% block content_title %}{% endblock %} +{% block content %} +
+ +{% 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 %} + +{% endif %} + +{% endif %} +
+{% endblock %}