src/egonomy/templates/egonomy_view_fragment.html
author cavaliet
Thu, 02 May 2013 14:40:12 +0200
changeset 111 741e46d64fdc
parent 110 4732fcfd3a76
child 149 af59627418e7
permissions -rw-r--r--
Update version number to 0.5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
     1
{% extends "egonomy_base.html" %}
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 %}
48
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 27
diff changeset
     5
{% load egonomy_thumbnail %}
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
     6
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
     7
{% block title %}{% trans "View a fragment" %}{% endblock %}
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
     8
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
     9
{% block content %}
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    10
                <div class="fullwidth">
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    11
                    <div class="column column-half">
18
ffd106d9b8e1 Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents: 15
diff changeset
    12
                        <h2>{{ fragment.title }}</h2>
48
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 27
diff changeset
    13
                        <div class="center-image">
78
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    14
                          {% if fragment_only %}
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    15
                            <div class="image-and-fragment large_square_fragment">
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    16
                             {% with fragment.image.info.image_file as image %}
79
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
    17
                             {% include "partial/fragment_only.html" %}
78
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    18
                             {% endwith %}
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    19
                            </div>
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    20
                          {% else %}
48
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 27
diff changeset
    21
	                        <div class="image-and-fragment">
79
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
    22
	                          {% with 0.8 as ratio %}
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
    23
	                          {% with "476" as w_size %}
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
    24
	                          {% with "x600" as h_size %}
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
    25
	                          {% include "partial/picture_and_fragment.html" %}
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
    26
                              {% endwith %}
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
    27
                              {% endwith %}
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
    28
                              {% endwith %}
48
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 27
diff changeset
    29
	                        </div>
78
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    30
                          {% endif %}
48
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 27
diff changeset
    31
	                    </div>
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    32
                    </div>
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    33
                    <div class="column column-half">
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    34
                        <form action="#">
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    35
                            <table class="image-metadata">
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    36
                                <tr>
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    37
                                    <th>{% trans "Source picture" %}&nbsp;:</th>
51
d842aad55f81 clean default values in templates
cavaliet
parents: 48
diff changeset
    38
                                    <td><a href="{% url 'annotate_picture' image_id=fragment.image.id %}">{{ fragment.image.metadata.titre|default:_("No title") }}</a></td>
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    39
                                </tr>
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    40
                                <tr>
18
ffd106d9b8e1 Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents: 15
diff changeset
    41
                                    <th>{% trans "Fragment's description" %}&nbsp;:</th>
ffd106d9b8e1 Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents: 15
diff changeset
    42
                                    <td>{{ fragment.description }}</td>
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    43
                                </tr>
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    44
                                <tr>
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    45
                                    <th>{% trans "Users keywords" %}</th>
27
daaafc916dc4 Debug in templates. All fragments page added. Language files updated.
cavaliet
parents: 25
diff changeset
    46
                                    <td>{{ fragment.tags }}</td>
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    47
                                </tr>
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    48
                                <tr>
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    49
                                    <th>{% trans "Last modification" %}&nbsp;:</th>
71
14c40542dfbb modify segment. export xml corrected.
cavaliet
parents: 67
diff changeset
    50
                                    <td>{{ fragment.date_saved }} {% trans 'by' %} <strong><a href="{% url 'user_fragments' username=fragment.author %}">{{ fragment.author }}</a></strong></td>
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    51
                                </tr>
71
14c40542dfbb modify segment. export xml corrected.
cavaliet
parents: 67
diff changeset
    52
                                {% ifequal user fragment.author %}
14c40542dfbb modify segment. export xml corrected.
cavaliet
parents: 67
diff changeset
    53
                                <tr>
14c40542dfbb modify segment. export xml corrected.
cavaliet
parents: 67
diff changeset
    54
                                    <th>&nbsp;</th>
14c40542dfbb modify segment. export xml corrected.
cavaliet
parents: 67
diff changeset
    55
                                    <td><a href="{% url 'create_fragment' image_id=fragment.image.id fragment_pk=fragment.pk %}" class="big-button">{% trans "Modify this fragment" %}</a></td>
14c40542dfbb modify segment. export xml corrected.
cavaliet
parents: 67
diff changeset
    56
                                </tr>
110
4732fcfd3a76 new feature : delete fragment.
cavaliet
parents: 84
diff changeset
    57
                                <tr>
4732fcfd3a76 new feature : delete fragment.
cavaliet
parents: 84
diff changeset
    58
                                    <th>&nbsp;</th>
