Gitlab CSE Unil

tool_form.mustache 7.8 KB
Newer Older
M. Chardon's avatar
M. Chardon committed
1
2
3
4
5
{{!
    @template assignfeedback_editpdfplus/tool_form
}}

<div class="alert" id="message_edit_tool">
M. Chardon's avatar
M. Chardon committed
6

M. Chardon's avatar
M. Chardon committed
7
8
</div>

M. Chardon's avatar
M. Chardon committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<div id="toolworkspace">
    <div class='row' style="margin-bottom: 10px;">
        {{^tool.id}}<h4>Ajout d'un nouvel outil</h4>{{/tool.id}}
        <div class='col-sm-1'>
            <div id="editpdlplus_tool_label">{{#tool.id}}{{tool.label}}{{/tool.id}}</div>
        </div>
        <div class='col-sm-offset-2 col-sm-5'>
            Action{{#tool.id}}s{{/tool.id}} :
            <button type="button" class="btn btn-default" id="toolFormSubmit"><i class="fa fa-{{#tool.id}}pencil{{/tool.id}}{{^tool.id}}save{{/tool.id}}" aria-hidden="true"></i></button>
            {{#tool.id}}
            <button type="button" class="btn btn-default" id="toolClone"><i class="fa fa-clone" aria-hidden="true"></i></button>
            <button type="button" class="btn btn-default" id="toolEnabled"><i class="fa fa-eye{{^tool.enabled}}-slash{{/tool.enabled}}" aria-hidden="true"></i></button>
            <button type="button" class="btn btn-default {{^tool.removable}}disabled{{/tool.removable}}" id="toolRemove"><i class="fa fa-remove" aria-hidden="true"></i></button>
            {{/tool.id}}
        </div>
M. Chardon's avatar
M. Chardon committed
24
25
    </div>

M. Chardon's avatar
M. Chardon committed
26
27
28
    <div class='row'>
        <div class='col-sm-6'>
            <form id="{{formid}}" method="post" action="{{actionurl}}" class="form-horizontal">
M. Chardon's avatar
M. Chardon committed
29

M. Chardon's avatar
M. Chardon committed
30
31
32
33
34
35
36
37
38
39
40
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <i class="fa fa-wrench" aria-hidden="true"></i>&nbsp;&nbsp;<a data-toggle="collapse" href="#collapse1">Type d'outil</a>
                    </div>
                    <div id="collapse1" class="panel-collapse collapse">
                        <div class="panel-body" style="margin-bottom: 20px;">
                            <div class="form-group">
                                <label class="control-label col-sm-3" for="typetool">Type</label>
                                <div class="col-sm-9">
                                    <select class="form-control" id="typetool" name="typetool">
                                        {{# tools }}
41
                                        <option value='{{id}}'>{{libelle}}</option>
M. Chardon's avatar
M. Chardon committed
42
43
44
                                        {{/ tools }}
                                    </select>
                                </div>
M. Chardon's avatar
M. Chardon committed
45
46
47
48
49
                            </div>
                        </div>
                    </div>
                </div>

M. Chardon's avatar
M. Chardon committed
50
51
52
53
54
55
56
57
58
59
60
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <i class="fa fa-bars" aria-hidden="true"></i>&nbsp;&nbsp;<a data-toggle="collapse" href="#collapse2">Affichage barre d'outil</a>
                    </div>
                    <div id="collapse2" class="panel-collapse collapse">
                        <div class="panel-body" style="margin-bottom: 50px;">
                            <div class="form-group">
                                <label class="control-label col-sm-3" for="button">Bouton</label>
                                <div class="col-sm-9">
                                    <input type="text" class="form-control" id="button" value="{{tool.label}}" name="button" />
                                </div>
M. Chardon's avatar
M. Chardon committed
61
                            </div>
M. Chardon's avatar
M. Chardon committed
62
63
64
65
66
                            <div class="form-group">
                                <label class="control-label col-sm-3" for="order">Ordre</label>
                                <div class="col-sm-9">
                                    <input type="number" class="form-control" id="order" value="{{tool.order_tool}}" name="order" />
                                </div>
M. Chardon's avatar
M. Chardon committed
67
68
69
70
71
                            </div>
                        </div>
                    </div>
                </div>

M. Chardon's avatar
M. Chardon committed
72
73
74
75
76
77
78
79
80
81
82
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <i class="fa fa-address-card-o" aria-hidden="true"></i>&nbsp;&nbsp;<a data-toggle="collapse" href="#collapse3">Cartouche</a>
                    </div>
                    <div id="collapse3" class="panel-collapse collapse">
                        <div class="panel-body" style="margin-bottom: 50px;">
                            <div class="form-group">
                                <label class="control-label col-sm-3" for="libelle">Libellé</label>
                                <div class="col-sm-9">
                                    <input type="text" class="form-control" id="libelle" value="{{tool.cartridge}}" name="libelle" />
                                </div>
M. Chardon's avatar
M. Chardon committed
83
                            </div>
M. Chardon's avatar
M. Chardon committed
84
85
86
87
88
89
                            <div class="form-group">
                                <label class="control-label col-sm-3" for="cartridgecolor">Couleur</label>
                                <div class="col-sm-9">
                                    <input type="text" class="form-control" id="cartridgecolor" placeholder="{{^tool.cartridge_color}}-{{/tool.cartridge_color}}"
                                           value="{{#tool.cartridge_color}}{{tool.cartridge_color}}{{/tool.cartridge_color}}" name="catridgecolor" />
                                </div>
M. Chardon's avatar
M. Chardon committed
90
91
92
93
94
                            </div>
                        </div>
                    </div>
                </div>

M. Chardon's avatar
M. Chardon committed
95
96
97
98
99
100
101
102
103
104
105
106
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <i class="fa fa-pencil-square-o" aria-hidden="true"></i>&nbsp;&nbsp;<a data-toggle="collapse" href="#collapse4">Annotation</a>
                    </div>
                    <div id="collapse4" class="panel-collapse collapse">
                        <div class="panel-body" style="margin-bottom: 80px;">
                            <div class="form-group">
                                <label class="control-label col-sm-3" for="color">Couleur</label>
                                <div class="col-sm-9">
                                    <input type="text" class="form-control" id="color" placeholder="{{^tool.colors}}-{{/tool.colors}}"
                                           value="{{#tool.colors}}{{tool.colors}}{{/tool.colors}}" name="color" />
                                </div>
M. Chardon's avatar
M. Chardon committed
107
                            </div>
M. Chardon's avatar
M. Chardon committed
108
109
110
111
112
                            <div class="form-group">
                                <label class="control-label col-sm-3" for="texts">Texte prédéfinis</label>
                                <div class="col-sm-9">
                                    <input type="text" class="form-control" id="texts" value="{{tool.texts}}" name="texts" />
                                </div>
M. Chardon's avatar
M. Chardon committed
113
                            </div>
M. Chardon's avatar
M. Chardon committed
114
115
116
117
118
                            <div class="form-group">
                                <label class="control-label col-sm-3" for="reply">Question/réponse</label>
                                <div class="col-sm-9">
                                    <input type="checkbox" class="form-control" id="reply" {{#tool.reply}}checked {{/tool.reply}}name="reply" />
                                </div>
M. Chardon's avatar
M. Chardon committed
119
120
121
122
                            </div>
                        </div>
                    </div>
                </div>
M. Chardon's avatar
M. Chardon committed
123

M. Chardon's avatar
M. Chardon committed
124
125
126
127
128
129
130
                <div style='display:none;'>
                    <input type="hidden" name="toolid" value="{{tool.id}}" />
                    <input type="hidden" name="axisid" value="{{tool.axis}}" />
                    <input type="hidden" name="courseid" value="{{courseid}}" />
                    <input type="hidden" name="sesskey" value="{{sesskey}}" />
                    <input type="hidden" name="enabled" id="toolenabled" value="{{tool.enabled}}" />
                </div>
M. Chardon's avatar
M. Chardon committed
131

M. Chardon's avatar
M. Chardon committed
132
133
134
135
            </form>
        </div>
        <div class='col-sm-6'>
        </div>
M. Chardon's avatar
M. Chardon committed
136
137
138
139
140
141
    </div>
</div>

{{# js }}
require(['jquery','core/ajax','core/notification'], function($,ajax,notification) {

M. Chardon's avatar
M. Chardon committed
142
{{#tool.id}}$("#typetool").val({{tool.type}});{{/tool.id}}
M. Chardon's avatar
M. Chardon committed
143
144
145

});
{{/ js }}