diff options
author | Tryggvi Björgvinsson <tryggvib@fsfi.is> | 2012-11-08 00:14:17 +0000 |
---|---|---|
committer | Tryggvi Björgvinsson <tryggvib@fsfi.is> | 2012-11-08 00:14:17 +0000 |
commit | 24d310e46fc237eccfc7859ae273ddaaf04e2fbc (patch) | |
tree | 4b782054a1e663a67029f511639c8ff706e0dfd5 | |
parent | 52aef5b445710dbe800ebba7f44ca0cc0e06ea54 (diff) | |
download | mediagoblin-24d310e46fc237eccfc7859ae273ddaaf04e2fbc.tar.lz mediagoblin-24d310e46fc237eccfc7859ae273ddaaf04e2fbc.tar.xz mediagoblin-24d310e46fc237eccfc7859ae273ddaaf04e2fbc.zip |
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.
-rw-r--r-- | mediagoblin/config_spec.ini | 1 | ||||
-rw-r--r-- | mediagoblin/templates/mediagoblin/user_pages/media.html | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/mediagoblin/config_spec.ini b/mediagoblin/config_spec.ini index 17df2819..7b56f768 100644 --- a/mediagoblin/config_spec.ini +++ b/mediagoblin/config_spec.ini @@ -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 diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index ac15dd2f..5932174d 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -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 %} |