Gitlab CSE Unil

annotation_new.html 3.27 KB
Newer Older
Julien Furrer's avatar
Julien Furrer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{% extends "adim_app/base_annotation.html" %}
{% load static i18n %}

{% block page_head %}{% endblock %}

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


{% block inline_script %}
    {{ block.super }}

<script>
window.ADIM_CONFIG = {
    mode: "edit",
    csrfToken: "{{ csrf_token }}",
20
    baseUrl: "{% url "adim.app:annotate-new" %}",
21
22
    staticUrl: "{% static "" %}",
    userEngine: { remoteUrl: "{% url "adim.app:suggest-users" %}?q=%QUERY" },
Julien Furrer's avatar
Julien Furrer committed
23
24

    api: {
25
26
27
28
29
30
31
32
33
34
        baseUrl: "{% url "api-root" %}",
        annotables: "{% url "anobj-list" %}",
        shared_anobj: "{% url "shared-anobj-list" %}"
    },

    user: {
        id: {{ user.id }},
        username: "{{ user.username }}",
        fullName: "{{ user.get_full_name }}",
        full_name: "{{ user.get_full_name }}"
35
        ,shibboleth: true
Julien Furrer's avatar
Julien Furrer committed
36
37
38
39
40
41
42
    },

    ui: {
        show_side_col: false,
        initial_tool: 'select'
    },

43
    uploadMaxFileSize: parseInt("{{ UPLOAD_MAX_FILESIZE }}") * Math.pow(2, 20)
Julien Furrer's avatar
Julien Furrer committed
44
45
46
47
48
49
};
</script>
{% endblock %}

{% block content_js %}
    {{ block.super }}
50
    <script src="{% static "js/libs/require.min.js" %}" data-main="{% static "js/newao_app" %}{{ JS_MIN }}"></script>
Julien Furrer's avatar
Julien Furrer committed
51
52
53
54
55
56
{% endblock %}

{% block canvas_content %}
    <div class="dropzone">
        <div class="dropzone-inner-wrapper">
            <div class="dropzone-inner adim-fu-status">
57
58
59
60
61
62
                <p>
                    Pour <strong>ajouter une image</strong>, glissez un fichier ici ou cliquez&nbsp;sur&nbsp;
                    <span class="btn btn-success btn-sm navbar-btn fileinput-button">
                        <span class="glyphicon glyphicon-plus"></span>&nbsp;
                        <span>Nouvelle image</span>
                        <input id="fileupload" type="file" name="image_file" data-url="{% url "adim.app:upload_file" %}"
63
                               accept="image/png,image/jpg,image/jpeg">
64
65
66
67
68
                    </span>
                </p>

                <p>
                    Pour <strong>choisir une image</strong> de votre collection, cliquez&nbsp;sur&nbsp;
Julien Furrer's avatar
Julien Furrer committed
69
                    <button type="button" class="btn btn-sm btn-default navbar-btn aom-show-but">
70
71
72
73
                        <span class="glyphicon glyphicon-th"></span> Mes images
                    </button>
                </p>

Julien Furrer's avatar
Julien Furrer committed
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100

                <div class="progress-wrapper hide">
                    <div class="progress">
                        <div class="progress-bar" role="progressbar" style="width: 0%;">
                            0%
                        </div>
                    </div>
                </div>

                <div class="alert alert-danger hide adim-fu-error-box">
                    <strong>Impossible de charger l'image.</strong>

                    <div class="adim-fu-error-maxFileSize hide">
                        Ce fichier est trop volumineux, la taille maximale acceptée est 2Mb.
                    </div>
                    <div class="adim-fu-error-acceptFileTypes hide">
                        Ce type de document ne peut pas être chargé. Seules les images de type PNG (<code>.png</code>)
                        ou JPG (.jpg, .jpeg) sont accéptées.
                    </div>
                </div>

            </div>
        </div>
    </div>
{% endblock canvas_content %}