src/egonomy/templates/egonomy_view_fragment.html
author cavaliet
Wed, 26 Jun 2013 16:53:45 +0200
changeset 159 b98558f8d2c1
parent 149 af59627418e7
child 168 c90576d18319
permissions -rw-r--r--
collection first step
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
149
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
     1
{% extends "egonomy_newbase.html" %}
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
     2
{% load static %}
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
     3
{% load i18n %}
18
ffd106d9b8e1 Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents: 15
diff changeset
     4
{% load thumbnail %}
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
     5
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
     6
{% block title %}{% trans "View a fragment" %}{% endblock %}
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
     7
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
     8
{% block content %}
149
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
     9
            <div class="title-page">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    10
                <h2>{{ fragment.title }}</h2>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    11
            </div>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    12
            <div class="bar-tools clearfix">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    13
                <ul class="clearfix left">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    14
                    <li><a class="go-to mosaic" href="#"></a></li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    15
                    <li><a class="go-to search" href="#"></a></li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    16
                </ul>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    17
                <ul class="clearfix">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    18
                    {% ifequal user fragment.author %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    19
                    <li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    20
                        <a class="icon edit" href="{% url 'create_fragment' image_id=fragment.image.id fragment_pk=fragment.pk %}">{% trans "Modify this fragment" %}</a>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    21
                    </li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    22
                    <li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    23
                        <a class="icon trash" href="{% url 'delete_fragment' %}?fragment_pk={{fragment.pk}}" onclick="return confirm('{% trans "Do you really want to delete this fragment ? Warning : this action est irreversible." %}')">{% trans "Delete this fragment" %}</a>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    24
                    </li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    25
                    {% endifequal %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    26
                    <li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    27
                        <a class="icon copy" href="{% url 'create_fragment' image_id=fragment.image.id %}?duplicate={{fragment.pk}}">{% trans "Duplicate this fragment" %}</a>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    28
                    </li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    29
                    <li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    30
                        <a class="icon cut" href="{% url 'create_fragment' image_id=fragment.image.id %}">{% trans "Create a fragment" %}</a>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    31
                    </li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    32
                    <li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    33
                      {% if user.is_authenticated %}
159
b98558f8d2c1 collection first step
cavaliet
parents: 149
diff changeset
    34
                        <a class="icon plus open-popin" href="#add-to-collection">{% trans "Add to a collection" %}</a>
149
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    35
                      {% else %}
159
b98558f8d2c1 collection first step
cavaliet
parents: 149
diff changeset
    36
                        <a class="icon plus" href="{% url 'login' %}?next={% url 'view_fragment' fragment_pk=fragment.pk %}">{% trans "Add to a collection" %}</a>
149
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    37
                      {% endif %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    38
                    </li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    39
                    <!--li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    40
                        <a class="icon save" href="#">Enregistrer sous</a>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    41
                    </li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    42
                    <li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    43
                        <a class="icon plus open-popin" href="#add-to-collection">Ajouter à ma collection</a>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    44
                    </li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    45
                    <li>
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    46
                        <form action="#">
149
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    47
                            <p>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    48
                                <input class="search-form" id="id_search" type="text" placeholder="Romantisme noir">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    49
                            </p>
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    50
                        </form>
149
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    51
                    </li-->
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    52
                </ul>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    53
            </div>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    54
            <article class="edition">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    55
                <div class="slideshow box-edition">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    56
                    <div class="image-wrap">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    57
                      {% if fragment_only %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    58
                        <div class="image-and-fragment square-fragment-600">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    59
                         {% with fragment.image.info.image_file as image %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    60
                         {% include "partial/fragment_only.html" %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    61
                         {% endwith %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    62
                        </div>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    63
                      {% else %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    64
                        <div class="image-and-fragment">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    65
                          {% with 0.99 as ratio %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    66
                          {% with "600" as w_size %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    67
                          {% with "x600" as h_size %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    68
                          {% include "partial/picture_and_fragment.html" %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    69
                          {% endwith %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    70
                          {% endwith %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    71
                          {% endwith %}
25
48614929b87a Real sort on home. Real pict's fragment on other pages. Real links on intelligent pagination.
cavaliet
parents: 23
diff changeset
    72
                        </div>
149
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    73
                      {% endif %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    74
                    </div>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    75
                    <div class="arrow-wrap left-arrow">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    76
                        <a class="arrow" href="#"></a>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    77
                    </div>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    78
                    <div class="arrow-wrap right-arrow">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    79
                        <a class="arrow" href="#"></a>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    80
                    </div>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    81
                    <ul class="share">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    82
                        <li><a title="Partager sur Twitter" href="#" class="tool twitter"></a></li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    83
                        <li><a title="Partager sur Facebook" href="#" class="tool facebook"></a></li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    84
                    </ul>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    85
                </div>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    86
                <div class="info box-edition clearfix">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    87
                    <table class="edition-table-left">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    88
                        <tbody>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    89
                            <tr>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    90
                                <th>{% trans "Source picture" %}&nbsp;:</th>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    91
                                <td><a href="{% url 'annotate_picture' image_id=fragment.image.id %}">{{ fragment.image.metadata.titre|default:_("No title") }}</a></td>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    92
                            </tr>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    93
                            <tr>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    94
                                <th>{% trans "Fragment's title" %}&nbsp;:</th>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    95
                                <td>{{ fragment.title }}</td>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    96
                            </tr>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    97
                            <tr>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    98
                                <th>{% trans "Fragment's description" %}&nbsp;:</th>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
    99
                                <td>{{ fragment.description }}</td>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   100
                            </tr>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   101
                            <tr>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   102
                                <th>{% trans "Last modification" %}&nbsp;:</th>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   103
                                <td>{{ fragment.date_saved }} {% trans 'by' %} <strong><a href="{% url 'user_fragments' username=fragment.author %}">{{ fragment.author }}</a></strong></td>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   104
                            </tr>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   105
                        </tbody>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   106
                    </table>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   107
                    <table class="edition-table-right">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   108
                        <tbody>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   109
                        {% if fragment_only %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   110
                            <tr><th><a href="{% url 'view_fragment' fragment_pk=fragment.pk %}?fragment_only=0">{% trans "See the fragment in its full picture" %} :</a></th></tr>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   111
                            <tr><td><a href="{% url 'view_fragment' fragment_pk=fragment.pk %}?fragment_only=0">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   112
                                <div class="image-and-fragment">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   113
                                  {% with 1 as ratio %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   114
                                  {% with "110" as w_size %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   115
                                  {% with "x110" as h_size %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   116
                                  {% include "partial/picture_and_fragment.html" %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   117
                                  {% endwith %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   118
                                  {% endwith %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   119
                                  {% endwith %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   120
                                </div></a>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   121
                            </td></tr>
78
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
   122
                            </a>
149
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   123
                        {% else %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   124
                            <tr><th><a href="{% url 'view_fragment' fragment_pk=fragment.pk %}">{% trans "See the fragment only" %} :</a></th></tr>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   125
                            <tr><td><a href="{% url 'view_fragment' fragment_pk=fragment.pk %}">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   126
                                <div class="image-and-fragment square-fragment-110">
78
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
   127
                                 {% with image=fragment.image.info.image_file %}
79
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
   128
                                 {% include "partial/fragment_only.html" %}
78
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
   129
                                 {% endwith %}
149
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   130
                                </div></a>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   131
                            </td></tr>
78
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
   132
                            </a>
149
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   133
                        {% endif %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   134
                        </tbody>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   135
                    </table>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   136
                </div>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   137
                <div class="box-edition">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   138
                    <table>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   139
                        <tbody>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   140
                            <tr>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   141
                                <th class="va-top">{% trans "Fragment's keywords" %}</th>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   142
                                <td>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   143
                                    <ul class="list-key-search no-before list-keywords clearfix">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   144
                                      {% for t in fragment.tag_list %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   145
	                                    {% if t != "" %}<li><a data-tag="{{ t }}" class="box-shadow-2" href="#">{{ t }}</a></li>{% endif %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   146
	                                  {% endfor %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   147
                                    </ul>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   148
                                </td>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   149
                            </tr>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   150
                        </tbody>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   151
                    </table>
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   152
                </div>
149
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   153
                <div class="box-edition">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   154
                    <h3>{% trans "Fragments from this picture" %} :</h3>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   155
                    {% if fragment_list %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   156
                    <ul class="fullwidth clearfix">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   157
                      {% for fragment in fragment_list %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   158
                        <li class="subcol subcol-seventh">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   159
                            <a href="{% url 'view_fragment' fragment_pk=fragment.pk %}">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   160
                            <div class="center-image">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   161
                                <div class="image-and-fragment">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   162
                                 {% include "partial/picture_and_red_fragment.html" %}
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   163
                                </div>
149
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   164
                            </div>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   165
                            <h3>{{ fragment.title }}</h3></a>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   166
                            <p>{% trans "Annotated by" %} <strong><a href="{% url 'user_fragments' username=fragment.author %}">{{ fragment.author }}</a></strong></p>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   167
                        </li>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   168
                      {% endfor %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   169
                    </ul>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   170
                    {% else %}
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   171
                    <p class="null">{% trans "No fragment" %}</p>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   172
                    {% endif %}
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   173
                </div>
149
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   174
                <div class="box-edition">
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   175
                    <h3>Collections liées à cette image :</h3>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   176
                    <p class="null">{% trans "No collection" %}</p>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   177
                </div>
af59627418e7 view fragment with new style
cavaliet
parents: 110
diff changeset
   178
            </article>
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   179
{% endblock %}