src/egonomy/templates/egonomy_annotate_picture.html
author cavaliet
Mon, 22 Apr 2013 12:55:24 +0200
changeset 104 fc6d71473359
parent 79 2a51570e986b
child 140 bfe995fae627
permissions -rw-r--r--
little correction
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
     1
{% extends "egonomy_base.html" %}
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
     2
{% load static %}
aee87529a698 first views with empty templates
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: 40
diff changeset
     5
{% load egonomy_thumbnail %}
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
     6
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
     7
{% block title %}{% trans "Annotate a picture" %}{% endblock %}
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
     8
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
     9
{% block content %}
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    10
                <div class="fullwidth">
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    11
                    <div class="column column-half">
51
d842aad55f81 clean default values in templates
cavaliet
parents: 48
diff changeset
    12
                        <h2>{{ img.metadata.titre|default:_("No title") }}</h2>
48
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 40
diff changeset
    13
                        <div class="fullphoto center-image">
23
bb7819c8d7c2 first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents: 18
diff changeset
    14
                          {% with img.info.image_file as image %}
48
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 40
diff changeset
    15
                          {% if image|ratio > 0.8 %}
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 40
diff changeset
    16
                           {% thumbnail image "476" format="PNG" crop="center" as im %}
18
ffd106d9b8e1 Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents: 15
diff changeset
    17
                            <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
48
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 40
diff changeset
    18
                           {% empty %}
18
ffd106d9b8e1 Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents: 15
diff changeset
    19
                            <img src="{% static 'egonomy/img/empty.gif' %}" width="476" height="476" class="placeholder" />
48
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 40
diff changeset
    20
                           {% endthumbnail %}
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 40
diff changeset
    21
                          {% else %}
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 40
diff changeset
    22
                           {% thumbnail image "x600" format="PNG" crop="center" as im %}
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 40
diff changeset
    23
                            <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 40
diff changeset
    24
                           {% empty %}
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 40
diff changeset
    25
                            <img src="{% static 'egonomy/img/empty.gif' %}" width="476" height="476" class="placeholder" />
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 40
diff changeset
    26
                           {% endthumbnail %}
4c0838a3a8b6 add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents: 40
diff changeset
    27
                          {% endif %}
23
bb7819c8d7c2 first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents: 18
diff changeset
    28
                          {% endwith %}
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    29
                        </div>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    30
                    </div>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    31
                    <div class="column column-half">
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    32
                        <form action="#">
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    33
                        <table class="image-metadata">
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    34
                            <tr>
15
64284803db94 view and create fragment views added
cavaliet
parents: 9
diff changeset
    35
                                <th>{% trans "Description" %}&nbsp;:</th>
51
d842aad55f81 clean default values in templates
cavaliet
parents: 48
diff changeset
    36
                                <td>{{ img.metadata.description|default:"" }}</td>
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    37
                            </tr>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    38
                            <tr>
15
64284803db94 view and create fragment views added
cavaliet
parents: 9
diff changeset
    39
                                <th>{% trans "Author" %}&nbsp;:</th>
51
d842aad55f81 clean default values in templates
cavaliet
parents: 48
diff changeset
    40
                                <td>{{ img.metadata.auteur|default:"" }}</td>
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    41
                            </tr>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    42
                            <tr>
15
64284803db94 view and create fragment views added
cavaliet
parents: 9
diff changeset
    43
                                <th>{% trans "Period" %}&nbsp;:</th>
51
d842aad55f81 clean default values in templates
cavaliet
parents: 48
diff changeset
    44
                                <td>{{ img.metadata.periode|default:"" }}</td>
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    45
                            </tr>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    46
                            <tr>
15
64284803db94 view and create fragment views added
cavaliet
parents: 9
diff changeset
    47
                                <th>{% trans "Production site" %}&nbsp;:</th>
51
d842aad55f81 clean default values in templates
cavaliet
parents: 48
diff changeset
    48
                                <td>{{ img.metadata.site|default:"" }}</td>
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    49
                            </tr>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    50
                            <tr>
15
64284803db94 view and create fragment views added
cavaliet
parents: 9
diff changeset
    51
                                <th>{% trans "Localization" %}&nbsp;:</th>
104
fc6d71473359 little correction
cavaliet
parents: 79
diff changeset
    52
                                <td>{{ img.metadata.localisation|default:"" }}</td>
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    53
                            </tr>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    54
                            <tr>
15
64284803db94 view and create fragment views added
cavaliet
parents: 9
diff changeset
    55
                                <th>{% trans "RMN keywords" %}&nbsp;:</th>
51
d842aad55f81 clean default values in templates
cavaliet
parents: 48
diff changeset
    56
                                <td>{{ img.metadata.mots_cles|default:"" }}</td>
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    57
                            </tr>
66
3a6b48269fa0 add pertimm tags in templates.
cavaliet
parents: 51
diff changeset
    58
                            <tr>
3a6b48269fa0 add pertimm tags in templates.
cavaliet
parents: 51
diff changeset
    59
                                <th>&nbsp;</th>
3a6b48269fa0 add pertimm tags in templates.
cavaliet
parents: 51
diff changeset
    60
                                <td>&nbsp;</td>
