Add datetime_format config option.
Moves the datetime_format used in various places to the config and allows a global override per site. Signed-off-by: Ben Sturmfels <ben@sturm.com.au>
This commit is contained in:
parent
e01fab9333
commit
d269b1a839
@ -92,6 +92,9 @@ no_referrer = boolean(default=True)
|
|||||||
# Push stuff
|
# Push stuff
|
||||||
push_urls = string_list(default=list())
|
push_urls = string_list(default=list())
|
||||||
|
|
||||||
|
# Python strftime's format [0]
|
||||||
|
# https://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||||
|
datetime_format = string(default="%I:%M%p %Y-%m-%d")
|
||||||
exif_visible = boolean(default=False)
|
exif_visible = boolean(default=False)
|
||||||
original_date_visible = boolean(default=False)
|
original_date_visible = boolean(default=False)
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
user=comment_target.get_actor.username,
|
user=comment_target.get_actor.username,
|
||||||
media=comment_target.slug_or_id) }}#comment"
|
media=comment_target.slug_or_id) }}#comment"
|
||||||
class="comment_whenlink">
|
class="comment_whenlink">
|
||||||
<span title='{{- comment_object.created.strftime("%I:%M%p %Y-%m-%d") -}}'>
|
<span title='{{- comment_object.created.strftime(app_config['datetime_format']) -}}'>
|
||||||
{%- trans formatted_time=timesince(comment_object.created) -%}
|
{%- trans formatted_time=timesince(comment_object.created) -%}
|
||||||
{{ formatted_time }} ago
|
{{ formatted_time }} ago
|
||||||
{%- endtrans -%}
|
{%- endtrans -%}
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
{% if original_date %}
|
{% if original_date %}
|
||||||
<h3>{% trans %}Created{% endtrans %}</h3>
|
<h3>{% trans %}Created{% endtrans %}</h3>
|
||||||
|
|
||||||
<p><span title="{{ original_date.strftime("%I:%M%p %Y-%m-%d") }}">
|
<p><span title="{{ original_date.strftime(app_config['datetime_format']) }}">
|
||||||
{%- trans formatted_time=timesince(original_date) -%}
|
{%- trans formatted_time=timesince(original_date) -%}
|
||||||
{{ formatted_time }} ago
|
{{ formatted_time }} ago
|
||||||
{%- endtrans -%}
|
{%- endtrans -%}
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
user=target.get_actor.username,
|
user=target.get_actor.username,
|
||||||
media=target.slug_or_id) }}#comment"
|
media=target.slug_or_id) }}#comment"
|
||||||
class="comment_whenlink">
|
class="comment_whenlink">
|
||||||
<span title='{{- comment.created.strftime("%I:%M%p %Y-%m-%d") -}}'>
|
<span title='{{- comment.created.strftime(app_config['datetime_format']) -}}'>
|
||||||
{%- trans formatted_time=timesince(comment.created) -%}
|
{%- trans formatted_time=timesince(comment.created) -%}
|
||||||
{{ formatted_time }} ago
|
{{ formatted_time }} ago
|
||||||
{%- endtrans -%}
|
{%- endtrans -%}
|
||||||
@ -117,7 +117,7 @@
|
|||||||
<a href="{{ request.urlgen('mediagoblin.moderation.reports_detail',
|
<a href="{{ request.urlgen('mediagoblin.moderation.reports_detail',
|
||||||
report_id=report.id) }}"
|
report_id=report.id) }}"
|
||||||
class="report_whenlink">
|
class="report_whenlink">
|
||||||
<span title='{{- report.created.strftime("%I:%M%p %Y-%m-%d") -}}'>
|
<span title='{{- report.created.strftime(app_config['datetime_format']) -}}'>
|
||||||
{%- trans formatted_time=timesince(report.created) -%}
|
{%- trans formatted_time=timesince(report.created) -%}
|
||||||
{{ formatted_time }} ago
|
{{ formatted_time }} ago
|
||||||
{%- endtrans -%}
|
{%- endtrans -%}
|
||||||
@ -150,7 +150,7 @@
|
|||||||
{% trans %}Status{% endtrans %}:
|
{% trans %}Status{% endtrans %}:
|
||||||
</h2>
|
</h2>
|
||||||
<b>{% trans %}RESOLVED{% endtrans %}</b>
|
<b>{% trans %}RESOLVED{% endtrans %}</b>
|
||||||
{{ report.resolved.strftime("%I:%M%p %Y-%m-%d") }}
|
{{ report.resolved.strftime(app_config['datetime_format']) }}
|
||||||
<pre>
|
<pre>
|
||||||
<p>{{ report.result }}</p>
|
<p>{{ report.result }}</p>
|
||||||
</pre>
|
</pre>
|
||||||
|
@ -128,7 +128,7 @@
|
|||||||
user=media.get_actor.username,
|
user=media.get_actor.username,
|
||||||
media=media.slug_or_id) }}#comment"
|
media=media.slug_or_id) }}#comment"
|
||||||
class="comment_whenlink">
|
class="comment_whenlink">
|
||||||
<span title='{{- comment_object.created.strftime("%I:%M%p %Y-%m-%d") -}}'>
|
<span title='{{- comment_object.created.strftime(app_config['datetime_format']) -}}'>
|
||||||
{%- trans formatted_time=timesince(comment_object.created) -%}
|
{%- trans formatted_time=timesince(comment_object.created) -%}
|
||||||
{{ formatted_time }} ago
|
{{ formatted_time }} ago
|
||||||
{%- endtrans -%}
|
{%- endtrans -%}
|
||||||
@ -148,7 +148,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="media_sidebar">
|
<div class="media_sidebar">
|
||||||
<h3>{% trans %}Added{% endtrans %}</h3>
|
<h3>{% trans %}Added{% endtrans %}</h3>
|
||||||
<p><span title="{{ media.created.strftime("%I:%M%p %Y-%m-%d") }}">
|
<p><span title="{{ media.created.strftime(app_config['datetime_format']) }}">
|
||||||
{%- trans formatted_time=timesince(media.created) -%}
|
{%- trans formatted_time=timesince(media.created) -%}
|
||||||
{{ formatted_time }} ago
|
{{ formatted_time }} ago
|
||||||
{%- endtrans -%}
|
{%- endtrans -%}
|
||||||
|
@ -148,7 +148,7 @@
|
|||||||
user=media.get_actor.username,
|
user=media.get_actor.username,
|
||||||
media=media.slug_or_id) }}#comment"
|
media=media.slug_or_id) }}#comment"
|
||||||
class="comment_whenlink">
|
class="comment_whenlink">
|
||||||
<span title='{{- comment_object.created.strftime("%I:%M%p %Y-%m-%d") -}}'>
|
<span title='{{- comment_object.created.strftime(app_config['datetime_format']) -}}'>
|
||||||
{%- trans formatted_time=timesince(comment_object.created) -%}
|
{%- trans formatted_time=timesince(comment_object.created) -%}
|
||||||
{{ formatted_time }} ago
|
{{ formatted_time }} ago
|
||||||
{%- endtrans -%}
|
{%- endtrans -%}
|
||||||
@ -183,7 +183,7 @@
|
|||||||
|
|
||||||
<div class="five columns media_sidebar">
|
<div class="five columns media_sidebar">
|
||||||
<h3>{% trans %}Added{% endtrans %}</h3>
|
<h3>{% trans %}Added{% endtrans %}</h3>
|
||||||
<p><span title="{{ media.created.strftime("%I:%M%p %Y-%m-%d") }}">
|
<p><span title="{{ media.created.strftime(app_config['datetime_format']) }}">
|
||||||
{%- trans formatted_time=timesince(media.created) -%}
|
{%- trans formatted_time=timesince(media.created) -%}
|
||||||
{{ formatted_time }} ago
|
{{ formatted_time }} ago
|
||||||
{%- endtrans -%}
|
{%- endtrans -%}
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
user=media.get_actor.username,
|
user=media.get_actor.username,
|
||||||
media=media.slug_or_id) }}#comment"
|
media=media.slug_or_id) }}#comment"
|
||||||
class="comment_whenlink">
|
class="comment_whenlink">
|
||||||
<span title='{{- comment_object.created.strftime("%I:%M%p %Y-%m-%d") -}}'>
|
<span title='{{- comment_object.created.strftime(app_config['datetime_format']) -}}'>
|
||||||
{%- trans formatted_time=timesince(comment_object.created) -%}
|
{%- trans formatted_time=timesince(comment_object.created) -%}
|
||||||
{{ formatted_time }} ago
|
{{ formatted_time }} ago
|
||||||
{%- endtrans -%}
|
{%- endtrans -%}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user