collection available in list and mosaic
authorcavaliet
Thu, 27 Jun 2013 15:42:46 +0200
changeset 175 8f6eef1d1fc8
parent 174 6d37a4bd893a
child 178 962fb2da996c
collection available in list and mosaic
src/egonomy/models.py
src/egonomy/static/egonomy/css/style.css
src/egonomy/templates/egonomy_annotate_picture.html
src/egonomy/templates/egonomy_create_fragment.html
src/egonomy/templates/egonomy_view_collection.html
src/egonomy/templates/partial/item_in_collection_list.html
src/egonomy/templates/partial/item_in_collection_mosaic.html
--- a/src/egonomy/models.py	Thu Jun 27 15:37:29 2013 +0200
+++ b/src/egonomy/models.py	Thu Jun 27 15:42:46 2013 +0200
@@ -57,7 +57,7 @@
         return self.thesaurus_pertimm.replace("|", ",").split(",")
     
     @property
-    def tags(self):
+    def tag_list(self):
         # all keywords mots_cles + titre_pertimm+ description_pertimm + thesaurus_pertimmreturn
         # merged into one sorted list
         moc = self.mots_cles.split(",")
@@ -84,6 +84,10 @@
     id = models.CharField(null=False, blank=False, max_length=15, primary_key=True)
     metadata = models.ForeignKey(ImageMetadata)
     info = models.ForeignKey(ImageInfo, null=True, blank=True)
+    
+    @property
+    def tag_list(self):
+        return self.metadata.tag_list
 
     
 class Fragment(models.Model):