4732fcfd3a76 new feature : delete fragment.
cavaliet
parents: 84
diff changeset
    59
                                    <td><a href="{% url 'delete_fragment' %}?fragment_pk={{fragment.pk}}" class="big-button"  onclick="return confirm('{% trans "Do you really want to delete this fragment ? Warning : this action est irreversible." %}')">{% trans "Delete this fragment" %}</a></td>
4732fcfd3a76 new feature : delete fragment.
cavaliet
parents: 84
diff changeset
    60
                                </tr>
71
14c40542dfbb modify segment. export xml corrected.
cavaliet
parents: 67
diff changeset
    61
                                {% endifequal %}
84
b2fbd34b259c Duplicate fragment feature and languages updated
cavaliet
parents: 79
diff changeset
    62
                                <tr>
b2fbd34b259c Duplicate fragment feature and languages updated
cavaliet
parents: 79
diff changeset
    63
                                    <th>&nbsp;</th>
b2fbd34b259c Duplicate fragment feature and languages updated
cavaliet
parents: 79
diff changeset
    64
                                    <td><a href="{% url 'create_fragment' image_id=fragment.image.id %}?duplicate={{fragment.pk}}" class="big-button">{% trans "Duplicate this fragment" %}</a></td>
b2fbd34b259c Duplicate fragment feature and languages updated
cavaliet
parents: 79
diff changeset
    65
                                </tr>
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    66
                            </table>
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    67
                        </form>
25
48614929b87a Real sort on home. Real pict's fragment on other pages. Real links on intelligent pagination.
cavaliet
parents: 23
diff changeset
    68
                        <div class="fullwidth">
48614929b87a Real sort on home. Real pict's fragment on other pages. Real links on intelligent pagination.
cavaliet
parents: 23
diff changeset
    69
                            <a href="{% url 'create_fragment' image_id=fragment.image.id %}" class="big-button">{% trans "Create a fragment" %}</a>
48614929b87a Real sort on home. Real pict's fragment on other pages. Real links on intelligent pagination.
cavaliet
parents: 23
diff changeset
    70
                        </div>
78
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    71
                        <div class="fullwidth">
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    72
                          {% if fragment_only %}
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    73
                            <a href="{% url 'view_fragment' fragment_pk=fragment.pk %}?fragment_only=0">
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    74
                                {% trans "See the fragment in its full picture" %} :<br/>
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    75
	                            <div class="image-and-fragment">
79
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
    76
	                              {% with 1 as ratio %}
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
    77
	                              {% with "110" as w_size %}
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
    78
	                              {% with "x110" as h_size %}
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
    79
	                              {% include "partial/picture_and_fragment.html" %}
78
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    80
	                              {% endwith %}
79
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
    81
	                              {% endwith %}
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
    82
	                              {% endwith %}
78
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    83
	                            </div>
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    84
                            </a>
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    85
                          {% else %}
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    86
                            <a href="{% url 'view_fragment' fragment_pk=fragment.pk %}">
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    87
                                {% trans "See the fragment only" %} :<br/>
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    88
                                <div class="image-and-fragment little_square_fragment">
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    89
                                 {% with image=fragment.image.info.image_file %}
79
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
    90
                                 {% include "partial/fragment_only.html" %}
78
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    91
                                 {% endwith %}
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    92
                                </div>
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    93
                            </a>
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    94
                          {% endif %}
67d3fb0e54a6 enhance view fragment with new svg display
cavaliet
parents: 74
diff changeset
    95
                        </div>
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    96
                    </div>
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    97
                </div>
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    98
                <div class="fullwidth">
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
    99
                    <div class="column column-full">
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   100
                        <h2>{% trans "Fragments from this picture" %}</h2>
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   101
                        <ul class="fullwidth">
79
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
   102
                          {% for fragment in fragment_list %}
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   103
                            <li class="subcol subcol-eighth">
79
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
   104
                                <a href="{% url 'view_fragment' fragment_pk=fragment.pk  %}">
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   105
                                <div class="center-image">
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   106
                                    <div class="image-and-fragment">
79
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
   107
                                     {% include "partial/picture_and_red_fragment.html" %}
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   108
                                    </div>
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   109
                                </div>
79
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
   110
                                <h3>{{ fragment.title }}</h3></a>
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 78
diff changeset
   111
                                <p>{% trans "Annotated by" %} <strong><a href="{% url 'user_fragments' username=fragment.author %}">{{ fragment.author }}</a></strong></p>
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   112
                            </li>
18
ffd106d9b8e1 Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents: 15
diff changeset
   113
                          {% endfor %}
15
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   114
                        </ul>
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   115
                    </div>
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   116
                </div>
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   117
{% endblock %}
64284803db94 view and create fragment views added
cavaliet
parents:
diff changeset
   118