A template fix to show the EXIF DateTimeOriginal (as creation date). Added as a configurable option 'original_date_visible' (default false). Since the EXIF tag is a string with the date formatted as 'YYYY:MM:DD HH:MM:SS' the fix slices the string to give only the date and then replaces : by - to conform with the 'Added on' date.

This commit is contained in:
Tryggvi Björgvinsson 2012-11-08 00:14:17 +00:00
parent 52aef5b445
commit 24d310e46f
2 changed files with 9 additions and 0 deletions

View File

@ -58,6 +58,7 @@ csrf_cookie_name = string(default='mediagoblin_csrftoken')
push_urls = string_list(default=list())
exif_visible = boolean(default=False)
original_date_visible = boolean(default=False)
geolocation_map_visible = boolean(default=False)
# Theming stuff

View File

@ -153,6 +153,14 @@
<h3>Added on</h3>
<p>{{ date }}</p>
{%- endtrans %}
{% if app_config['original_date_visible']
and media.media_data.exif_all is defined
and 'EXIF DateTimeOriginal' in media.media_data.exif_all %}
{% trans date=media.media_data.exif_all['EXIF DateTimeOriginal']['printable'][:10].replace(':','-') -%}
<h3>Created on</h3>
<p>{{ date }}</p>
{%- endtrans %}
{% endif %}
{% if media.tags %}
{% include "mediagoblin/utils/tags.html" %}
{% endif %}