Gitlab CSE Unil

tool_form.mustache 6.8 KB
Newer Older
M. Chardon's avatar
M. Chardon committed
1
2
3
4
5
6
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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
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
136
137
138
{{!
    @template assignfeedback_editpdfplus/tool_form
}}

<div class="alert" id="message_edit_tool">
    
</div>

<div class='row' style="margin-bottom: 10px;">
    <div class='col-sm-1'>
        <div id="editpdlplus_tool_label"></div>
    </div>
    <div class='col-sm-offset-2 col-sm-5'>
        Actions :
        <button type="button" class="btn btn-default" id="toolFormSubmit"><i class="fa fa-pencil" aria-hidden="true"></i></button>
        <button type="button" class="btn btn-default"><i class="fa fa-clone" aria-hidden="true"></i></button>
        <button type="button" class="btn btn-default"><i class="fa fa-eye-slash" aria-hidden="true"></i></button>
        <button type="button" class="btn btn-default"><i class="fa fa-remove" aria-hidden="true"></i></button>
    </div>
</div>

<div class='row'>
    <div class='col-sm-6'>
        <form id="{{formid}}" method="post" action="{{actionurl}}" class="form-horizontal">

            <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 }}
                                    <option value='{{id}}'>{{label}}</option>
                                    {{/ tools }}
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <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>
                        </div>
                        <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>
                        </div>
                    </div>
                </div>
            </div>

            <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>
                        </div>
                        <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>
                        </div>
                    </div>
                </div>
            </div>

            <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>
                        </div>
                        <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>
                        </div>
                        <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}} value="{{tool.reply}}" name="reply" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div style='display:none;'>
                <input type="hidden" name="toolid" value="{{tool.id}}" />
                <input type="hidden" name="courseid" value="{{courseid}}" />
                <input type="hidden" name="sesskey" value="{{sesskey}}" />
            </div>

        </form>
    </div>
    <div class='col-sm-6'>
    </div>
</div>

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

    $("#typetool").val({{tool.type}});

});
{{/ js }}