fixed format of <date datetime""> output.

This commit is contained in:
2018-12-30 11:22:17 +01:00
parent e792da7459
commit 12930c2ec6
2 changed files with 31 additions and 36 deletions

View File

@@ -69,7 +69,7 @@
<h3><a href="{{article.get_absolute_url}}">{{article.headline}}</a></h3> <h3><a href="{{article.get_absolute_url}}">{{article.headline}}</a></h3>
<ul class="info"> <ul class="info">
<li><span class="fa fa-calendar-o" title="{% trans 'created on' %}"></span> <time <li><span class="fa fa-calendar-o" title="{% trans 'created on' %}"></span> <time
datetime="{{article.date_created|date:'c'}}">{{ article.date_created|date }}</time></li> datetime="{{article.date_created|date:'Y-m-d\TH:i:sO'}}">{{ article.date_created|date }}</time></li>
<li><span class="fa fa-user" title="{% trans 'by' %}"></span> {{ article.author }}</li> <li><span class="fa fa-user" title="{% trans 'by' %}"></span> {{ article.author }}</li>
<li><span class="fa fa-comments" title="{% trans 'comments' %}"></span> <a <li><span class="fa fa-comments" title="{% trans 'comments' %}"></span> <a
href="{{article.get_absolute_url}}#comments" >{{comment_count}} {% trans "comments" %}</a></li> href="{{article.get_absolute_url}}#comments" >{{comment_count}} {% trans "comments" %}</a></li>

View File

@@ -1,53 +1,48 @@
{% extends "base.html" %} {% extends "base.html" %}{% load i18n comments thumbnail %}
{% load i18n comments thumbnail %}
{% block title %}{{ article.headline }}{% endblock %} {% block title %}{{ article.headline }}{% endblock %}
{% block description %}{{article.content|striptags|truncatewords:16}}{% endblock %} {% block description %}{{article.content|striptags|truncatewords:16}}{% endblock %}
{% block opengraph %} {% block opengraph %}
<meta property="og:type" content="article" /> <meta property="og:type" content="article"/>
<meta property="og:title" content="{{ article.headline|force_escape }}" /> <meta property="og:title" content="{{ article.headline|force_escape }}"/>
<meta property="og:url" content="http://www.kasu.at{{ article.get_absolute_url }}" /> <meta property="og:url" content="http://www.kasu.at{{ article.get_absolute_url }}"/>
<meta property="og:image" content="http://www.kasu.at{{article.get_image|thumbnail_url:'article'}}" /> <meta property="og:image" content="http://www.kasu.at{{article.get_image|thumbnail_url:'article'}}"/>
<meta property="og:description" content="{{article.content|striptags|truncatewords:25|force_escape}}" /> <meta property="og:description" content="{{article.content|striptags|truncatewords:25|force_escape}}"/>
<link rel="image_src" type="image/jpeg" href="{{article.get_image|thumbnail_url:'article'}}" /> <link rel="image_src" type="image/jpeg" href="{{article.get_image|thumbnail_url:'article'}}"/>{% endblock %}
{% endblock %}
{% block itemscope %}itemscope itemtype="http://schema.org/Article"{% endblock %} {% block itemscope %}itemscope itemtype="http://schema.org/Article"{% endblock %}
{% block teaser %} {% block teaser %}
<h1 itemprop="name">{{article.headline}}</h1> <h1 itemprop="name">{{article.headline}}</h1>
<div id="teaser_text"> <div id="teaser_text">
<ul class="info"> <ul class="info">
<li><span class="fa fa-user"></span> <strong>{% trans 'Author' %}:</strong> <a href="{% url 'membership-details' article.author %}" itemprop="author">{{article.author}}</a></li> <li><span class="fa fa-user"></span> <strong>{% trans 'Author' %}:</strong>
<li><span class="fa fa-calendar-o"></span> <strong>{% trans 'Created on' %}: </strong><time datetime="{{article.date_created|date:'Y-m-d H:i'}}">{{ article.date_created|date:'DATE_FORMAT' }}</time></li> <a href="{% url 'membership-details' article.author %}" itemprop="author">{{article.author}}</a>
<li><span class="fa fa-tag"></span> <strong>{% trans "Category"%}: </strong><a href="{{ article.category.get_absolute_url }}" itemprop="articleSection">{{article.category.name}}</a></li> </li>
</ul> <li><span class="fa fa-calendar-o"></span>
</div> <strong>{% trans 'Created on' %}:</strong>
{% endblock %} <time datetime="{{article.date_created|date:'Y-m-d\TH:i:sO'}}">{{ article.date_created|date:'DATE_FORMAT' }}</time>
</li>
<li><span class="fa fa-tag"></span> <strong>{% trans "Category"%}:</strong>
<a href="{{ article.category.get_absolute_url }}" itemprop="articleSection">{{article.category.name}}</a>
</li>
</ul>
</div>{% endblock %}
{% block maincontent %} {% block maincontent %}
<div itemprop="articleBody" class="grid_12"> <div itemprop="articleBody" class="grid_12">
<img alt="{{article.category.name}}" src="{{article.get_image|thumbnail_url:'article'}}" class="posting_image" itemprop="image"/> <img alt="{{article.category.name}}" src="{{article.get_image|thumbnail_url:'article'}}" class="posting_image" itemprop="image"/> {{ article.content }}
{{ article.content }}
</div> </div>
<p class="right"> <p class="right">
<strong>{% trans 'share on' %}:</strong> <strong>{% trans 'share on' %}:</strong>
<a class="button" href="https://plus.google.com/share?url=http%3A%2F%2Fwww.kasu.at{{article.get_absolute_url|urlencode}}" <a class="button" href="https://plus.google.com/share?url=http%3A%2F%2Fwww.kasu.at{{article.get_absolute_url|urlencode}}" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><span class="fa fa-google-plus"></span> Google+</a>
onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><span class="fa fa-google-plus"></span> Google+</a> <a class="button" href="https://twitter.com/share?url=http%3A%2F%2Fwww.kasu.at{{article.get_absolute_url|urlencode}}" target='_blank'><span class="fa fa-twitter"></span> Twitter</a>
<a class="button" href="https://twitter.com/share?url=http%3A%2F%2Fwww.kasu.at{{article.get_absolute_url|urlencode}}" target='_blank'><span class="fa fa-twitter"></span> Twitter</a> <a class="button" href="http://facebook.com/sharer.php?u=http%3A%2F%2Fwww.kasu.at{{article.get_absolute_url|urlencode}}?t={{article.headline|urlencode}}" target="_blank"><span class="fa fa-facebook"></span> Facebook</a>
<a class="button" href="http://facebook.com/sharer.php?u=http%3A%2F%2Fwww.kasu.at{{article.get_absolute_url|urlencode}}?t={{article.headline|urlencode}}" target="_blank"><span class="fa fa-facebook"></span> Facebook</a> </p>{% endblock %}
</p>
{% endblock %}
{% block comments%} {% block comments%}{% render_comment_list for article %}{% render_comment_form for article %}{% endblock %}
{% render_comment_list for article %}
{% render_comment_form for article %}
{% endblock %}
{% block buttonbar %} {% block buttonbar %}{% if perms.content.change_article %}
{% if perms.content.change_article %} <a href="{% url 'edit-article' article.id %}" class="button"><span class="fa fa-pencil"></span> {% trans "Edit Article" %}</a>{% endif %}{% endblock %}
<a href="{% url 'edit-article' article.id %}" class="button"><span class="fa fa-pencil"></span> {% trans "Edit Article" %}</a>
{% endif %}
{% endblock %}