blog-markdown #31
|
@ -1,4 +1,5 @@
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
{% load helper_tags %}
|
||||||
{% get_current_language as LANGUAGE_CODE %}
|
{% get_current_language as LANGUAGE_CODE %}
|
||||||
<div class="container-lg mt-5">
|
<div class="container-lg mt-5">
|
||||||
<h4 class="">{% trans "Featured" %}</h4>
|
<h4 class="">{% trans "Featured" %}</h4>
|
||||||
|
@ -45,6 +46,12 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="container p-1 text-center" style="border-top: solid">
|
||||||
|
<li class="list-group-item">
|
||||||
|
{% format_time post.date "%F" as date %}
|
||||||
|
{% trans "published" %}: {{ date }}
|
||||||
|
</li>
|
||||||
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -11,8 +11,8 @@ logger = logging.getLogger(__name__)
|
||||||
register = Library()
|
register = Library()
|
||||||
|
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
def format_time(timestamp: datetime) -> str:
|
def format_time(timestamp: datetime, format: str = "%F %H:%M:%S") -> str:
|
||||||
return timestamp.strftime("%F %H:%M:%S")
|
return timestamp.strftime(format)
|
||||||
|
|
||||||
@register.simple_tag(takes_context=True)
|
@register.simple_tag(takes_context=True)
|
||||||
def change_lang(context, lang="de", *args, **kwargs):
|
def change_lang(context, lang="de", *args, **kwargs):
|
||||||
|
|
Loading…
Reference in New Issue