# HG changeset patch # User cavaliet # Date 1372950933 -7200 # Node ID a5db4e28a51791ca6b39ff3d5b7b2434a9e1981c # Parent d0bec23268b0d82806bc7abd378d7e87b1472ef7 debug slideshow and version number to 0.6.8 diff -r d0bec23268b0 -r a5db4e28a517 src/egonomy/__init__.py --- a/src/egonomy/__init__.py Thu Jul 04 16:08:50 2013 +0200 +++ b/src/egonomy/__init__.py Thu Jul 04 17:15:33 2013 +0200 @@ -1,4 +1,4 @@ -VERSION = (0, 6, 7, "final", 1) +VERSION = (0, 6, 8, "final", 1) VERSION_STR = unicode(".".join(map(lambda i:"%02d" % (i,), VERSION[:2]))) diff -r d0bec23268b0 -r a5db4e28a517 src/egonomy/templates/egonomy_embed_slideshow.html --- a/src/egonomy/templates/egonomy_embed_slideshow.html Thu Jul 04 16:08:50 2013 +0200 +++ b/src/egonomy/templates/egonomy_embed_slideshow.html Thu Jul 04 17:15:33 2013 +0200 @@ -48,36 +48,8 @@ \ No newline at end of file diff -r d0bec23268b0 -r a5db4e28a517 src/egonomy/views.py --- a/src/egonomy/views.py Thu Jul 04 16:08:50 2013 +0200 +++ b/src/egonomy/views.py Thu Jul 04 17:15:33 2013 +0200 @@ -599,8 +599,28 @@ items = CollectionItem.objects.filter(collection=col).select_related('author', 'content_type', 'object_id', 'content_object').order_by("order") cache_generics(items) + slides = [] + for item in items: + if item.content_type.model == "fragment": + fragment = item.content_object + slides.append({"type":"fragment", + "title": fragment.title, + "author": str(fragment.author), + "src": fragment.image.info.image_file.url, + "path": fragment.coordinates, + "description": item.description + }) + elif item.content_type.model == "image": + image = item.content_object + slides.append({"type":"image", + "title": image.metadata.titre or _('No title'), + "author": image.metadata.auteur or "", + "src": image.info.image_file.url, + "description": item.description + }) + return render_to_response("egonomy_embed_slideshow.html", - {'col':col, 'items':items}, + {'col':col, 'items':items, "slides":json.dumps(slides)}, context_instance=RequestContext(request))