--- /dev/null
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+def rebuild_extra_info(apps, schema_editor):
+ Picture = apps.get_model("picture", "Picture")
+ from librarian.picture import PictureInfo
+ from librarian import dcparser
+ for pic in Picture.objects.all():
+ info = dcparser.parse(pic.xml_file.path, PictureInfo)
+ pic.extra_info = info.to_dict()
+ pic.save()
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('picture', '0004_auto_20141016_1337'),
+ ]
+
+ operations = [
+ migrations.RunPython(rebuild_extra_info),
+ ]
{% endfor %}
</span></span>
+ {% block extra_categories %}
+ {% endblock %}
+
{% endspaceless %}
</div>
</div>
{% endblock %}
+{% block extra_categories %}
+{% if picture.extra_info.styles %}
+<span class="category">
+<span class="mono"> {% trans "Style" %}:</span> <span class="book-box-tag">
+ {% for tag in picture.extra_info.styles %}
+ <a>{{ tag }}</a>
+ {% if not forloop.last %}<span>, </span>{% endif %}
+ {% endfor %}
+</span></span>
+{% endif %}
+
+{% if picture.extra_info.medium %}
+<span class="category">
+<span class="mono"> {% trans "Medium" %}:</span> <span class="book-box-tag">
+ <a>{{ picture.extra_info.medium }}</a>
+</span></span>
+{% endif %}
+
+{% if picture.extra_info.original_dimensions %}
+<span class="category">
+<span class="mono"> {% trans "Dimensions" %}:</span> <span class="book-box-tag">
+ <a>{{ picture.extra_info.original_dimensions }}</a>
+</span></span>
+{% endif %}
+
+<span class="category">
+<span class="mono"> {% trans "Date" %}:</span> <span class="book-box-tag">
+ <a>{{ picture.extra_info.created_at }}</a>
+</span></span>
+
+{% endblock %}
+
+
{% block book-box-extra-info %}
{% if themes or things%}
<div class="hidden-box-wrapper" id="theme-list-wrapper">
-Subproject commit a3b6840527ec52ce8b6d74819633d8c85e3973ba
+Subproject commit a04f11baee3eb7d090867c2d5639a120ec3217b8