Fixing bug where non-image types might break if app_config['original_date_visible'] is true
Not all media managers have the .get_original_date attribute, so of course break. This is fixed by making a new space where individual media types can define this if they like. This commit sponsored by Matthieu Dupont de Dinechin. Thank you!
This commit is contained in:
parent
f9e032212d
commit
ab4cbb103e
@ -27,3 +27,20 @@
|
||||
{{ super() }}
|
||||
{% template_hook("image_sideinfo") %}
|
||||
{% endblock %}
|
||||
|
||||
{% block mediagoblin_after_added_sidebar %}
|
||||
{% if app_config['original_date_visible'] %}
|
||||
{% set original_date = media.media_manager.get_original_date() %}
|
||||
|
||||
{% if original_date %}
|
||||
<h3>{% trans %}Created{% endtrans %}</h3>
|
||||
|
||||
<p><span title="{{ original_date.strftime("%I:%M%p %Y-%m-%d") }}">
|
||||
{%- trans formatted_time=timesince(original_date) -%}
|
||||
{{ formatted_time }} ago
|
||||
{%- endtrans -%}
|
||||
</span></p>
|
||||
{%- endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -154,19 +154,8 @@
|
||||
{%- endtrans -%}
|
||||
</span></p>
|
||||
|
||||
{% if app_config['original_date_visible'] %}
|
||||
{% set original_date = media.media_manager.get_original_date() %}
|
||||
|
||||
{% if original_date %}
|
||||
<h3>{% trans %}Created{% endtrans %}</h3>
|
||||
|
||||
<p><span title="{{ original_date.strftime("%I:%M%p %Y-%m-%d") }}">
|
||||
{%- trans formatted_time=timesince(original_date) -%}
|
||||
{{ formatted_time }} ago
|
||||
{%- endtrans -%}
|
||||
</span></p>
|
||||
{%- endif %}
|
||||
{% endif %}
|
||||
{% block mediagoblin_after_added_sidebar %}
|
||||
{% endblock %}
|
||||
|
||||
{% if media.tags %}
|
||||
{% include "mediagoblin/utils/tags.html" %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user