--- a/src/egonomy/static/egonomy/css/style.css	Thu Jun 27 15:37:29 2013 +0200
+++ b/src/egonomy/static/egonomy/css/style.css	Thu Jun 27 15:42:46 2013 +0200
@@ -206,7 +206,7 @@
 .box-edition h3{color: #777;font-family: 'Lato'; font-size: 14px; margin-bottom: 6px;}
 
 .list-key-search a{ background-image: url(../img/icon-search.png);}
-.list-key-add a{ background-image: url(../img/icon-plus-15.png);}
+.list-key-add a{background-image: url(../img/icons-15.png); background-position: right 6px top -53px !important; }
 
 .list-keywords li{display: inline-block; float: left; margin: 0 8px 8px 0;}
 .list-keywords a{color: #7F7F7F; font-family: 'Lato'; font-size: 12px; display: inline-block; height: 28px; line-height: 28px; padding: 0 30px 0 6px;
@@ -270,6 +270,10 @@
     height: 110px;
     width: 110px;
 }
+.square-fragment-177 {
+    height: 177px;
+    width: 177px;
+}
 .square-fragment-225 {
     height: 225px;
     width: 225px;
--- a/src/egonomy/templates/egonomy_annotate_picture.html	Thu Jun 27 15:37:29 2013 +0200
+++ b/src/egonomy/templates/egonomy_annotate_picture.html	Thu Jun 27 15:42:46 2013 +0200
@@ -93,7 +93,7 @@
                 <div class="box-edition">
                     <h3>{% trans "Keywords" %} :</h3>
                     <ul class="list-key-search list-keywords clearfix">
-                        {% for t in img.metadata.tags %}
+                        {% for t in img.metadata.tag_list %}
                         {% if t != "" %}<li><a class="box-shadow-2" href="#">{{ t }}</a></li>{% endif %}
                         {% endfor %}
                     </ul>
--- a/src/egonomy/templates/egonomy_create_fragment.html	Thu Jun 27 15:37:29 2013 +0200
+++ b/src/egonomy/templates/egonomy_create_fragment.html	Thu Jun 27 15:42:46 2013 +0200
@@ -101,7 +101,7 @@
 	                        <th class="pt-6 va-top">{% trans "Source picture's keywords" %}&nbsp;:</th>
 	                        <td class="pt-6">
 	                            <ul class="list-key-add list-keywords no-before clearfix">
-	                              {% for t in img.metadata.tags %}
+	                              {% for t in img.metadata.tag_list %}
 	                                {% if t != "" %}<li><a data-tag="{{ t }}" class="box-shadow-2" href="#">{{ t }}</a></li>{% endif %}
 	                              {% endfor %}
 	                            </ul>
@@ -145,119 +145,6 @@
             </article>
 {% endblock %}
 
-{% comment %}
-                <div class="fullwidth">
-                    <form action="{% url 'save_fragment' %}" method="POST">
-                        <div class="column column-half">
-                            <a href="#" class="head-button clear-fragment" title="{% trans 'Erase the drawing' %}">&times;</a>
-                            <a href="#" class="head-button reset-fragment" title="{% trans 'Back to the original drawing' %}">&#8634;</a>
-                            <h2>{% if frg_to_modify %}{{ frg_data.title }}{% else %}{% trans 'New fragment' %}{% endif %}&nbsp;:</h2>
-                            <div class="center-image">
-	                            <div class="image-and-fragment">
-	                              {% with img.info.image_file as image %}
-	                              {% if image|ratio > 0.8 %}
-	                               {% thumbnail image "476" format="PNG" crop="center" as im %}
-		                            <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
-		                           {% empty %}
-		                            <img src="{% static 'egonomy/img/empty.gif' %}" width="476" height="476" class="placeholder" />
-		                           {% endthumbnail %}
-		                          {% else %}
-	                               {% thumbnail image "x600" format="PNG" crop="center" as im %}
-	                                <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
-	                               {% empty %}
-	                                <img src="{% static 'egonomy/img/empty.gif' %}" width="476" height="476" class="placeholder" />
-	                               {% endthumbnail %}
-		                          {% endif %}
-		                          {% endwith %}
-	                                <div class="cutout-canvas"></div>
-	                            </div>
-                            </div>
-                            <input name="fragment_path" id="fragment_path" type="hidden" class="fragment-path column-half" value="{% if frg_data %}{{ frg_data.coordinates }}{% endif %}" />
-                            <input name="image_id" id="image_id" type="hidden" value="{{ img.id }}" />
-                            {% if frg_to_modify %}<input name="fragment_pk" id="fragment_pk" type="hidden" value="{{ frg_data.pk }}" />{% endif %}
-                            {% csrf_token %}
-                        </div>
-                        <div class="column column-half">
-                            <table class="image-metadata">
-                                <tr>
-                                    <th>{% trans 'Source picture' %}&nbsp;:</th>
-                                    <td><a href="{% url 'annotate_picture' image_id=img.id %}">{{ img.metadata.titre|default:_("No title") }}</a></td>
-                                </tr>
-                                <tr>
-                                    <th>{% trans "Fragment's title" %}&nbsp;:</th>
-                                    <td><input type="text" class="fragment-title" placeholder="{% trans "Fragment's title" %}" name="fragment_title" id="fragment_title" {% if frg_data %}value="{{ frg_data.title }}"{% endif %}/></td>
-                                </tr>
-                                <tr>
-                                    <th>{% trans "Fragment's description" %}&nbsp;:</th>
-                                    <td><textarea class="fragment-description" name="fragment_description" id="fragment_description" {% if frg_data %}value="{{ frg_data.description }}"{% endif %}></textarea></td>
-                                </tr>
-                                <tr>
-                                    <th>{% trans 'Users keywords' %}&nbsp;:</th>
-                                    <td><input id="user_keywords" name="user_keywords" class="user-keywords" {% if frg_data %}value="{{ frg_data.tags }}"{% endif %}></td>
-                                </tr>
-                                {% if img.metadata.mots_cles %}
-                                <tr>
-                                    <th>{% trans 'RMN keywords' %}&nbsp;:</th>
-                                    <td><span id="rmn_tags">{% for t in img.metadata.mots_cles_list %}<span class="clickable addable_tag">{{ t }}</span>{% if not forloop.last %}, {% endif %}{% endfor %}</span>
-                                        <br/><span id="add_rmn_tags" class="right clickable">+ {% trans 'Add all RMN keywords to yours' %}</span></td>
-                                </tr>
-                                {% endif %}
-                                {% if img.metadata.titre_pertimm %}
-	                            <tr>
-	                                <th>{% trans "Pertimm title" %}&nbsp;:</th>
-	                                <td><span id="pertimm_title_tags">{% for t in img.metadata.titre_pertimm_list %}<span class="clickable addable_tag">{{ t }}</span>{% if not forloop.last %}, {% endif %}{% endfor %}</span>
-	                                    <br/><span id="add_pertimm_title" class="right clickable">+ {% trans 'Add all Pertimm title keywords to yours' %}</span></td>
-	                            </tr>
-                                {% endif %}
-                                {% if img.metadata.description_pertimm %}
-	                            <tr>
-	                                <th>{% trans "Pertimm description" %}&nbsp;:</th>
-	                                <td><span id="pertimm_description_tags">{% for t in img.metadata.description_pertimm_list %}<span class="clickable addable_tag">{{ t }}</span>{% if not forloop.last %}, {% endif %}{% endfor %}</span>
-	                                    <br/><span id="add_pertimm_description" class="right clickable">+ {% trans 'Add all Pertimm description keywords to yours' %}</span></td>
-	                            </tr>
-                                {% endif %}
-                                {% if img.metadata.thesaurus_pertimm %}
-	                            <tr>
-	                                <th>{% trans "Pertimm thesaurus" %}&nbsp;:</th>
-	                                <td><span id="pertimm_thesaurus_tags">{% for t in img.metadata.thesaurus_pertimm_list %}<span class="clickable addable_tag">{{ t }}</span>{% if not forloop.last %}, {% endif %}{% endfor %}</span>
-	                                    <br/><span id="add_pertimm_thesaurus" class="right clickable">+ {% trans 'Add all Pertimm thesaurus keywords to yours' %}</span></td>
-	                            </tr>
-                                {% endif %}
-                                <tr>
-                                    <th>{% trans "Senseetive keywords" %}&nbsp;:</th>
-                                    <td id="senseetive_holder"><p id="senseetive_click" class="add-button-grey">{% trans 'Request keywords from Senseetive API' %}</p></td>
-                                </tr>
-                            </table>
-                            <div class="fullwidth">
-                                <input class="user-submit" type="submit" value="{% trans 'Save the fragment' %}" />
-                            </div>
-                        </div>
-                    </form>
-                </div>
-                <div class="fullwidth">
-                    <div class="column column-full">
-                        <h2>{% trans "Fragments from this picture" %}</h2>
-                        <ul class="fullwidth">
-                          {% for fragment in fragment_list %}
-                            <li class="subcol subcol-eighth">
-                                <a href="{% url 'view_fragment' fragment_pk=fragment.pk  %}">
-                                <div class="center-image">
-                                    <div class="image-and-fragment">
-                                     {% include "partial/picture_and_red_fragment.html" %}
-                                    </div>
-                                </div>
-                                <h3>{{ fragment.title }}</h3></a>
-                                <p>{% trans "Annotated by" %} <strong><a href="{% url 'user_fragments' username=fragment.author %}">{{ fragment.author }}</a></strong></p>
-                            </li>
-                          {% endfor %}
-                        </ul>
-                    </div>
-                </div>
-                <div id="info_tag" style="display:none;">
-                  <p>coucou</p>
-                </div>
-{% endcomment %}
-
 {% block js_page %}
     <script type="text/javascript" src="{% static 'egonomy/lib/raphael-min.js' %}"></script>
     <script type="text/javascript" src="{% static 'egonomy/js/cutout.js' %}"></script>
--- a/src/egonomy/templates/egonomy_view_collection.html	Thu Jun 27 15:37:29 2013 +0200
+++ b/src/egonomy/templates/egonomy_view_collection.html	Thu Jun 27 15:42:46 2013 +0200
@@ -3,7 +3,7 @@
 {% load i18n %}
 {% load thumbnail %}
 
-{% block title %}{% trans "View a fragment" %}{% endblock %}
+{% block title %}{% trans "View a collection" %}{% endblock %}
 
 {% block popins %}
         <div id="collection-parameters" class="popin big-popin box-shadow">
@@ -83,120 +83,58 @@
             <div class="title-page">
                 <h2>{{ col.title }} / <span>par {{ col.author }}</span></h2>
                 <ul class="sub-nav title-menu clearfix">
-                    <li><a href="#" class="active">argumentaire</a></li>
+                    <li><a href="{% url 'view_collection' collection_pk=col.pk %}?display=slideshow" {% ifequal display "slideshow" %}class="active"{% endifequal %}>argumentaire</a></li>
                     <li><span class="dot-6"></span></li>
-                    <li><a href="#">mosaïque</a></li>
+                    <li><a href="{% url 'view_collection' collection_pk=col.pk %}?display=mosaic" {% ifequal display "mosaic" %}class="active"{% endifequal %}>mosaïque</a></li>
                     <li><span class="dot-6"></span></li>
-                    <li><a href="#">géographique</a></li>
+                    <li><a href="{% url 'view_collection' collection_pk=col.pk %}?display=geographical" {% ifequal display "geographical" %}class="active"{% endifequal %}>géographique</a></li>
                     <!--li><span class="dot-6"></span></li>
                     <li><a href="#">envoyer vers collage</a></li-->
                 </ul>
             </div>
             <div class="bar-tools clearfix">
                 <ul class="clearfix">
+                    {% ifequal display "mosaic" %}
+                    <li><a class="toggle-comment" href="#">
+                        <span class="show-comment">{% trans "Display" %}</span>
+                        <span class="hide-comment">{% trans "Hide" %}</span> {% trans "the comments" %}</a>
+                    </li>
+                    {% endifequal %}
                     <!--li><a href="#">lire le diaporama</a></li>
                     <li><a class="icon save" href="#">enregistrer sous</a></li-->
-                    <li><a class="open-popin" href="#collection-parameters">Paramètres de la collection</a></li>
+                    <li><a class="open-popin" href="#collection-parameters">{% trans "Collection parameters" %}</a></li>
                 </ul>
             </div>
         {% if items %}
           {% ifequal display "slideshow" %}
             <ul class="list-projets-3 clearfix masonry-465">
              {% for item in items %}
-              {% ifequal item.content_type.model "fragment" %}
-                <li class="clearfix horizontal item-masonry">
-                    {% with fragment=item.content_object %}
-                    <div class="col-left">
-						<a href="{% url 'view_fragment' fragment_pk=frg.pk %}">
-						<div class="center-image">
-						    <div class="image-and-fragment square-fragment-225">
-						        {% with image=fragment.image.info.image_file %}
-						        {% include "partial/fragment_only.html" %}
-						        {% endwith %}
-						    </div>
-						</div>
-						</a>
-                        <div class="tools toggle">
-                            <ul class="clearfix">
-                                <li><a class="tool twitter" href="#" title="{% trans 'Share on Twitter'%}"></a></li>
-                                <li><a class="tool facebook" href="#" title="{% trans 'Share on Facebook'%}"></a></li>
-                                <li>{% if user.is_authenticated %}
-			                        <a class="tool plus open-popin additemtocollection" data-type="fragment" data-id="{{ fragment.pk }}" href="#add-to-collection" title="{% trans 'Add to a collection' %}"></a>
-			                      {% else %}
-			                        <a class="tool plus" href="{% url 'login' %}?next={% url 'view_fragment' fragment_pk=fragment.pk %}" title="{% trans 'Add to a collection' %}"></a>
-			                      {% endif %}</li>
-                                <li><a class="tool cut" href="{% url 'create_fragment' image_id=fragment.image.id %}" title="{% trans 'Create a fragment'%}"></a></li>
-                                <li><a title="Supprimer" class="tool trash" href="#"></a></li>
-                            </ul>
-                        </div>
-                    </div>
-                    <div class="col-right">
-                        <div class="project-title">
-                            {% if col.author == user %}<a class="tool edit toggle" href="#"></a>{% endif %}
-                            <h3>{{ fragment.title }}</h3>
-                            <h4>{{ fragment.author }}</h4>
-                        </div>
-                        <p>desc : {{ item.description }}<br/>contenttype : {{ item.content_type.model }}<br/>object_id : {{ item.object_id }}<br/>content_object : {{ item.content_object }}</p>
-                    </div>
-                    {% endwith %}
-                </li>
-              {% else %}
-              {% with img=item.content_object %}
-               {% with img.info.image_file as image %}
-				{% if image %}
-				 {% if image|is_portrait %}
-				<li class="clearfix horizontal item-masonry">
-                    <div class="col-left">
-                        <a href="{% url 'annotate_picture' image_id=img.id %}">
-				          {% thumbnail image "225" format="PNG" crop="center" as im %}
-				            <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
-				          {% empty %}
-				            <img src="{% static 'egonomy/img/empty.gif' %}" width="225" height="225" class="placeholder" />
-				          {% endthumbnail %}
-				        </a>
-				 {% else %}
-				<li class="item-masonry">
-                    <div class="col-left">
-                        <a href="{% url 'annotate_picture' image_id=img.id %}">
-                          {% thumbnail image "469" format="PNG" crop="center" as im %}
-                            <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
-                          {% empty %}
-                            <img src="{% static 'egonomy/img/empty.gif' %}" width="469" height="225" class="placeholder" />
-                          {% endthumbnail %}
-                        </a>
-                 {% endif %}
-                        <div class="tools toggle">
-                            <ul class="clearfix">
-                                <li><a class="tool twitter" href="#" title="{% trans 'Share on Twitter'%}"></a></li>
-                                <li><a class="tool facebook" href="#" title="{% trans 'Share on Facebook'%}"></a></li>
-                                <li>{% if user.is_authenticated %}
-                                    <a class="tool plus open-popin additemtocollection" data-type="image" data-id="{{ img.id }}" href="#add-to-collection" title="{% trans 'Add to a collection' %}"></a>
-                                  {% else %}
-                                    <a class="tool plus" href="{% url 'login' %}?next={% url 'annotation_picture' image_id=img.id %}" title="{% trans 'Add to a collection' %}"></a>
-                                  {% endif %}</li>
-                                <li><a class="tool cut" href="{% url 'create_fragment' image_id=img.id %}" title="{% trans 'Create a fragment'%}"></a></li>
-                                <li><a title="Supprimer" class="tool trash" href="#"></a></li>
-                            </ul>
-                        </div>
-                    </div>
-                    <div class="col-right">
-                        <div class="project-title">
-                            {% if col.author == user %}<a class="tool edit toggle" href="#"></a>{% endif %}
-                            <h3>{{ img.metadata.titre }}</h3>
-                            <h4>{{ img.metadata.auteur }}</h4>
-                        </div>
-                        <p>desc : {{ item.description }}<br/>contenttype : {{ item.content_type.model }}<br/>object_id : {{ item.object_id }}<br/>content_object : {{ item.content_object }}</p>
-                    </div>
-                  </li>
-				{% else %}
-				     <img src="{% static 'egonomy/img/empty.gif' %}" width=225" height="225" class="placeholder" />
-				{% endif %}
-				{% endwith %}
-              {% endwith %}
-              {% endifequal %}
+              {% include 'partial/item_in_collection_list.html' %}
              {% endfor %}
             </ul>
           {% endifequal %}
+          {% ifequal display "mosaic" %}
+            <div class="clearfix">
+	            <div class="filters-wrap float-left">
+	                <ul class="filters">
+	                 {% for item in items %}
+	                  {% for t in item.content_object.tag_list %}
+                       {% if t != "" %}
+                        <li class="box-shadow-2"><a class="display-keyword" data-keyword="{{ t }}" href="#">
+                           {{ t }} <a class="icon-action cross" href="#"></a>
+                        </a></li>
+                       {% endif %}
+                      {% endfor %}
+	                 {% endfor %}
+	                </ul>
+	            </div>
+	            <ul class="list-projets-5 mosaic float-left clearfix masonry-177">
+	             {% for item in items %}
+	              {% include 'partial/item_in_collection_mosaic.html' %}
+	             {% endfor %}
+	            </ul>
+	        </div>
+          {% endifequal %}
         {% else %}
             <div class="empty-block">
                 <form class="search-form-big" id="search-form-big" action="{% if search_fragment %}{% url 'all_fragments' %}{% else %}{% url 'all_pictures' %}{% endif %}" method="GET">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/egonomy/templates/partial/item_in_collection_list.html	Thu Jun 27 15:42:46 2013 +0200
@@ -0,0 +1,98 @@
+{% load static %}
+{% load i18n %}
+{% load thumbnail %}
+{% ifequal item.content_type.model "fragment" %}
+  <li class="clearfix horizontal item-masonry">
+      {% with fragment=item.content_object %}
+      <div class="col-left">
+          <a href="{% url 'view_fragment' fragment_pk=frg.pk %}">
+          <div class="center-image">
+              <div class="image-and-fragment square-fragment-225">
+                  {% with image=fragment.image.info.image_file %}
+                  {% include "partial/fragment_only.html" %}
+                  {% endwith %}
+              </div>
+          </div>
+          </a>
+          <div class="tools toggle">
+              <ul class="clearfix">
+                  <li><a class="tool twitter" href="#" title="{% trans 'Share on Twitter'%}"></a></li>
+                  <li><a class="tool facebook" href="#" title="{% trans 'Share on Facebook'%}"></a></li>
+                  <li>{% if user.is_authenticated %}
+                      <a class="tool plus open-popin additemtocollection" data-type="fragment" data-id="{{ fragment.pk }}" href="#add-to-collection" title="{% trans 'Add to a collection' %}"></a>
+                    {% else %}
+                      <a class="tool plus" href="{% url 'login' %}?next={% url 'view_fragment' fragment_pk=fragment.pk %}" title="{% trans 'Add to a collection' %}"></a>
+                    {% endif %}</li>
+                  <li><a class="tool cut" href="{% url 'create_fragment' image_id=fragment.image.id %}" title="{% trans 'Create a fragment'%}"></a></li>
+                  <li><a title="Supprimer" class="tool trash" href="#"></a></li>
+              </ul>
+          </div>
+      </div>
+      <div class="col-right">
+          <div class="project-title">
+              {% if col.author == user %}<a class="tool edit toggle" href="#"></a>{% endif %}
+              <h3>{{ fragment.title }}</h3>
+              <h4>{{ fragment.author }}</h4>
+          </div>
+          <p>desc : {{ item.description }}<br/>contenttype : {{ item.content_type.model }}<br/>object_id : {{ item.object_id }}<br/>content_object : {{ item.content_object }}</p>
+      </div>
+      {% endwith %}
+  </li>
+{% else %}
+{% with img=item.content_object %}
+ {% with img.info.image_file as image %}
+  {% if image %}
+   {% if image|is_portrait %}
+  <li class="clearfix horizontal item-masonry">
+      <div class="col-left">
+          <a href="{% url 'annotate_picture' image_id=img.id %}">
+            {% thumbnail image "225" format="PNG" crop="center" as im %}
+              <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
+            {% empty %}
+              <img src="{% static 'egonomy/img/empty.gif' %}" width="225" height="225" class="placeholder" />
+            {% endthumbnail %}
+          </a>
+   {% else %}
+  <li class="item-masonry">
+      <div class="col-left">
+          <a href="{% url 'annotate_picture' image_id=img.id %}">
+            {% thumbnail image "469" format="PNG" crop="center" as im %}
+              <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
+            {% empty %}
+              <img src="{% static 'egonomy/img/empty.gif' %}" width="469" height="225" class="placeholder" />
+            {% endthumbnail %}
+          </a>
+   {% endif %}
+  {% else %}
+    <li class="clearfix horizontal item-masonry">
+      <div class="col-left">
+          <a href="{% url 'annotate_picture' image_id=img.id %}">>
+	        <img src="{% static 'egonomy/img/empty.gif' %}" width=225" height="225" class="placeholder" />
+	      </a>
+  {% endif %}
+          <div class="tools toggle">
+              <ul class="clearfix">
+                  <li><a class="tool twitter" href="#" title="{% trans 'Share on Twitter'%}"></a></li>
+                  <li><a class="tool facebook" href="#" title="{% trans 'Share on Facebook'%}"></a></li>
+                  <li>{% if user.is_authenticated %}
+                      <a class="tool plus open-popin additemtocollection" data-type="image" data-id="{{ img.id }}" href="#add-to-collection" title="{% trans 'Add to a collection' %}"></a>
+                    {% else %}
+                      <a class="tool plus" href="{% url 'login' %}?next={% url 'annotation_picture' image_id=img.id %}" title="{% trans 'Add to a collection' %}"></a>
+                    {% endif %}</li>
+                  <li><a class="tool cut" href="{% url 'create_fragment' image_id=img.id %}" title="{% trans 'Create a fragment'%}"></a></li>
+                  <li><a title="Supprimer" class="tool trash" href="#"></a></li>
+              </ul>
+          </div>
+      </div>
+      <div class="col-right">
+          <div class="project-title">
+              {% if col.author == user %}<a class="tool edit toggle" href="#"></a>{% endif %}
+              <h3>{{ img.metadata.titre }}</h3>
+              <h4>{{ img.metadata.auteur }}</h4>
+          </div>
+          <p>desc : {{ item.description }}<br/>contenttype : {{ item.content_type.model }}<br/>object_id : {{ item.object_id }}<br/>content_object : {{ item.content_object }}</p>
+      </div>
+    </li>
+  {% endwith %}
+{% endwith %}
+{% endifequal %}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/egonomy/templates/partial/item_in_collection_mosaic.html	Thu Jun 27 15:42:46 2013 +0200
@@ -0,0 +1,87 @@
+{% load static %}
+{% load i18n %}
+{% load thumbnail %}
+<li class="item-masonry" data-keywords="{{ item.content_object.tag_list|join:',' }}">
+    <div class="curtain"></div>
+    <div class="visuel-project">
+    {% ifequal item.content_type.model "fragment" %}
+      {% with fragment=item.content_object %}
+        <a href="{% url 'view_fragment' fragment_pk=frg.pk %}">
+        <div class="center-image">
+            <div class="image-and-fragment square-fragment-177">
+                {% with image=fragment.image.info.image_file %}
+                {% include "partial/fragment_only.html" %}
+                {% endwith %}
+            </div>
+        </div>
+        </a>
+        <div class="tools toggle">
+            <div class="title-project">
+	           <h3>{{ fragment.title }}</h3>
+               <h4>{{ fragment.author }}</h4>
+	        </div>
+            <ul class="clearfix">
+                <li><a class="tool twitter" href="#" title="{% trans 'Share on Twitter'%}"></a></li>
+                <li><a class="tool facebook" href="#" title="{% trans 'Share on Facebook'%}"></a></li>
+                <li>{% if user.is_authenticated %}
+                    <a class="tool plus open-popin additemtocollection" data-type="fragment" data-id="{{ fragment.pk }}" href="#add-to-collection" title="{% trans 'Add to a collection' %}"></a>
+                  {% else %}
+                    <a class="tool plus" href="{% url 'login' %}?next={% url 'view_fragment' fragment_pk=fragment.pk %}" title="{% trans 'Add to a collection' %}"></a>
+                  {% endif %}</li>
+                <li><a class="tool cut" href="{% url 'create_fragment' image_id=fragment.image.id %}" title="{% trans 'Create a fragment'%}"></a></li>
+                <li><a title="Supprimer" class="tool trash" href="#"></a></li>
+            </ul>
+        </div>
+        <div class="content-project">
+            <div class="project-title">
+                {% if col.author == user %}<a class="tool edit toggle" href="#"></a>{% endif %}
+                <h3>{{ fragment.title }}</h3>
+                <h4>{{ fragment.author }}</h4>
+            </div>
+            <p>desc : {{ item.description }}<br/>contenttype : {{ item.content_type.model }}<br/>object_id : {{ item.object_id }}<br/>content_object : {{ item.content_object }}</p>
+        </div>
+      {% endwith %}
+	{% else %}
+	{% with img=item.content_object %}
+	 {% with img.info.image_file as image %}
+        <a href="{% url 'annotate_picture' image_id=img.id %}">
+	    {% if image %}
+          {% thumbnail image "177" format="PNG" crop="center" as im %}
+            <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
+          {% empty %}
+            <img src="{% static 'egonomy/img/empty.gif' %}" width="177" height="117" class="placeholder" />
+          {% endthumbnail %}
+	    {% else %}
+            <img src="{% static 'egonomy/img/empty.gif' %}" width="177" height="177" class="placeholder" />
+	    {% endif %}
+        </a>
+	    <div class="tools toggle">
+            <div class="title-project">
+                <h3>{{ img.metadata.titre }}</h3>
+                <h4>{{ img.metadata.auteur }}</h4>
+            </div>
+            <ul class="clearfix">
+                <li><a class="tool twitter" href="#" title="{% trans 'Share on Twitter'%}"></a></li>
+                <li><a class="tool facebook" href="#" title="{% trans 'Share on Facebook'%}"></a></li>
+                <li>{% if user.is_authenticated %}
+                    <a class="tool plus open-popin additemtocollection" data-type="image" data-id="{{ img.id }}" href="#add-to-collection" title="{% trans 'Add to a collection' %}"></a>
+                  {% else %}
+                    <a class="tool plus" href="{% url 'login' %}?next={% url 'annotation_picture' image_id=img.id %}" title="{% trans 'Add to a collection' %}"></a>
+                  {% endif %}</li>
+                <li><a class="tool cut" href="{% url 'create_fragment' image_id=img.id %}" title="{% trans 'Create a fragment'%}"></a></li>
+                <li><a title="Supprimer" class="tool trash" href="#"></a></li>
+            </ul>
+        </div>
+	    <div class="content-project">
+	        <div class="project-title">
+	            {% if col.author == user %}<a class="tool edit toggle" href="#"></a>{% endif %}
+	            <h3>{{ img.metadata.titre }}</h3>
+	            <h4>{{ img.metadata.auteur }}</h4>
+	        </div>
+	        <p>desc : {{ item.description }}<br/>contenttype : {{ item.content_type.model }}<br/>object_id : {{ item.object_id }}<br/>content_object : {{ item.content_object }}</p>
+	    </div>
+	  {% endwith %}
+	{% endwith %}
+	{% endifequal %}
+    </div>
+</li>
\ No newline at end of file