# HG changeset patch # User cavaliet # Date 1362070587 -3600 # Node ID 67d3fb0e54a68106f778ad005ff536f3e9c0371a # Parent 48296e8d046ad47d122c6da97a608539f7e125f5 enhance view fragment with new svg display diff -r 48296e8d046a -r 67d3fb0e54a6 src/egonomy/static/egonomy/css/egonomy.css --- a/src/egonomy/static/egonomy/css/egonomy.css Wed Feb 27 18:59:14 2013 +0100 +++ b/src/egonomy/static/egonomy/css/egonomy.css Thu Feb 28 17:56:27 2013 +0100 @@ -246,6 +246,10 @@ height: 110px; width: 110px; } +.large_square_fragment { + height: 476px; width: 476px; +} + .center-image img { display: inline-block; } diff -r 48296e8d046a -r 67d3fb0e54a6 src/egonomy/templates/egonomy_view_fragment.html --- a/src/egonomy/templates/egonomy_view_fragment.html Wed Feb 27 18:59:14 2013 +0100 +++ b/src/egonomy/templates/egonomy_view_fragment.html Thu Feb 28 17:56:27 2013 +0100 @@ -11,6 +11,33 @@

{{ fragment.title }}

+ {% if fragment_only %} +
+ {% with fragment.image.info.image_file as image %} + {% if image %} + + + + + + + + + + {% else %} + + + + + + + + + + {% endif %} + {% endwith %} +
+ {% else %}
{% with fragment.image.info.image_file as image %} {% if image|ratio > 0.8 %} @@ -37,7 +64,7 @@ {% endthumbnail %} {% else %} {% thumbnail image "x600" format="PNG" crop="center" as im %} - + @@ -62,6 +89,7 @@
+ {% endif %}
@@ -94,6 +122,93 @@
{% trans "Create a fragment" %}
+
+ {% if fragment_only %} + + {% trans "See the fragment in its full picture" %} :
+
+ {% with fragment.image.info.image_file as image %} + {% if image|is_portrait %} + {% thumbnail image "110" format="PNG" crop="center" as im %} + + + + + + + + + + {% empty %} + + + + + + + + + + {% endthumbnail %} + {% else %} + {% thumbnail image "x110" format="PNG" crop="center" as im %} + + + + + + + + + {% empty %} + + + + + + + + + + {% endthumbnail %} + {% endif %} + {% endwith %} + +
+
+ {% else %} + + {% trans "See the fragment only" %} :
+
+ {% with image=fragment.image.info.image_file %} + {% if image %} + + + + + + + + + + {% else %} + + + + + + + + + + {% endif %} + {% endwith %} +
+
+ {% endif %} +
diff -r 48296e8d046a -r 67d3fb0e54a6 src/egonomy/views.py --- a/src/egonomy/views.py Wed Feb 27 18:59:14 2013 +0100 +++ b/src/egonomy/views.py Thu Feb 28 17:56:27 2013 +0100 @@ -51,8 +51,10 @@ frg = get_object_or_404(Fragment.objects.select_related('image', 'image__info', 'image__metadata','author'), pk=fragment_pk) frg_list = Fragment.objects.filter(image=frg.image).select_related('image', 'image__info', 'image__metadata','author') + fragment_only = {'true': True, 'false': False, "0": False, "1": True}.get((request.GET.get("fragment_only") or "1").lower()) + return render_to_response("egonomy_view_fragment.html", - {'fragment': frg, 'fragment_list': frg_list}, + {'fragment': frg, 'fragment_list': frg_list, 'fragment_only':fragment_only}, context_instance=RequestContext(request)) @login_required