3a6b48269fa0 add pertimm tags in templates.
cavaliet
parents: 51
diff changeset
    61
                            </tr>
3a6b48269fa0 add pertimm tags in templates.
cavaliet
parents: 51
diff changeset
    62
                            <tr>
3a6b48269fa0 add pertimm tags in templates.
cavaliet
parents: 51
diff changeset
    63
                                <th>{% trans "Pertimm title" %}&nbsp;:</th>
3a6b48269fa0 add pertimm tags in templates.
cavaliet
parents: 51
diff changeset
    64
                                <td>{{ img.metadata.titre_pertimm|default:"" }}</td>
3a6b48269fa0 add pertimm tags in templates.
cavaliet
parents: 51
diff changeset
    65
                            </tr>
3a6b48269fa0 add pertimm tags in templates.
cavaliet
parents: 51
diff changeset
    66
                            <tr>
3a6b48269fa0 add pertimm tags in templates.
cavaliet
parents: 51
diff changeset
    67
                                <th>{% trans "Pertimm description" %}&nbsp;:</th>
3a6b48269fa0 add pertimm tags in templates.
cavaliet
parents: 51
diff changeset
    68
                                <td>{{ img.metadata.description_pertimm|default:"" }}</td>
3a6b48269fa0 add pertimm tags in templates.
cavaliet
parents: 51
diff changeset
    69
                            </tr>
3a6b48269fa0 add pertimm tags in templates.
cavaliet
parents: 51
diff changeset
    70
                            <tr>
3a6b48269fa0 add pertimm tags in templates.
cavaliet
parents: 51
diff changeset
    71
                                <th>{% trans "Pertimm thesaurus" %}&nbsp;:</th>
69
412ab5e76c65 Clickable tags to easily add tags from rmn and pertimm.
cavaliet
parents: 67
diff changeset
    72
                                <td>{{ img.metadata.thesaurus_pertimm_list|join:","|default:"" }}</td>
66
3a6b48269fa0 add pertimm tags in templates.
cavaliet
parents: 51
diff changeset
    73
                            </tr>
27
daaafc916dc4 Debug in templates. All fragments page added. Language files updated.
cavaliet
parents: 25
diff changeset
    74
                            <!--tr>
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    75
                                <th> </th>
15
64284803db94 view and create fragment views added
cavaliet
parents: 9
diff changeset
    76
                                <td><input class="user-submit" type="submit" value="{% trans 'Save keywords' %}" /></td>
27
daaafc916dc4 Debug in templates. All fragments page added. Language files updated.
cavaliet
parents: 25
diff changeset
    77
                            </tr-->
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    78
                            <tr>
27
daaafc916dc4 Debug in templates. All fragments page added. Language files updated.
cavaliet
parents: 25
diff changeset
    79
                                <th>{% trans "Last fragment created" %}&nbsp;:</th>
69
412ab5e76c65 Clickable tags to easily add tags from rmn and pertimm.
cavaliet
parents: 67
diff changeset
    80
                                <td>{% if last_frg %}<a href="{% url 'view_fragment' fragment_pk=last_frg.pk %}">{{ last_frg.title }}</a>, {{ last_frg.date_saved }} {% trans 'by' %} <strong><a href="{% url 'user_fragments' username=last_frg.author %}">{{ last_frg.author }}</a></strong>{% endif %}</td>
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    81
                            </tr>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    82
                        </table>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    83
                        </form>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    84
                        <div class="fullwidth">
23
bb7819c8d7c2 first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents: 18
diff changeset
    85
                            <a href="{% url 'create_fragment' image_id=img.id %}" class="big-button">{% trans "Create a fragment" %}</a>
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    86
                        </div>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    87
                    </div>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    88
                </div>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    89
                <div class="fullwidth">
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    90
                    <div class="column column-full">
15
64284803db94 view and create fragment views added
cavaliet
parents: 9
diff changeset
    91
                        <h2>{% trans "Fragments from this picture" %}</h2>
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    92
                        <ul class="fullwidth">
79
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 69
diff changeset
    93
                          {% for fragment in fragment_list %}
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    94
                            <li class="subcol subcol-eighth">
79
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 69
diff changeset
    95
                                <a href="{% url 'view_fragment' fragment_pk=fragment.pk  %}">
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    96
                                <div class="center-image">
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    97
                                    <div class="image-and-fragment">
79
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 69
diff changeset
    98
                                     {% include "partial/picture_and_red_fragment.html" %}
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    99
                                    </div>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
   100
                                </div>
79
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 69
diff changeset
   101
                                <h3>{{ fragment.title }}</h3></a>
2a51570e986b Efficiant template code factorization.
cavaliet
parents: 69
diff changeset
   102
                                <p>{% trans "Annotated by" %} <strong><a href="{% url 'user_fragments' username=fragment.author %}">{{ fragment.author }}</a></strong></p>
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
   103
                            </li>
18
ffd106d9b8e1 Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents: 15
diff changeset
   104
                          {% endfor %}
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
   105
                        </ul>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
   106
                    </div>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
   107
                </div>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
   108
{% endblock %}
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
   109