src/egonomy/templates/partial/item_in_collection_mosaic.html
author cavaliet
Tue, 02 Jul 2013 17:58:37 +0200
changeset 214 58dcbe86cbe0
parent 199 5f04dbb9cbaa
child 234 886cbc53b854
permissions -rw-r--r--
remove item from collection and update languages
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
175
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
     1
{% load static %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
     2
{% load i18n %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
     3
{% load thumbnail %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
     4
<li class="item-masonry" data-keywords="{{ item.content_object.tag_list|join:',' }}">
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
     5
    <div class="curtain"></div>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
     6
    <div class="visuel-project">
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
     7
    {% ifequal item.content_type.model "fragment" %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
     8
      {% with fragment=item.content_object %}
196
c6f93859ae43 correction in templates
cavaliet
parents: 175
diff changeset
     9
        <a href="{% url 'view_fragment' fragment_pk=fragment.pk %}">
175
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    10
        <div class="center-image">
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    11
            <div class="image-and-fragment square-fragment-177">
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    12
                {% with image=fragment.image.info.image_file %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    13
                {% include "partial/fragment_only.html" %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    14
                {% endwith %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    15
            </div>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    16
        </div>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    17
        </a>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    18
        <div class="tools toggle">
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    19
            <div class="title-project">
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    20
	           <h3>{{ fragment.title }}</h3>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    21
               <h4>{{ fragment.author }}</h4>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    22
	        </div>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    23
            <ul class="clearfix">
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    24
                <li><a class="tool twitter" href="#" title="{% trans 'Share on Twitter'%}"></a></li>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    25
                <li><a class="tool facebook" href="#" title="{% trans 'Share on Facebook'%}"></a></li>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    26
                <li>{% if user.is_authenticated %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    27
                    <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>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    28
                  {% else %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    29
                    <a class="tool plus" href="{% url 'login' %}?next={% url 'view_fragment' fragment_pk=fragment.pk %}" title="{% trans 'Add to a collection' %}"></a>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    30
                  {% endif %}</li>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    31
                <li><a class="tool cut" href="{% url 'create_fragment' image_id=fragment.image.id %}" title="{% trans 'Create a fragment'%}"></a></li>
214
58dcbe86cbe0 remove item from collection and update languages
cavaliet
parents: 199
diff changeset
    32
                {% if user.is_authenticated %}{% ifequal col.author user %}
58dcbe86cbe0 remove item from collection and update languages
cavaliet
parents: 199
diff changeset
    33
                <li><a class="tool trash" href="{% url 'remove_item' %}?collection_pk={{col.pk}}&item_pk={{item.pk}}&display=mosaic" onclick="return confirm('{% trans "Do you really want to remove this item from this collection ? Warning : this action est irreversible." %}')" title="{% trans 'Remove from this collection' %}" ></a></li>
58dcbe86cbe0 remove item from collection and update languages
cavaliet
parents: 199
diff changeset
    34
                {% endifequal %}{% endif %}
175
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    35
            </ul>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    36
        </div>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    37
        <div class="content-project">
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    38
            <div class="project-title">
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    39
                {% if col.author == user %}<a class="tool edit toggle" href="#"></a>{% endif %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    40
                <h3>{{ fragment.title }}</h3>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    41
                <h4>{{ fragment.author }}</h4>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    42
            </div>
199
5f04dbb9cbaa debug and version number to 0.6.4
cavaliet
parents: 196
diff changeset
    43
            <p>{{ item.description }}</p>
175
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    44
        </div>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    45
      {% endwith %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    46
	{% else %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    47
	{% with img=item.content_object %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    48
	 {% with img.info.image_file as image %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    49
        <a href="{% url 'annotate_picture' image_id=img.id %}">
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    50
	    {% if image %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    51
          {% thumbnail image "177" format="PNG" crop="center" as im %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    52
            <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    53
          {% empty %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    54
            <img src="{% static 'egonomy/img/empty.gif' %}" width="177" height="117" class="placeholder" />
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    55
          {% endthumbnail %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    56
	    {% else %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    57
            <img src="{% static 'egonomy/img/empty.gif' %}" width="177" height="177" class="placeholder" />
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    58
	    {% endif %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    59
        </a>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    60
	    <div class="tools toggle">
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    61
            <div class="title-project">
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    62
                <h3>{{ img.metadata.titre }}</h3>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    63
                <h4>{{ img.metadata.auteur }}</h4>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    64
            </div>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    65
            <ul class="clearfix">
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    66
                <li><a class="tool twitter" href="#" title="{% trans 'Share on Twitter'%}"></a></li>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    67
                <li><a class="tool facebook" href="#" title="{% trans 'Share on Facebook'%}"></a></li>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    68
                <li>{% if user.is_authenticated %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    69
                    <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>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    70
                  {% else %}
199
5f04dbb9cbaa debug and version number to 0.6.4
cavaliet
parents: 196
diff changeset
    71
                    <a class="tool plus" href="{% url 'login' %}?next={% url 'annotate_picture' image_id=img.id %}" title="{% trans 'Add to a collection' %}"></a>
175
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    72
                  {% endif %}</li>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    73
                <li><a class="tool cut" href="{% url 'create_fragment' image_id=img.id %}" title="{% trans 'Create a fragment'%}"></a></li>
214
58dcbe86cbe0 remove item from collection and update languages
cavaliet
parents: 199
diff changeset
    74
                {% if user.is_authenticated %}{% ifequal col.author user %}
58dcbe86cbe0 remove item from collection and update languages
cavaliet
parents: 199
diff changeset
    75
                <li><a class="tool trash" href="{% url 'remove_item' %}?collection_pk={{col.pk}}&item_pk={{item.pk}}&display=mosaic" onclick="return confirm('{% trans "Do you really want to remove this item from this collection ? Warning : this action est irreversible." %}')" title="{% trans 'Remove from this collection' %}" ></a></li>
58dcbe86cbe0 remove item from collection and update languages
cavaliet
parents: 199
diff changeset
    76
                {% endifequal %}{% endif %}
175
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    77
            </ul>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    78
        </div>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    79
	    <div class="content-project">
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    80
	        <div class="project-title">
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    81
	            {% if col.author == user %}<a class="tool edit toggle" href="#"></a>{% endif %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    82
	            <h3>{{ img.metadata.titre }}</h3>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    83
	            <h4>{{ img.metadata.auteur }}</h4>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    84
	        </div>
199
5f04dbb9cbaa debug and version number to 0.6.4
cavaliet
parents: 196
diff changeset
    85
	        <p>{{ item.description }}</p>
175
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    86
	    </div>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    87
	  {% endwith %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    88
	{% endwith %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    89
	{% endifequal %}
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    90
    </div>
8f6eef1d1fc8 collection available in list and mosaic
cavaliet
parents:
diff changeset
    91
</li>