Gitlab CSE Unil

annotation.html 5.2 KB
Newer Older
Julien Furrer's avatar
Julien Furrer committed
1
2
3
4
5
{% extends "adim_app/base_annotation.html" %}
{% load static i18n %}

{%  block navbar_content %}
    <ul class="nav navbar-nav">
6
        <li><a href="#" class="adim-image-name {{ is_owner|yesno:",read-only" }}">
Julien Furrer's avatar
Julien Furrer committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
            <span class="text">{{ anobj.name }}</span>
        </a></li>
    </ul>
    {{ block.super }}
{%  endblock navbar_content %}

{% block navbar_right_content %}
    <li>
      <a href="#" class="dropdown-toggle" data-toggle="dropdown">
          <span class="glyphicon glyphicon-download-alt"></span>
          Exporter <span class="caret"></span>
      </a>
      <ul class="dropdown-menu" role="menu">
        <li><a id="btn-export-image-png" href="#">PNG</a></li>
        <li><a id="btn-export-image-svg" href="#">SVG</a></li>
      </ul>
    </li>
    {{ block.super }}
{% endblock %}


{% block overlay %}
<div id="page-loader">
    <div class="text-muted lead">Chargement...</div>
</div>
{% endblock %}


{% block inline_script %}
    {{ block.super }}
<script>
window.ADIM_CONFIG = {
    mode: "edit",
    csrfToken: "{{ csrf_token }}",
41
42
    staticUrl: "{% static "" %}",
    baseUrl: "{% url "adim.app:annotate-new" %}",
43
    userEngine: { remoteUrl: "{% url "adim.app:suggest-users" %}?q=%QUERY" },
44

Julien Furrer's avatar
Julien Furrer committed
45
46
    api: {
        baseUrl: "{% url "api-root" %}",
47
        annotables: "{% if is_owner %}{% url "anobjs-list" %}{% else %}{% url "shared-anobjs-list" %}{% endif %}",
Julien Furrer's avatar
Julien Furrer committed
48
        annotations: "{% url "annotations-list" %}"
Julien Furrer's avatar
Julien Furrer committed
49
50
51
52
    },

    annotable: {
        id: {{ anobj.id }},
53
        uuid: '{{ anobj.uuid }}',
Julien Furrer's avatar
Julien Furrer committed
54
55
        title: '{{ anobj.name|escapejs }}',
        slug: '{{ anobj.name|slugify }}',
56
        locked: {{ anobj.locked|yesno:"true,false" }},
57
        image: '{{ anobj.image_url|default:"image/" }}',
58
59
        thumbnail: 'thumb/'
{#        image: '{% url "adim.app:ao_image" anobj_uuid=anobj.uuid %}'#}
Julien Furrer's avatar
Julien Furrer committed
60
61
62
63
64
65
66
67
    },
    users: {},

    user: {
        id: {{ user.id }},
        username: "{{ user.username }}",
        fullName: "{{ user.get_full_name }}",
        full_name: "{{ user.get_full_name }}",
68
        token: "{{ user.auth_token }}"
69
        {% if membership %}
70
        ,membership: { publish_mode: {{ membership.publish_mode }} }
71
        {% endif %}
72
        ,guest: {{ is_owner|yesno:"false,true" }}
73
        ,shibboleth: true
Julien Furrer's avatar
Julien Furrer committed
74
75
76
    },

    ui: {
77
        show_side_col: true,
78
79
        initial_tool: 'select',
        show_users_results: {{ display_shared_annotations|yesno:"true,false" }}
Julien Furrer's avatar
Julien Furrer committed
80
81
    },

82
83
    aai: {slo: {{ AAI_CFG.SLO|yesno:"true,false" }} },

Julien Furrer's avatar
Julien Furrer committed
84
85
    thumbnailSize: parseInt("{{ THUMB_SIZE.0 }}", 10),
    uploadMaxFileSize: parseInt('{{ UPLOAD_MAX_FILESIZE }}',10) * Math.pow(2, 20)
Julien Furrer's avatar
Julien Furrer committed
86
};
87
88
console.time("complete app");
console.time("main app loading");
Julien Furrer's avatar
Julien Furrer committed
89
90
91
92
93
</script>
{% endblock %}

{% block content_js %}
    {{ block.super }}
94
    <script type="application/javascript" src="{% static "js/libs/require.min.js" %}" data-main="{% static "js/su_app" %}{{ JS_MIN }}"></script>
Julien Furrer's avatar
Julien Furrer committed
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{% endblock %}


{#==========================================#}
{#   MODALS                                 #}
{#==========================================#}
{% block modals %}
    {{ block.super }}
    <div class="modal" id="adim-name-modal">
        <div class="modal-dialog">
            <form class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title">Changer le nom de l'image</h4>
                </div>
                <div class="modal-body">
                    <p>Entrer un nouveau nom pour l'image</p>
                    <input type="text" class="form-control" name="imageName" placeholder="Nom de l'image"/>

                    <div class="errors hide">
                        <p>&nbsp;</p>
                        <div class="alert alert-danger">
                            <strong>Erreur</strong> une erreur est survenue lors de l'enregistrement: <br/>
                            <code class="error-text"></code>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
                    <button type="submit" class="btn btn-primary">Enregistrer</button>
                </div>
            </form>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div><!-- /.modal -->
{% endblock modals %}

{%  block main_container %}
    {{ block.super }}
136
{#    <img src='{{ anobj.image_url|default:"./image/" }}' crossorigin="anonymous" id="adim-src-image" style="display:none;">#}
Julien Furrer's avatar
Julien Furrer committed
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153

    <div class="modal" id="dlg-export-svg-info" data-backdrop="static" data-keyboard="false">
        <div class="modal-dialog modal-sm">
            <div class="modal-content">
                <div class="modal-header">
                    <h4>Exportation en cours...</h4>
                </div>
                <div class="modal-body">
                    <p>La génération du svg peut prendre un peu de temps, soyez patient.</p>
                </div>
                <div class="modal-footer"></div>
            </div>
        </div>
    </div>

{%  endblock main_container %}