Gitlab CSE Unil

admin.mustache 9.63 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
M. Chardon's avatar
M. Chardon committed
17
18
{{!
    @template assignfeedback_editpdfplus/admin
19
20
21
22
23
24

    Admin template for manage axis.

    Context variables required for this template:
    * context - Context id
    * axisimportform - Moodle form to import an axis
M. Chardon's avatar
M. Chardon committed
25
26
    * modeldeleteform
    * axisdeleteform
27
28
29
30
    * toolbars - All toolbars for the current course
    * axis - All axis for the current coure
    * toollibs - All avaibled type's tool
    * toolbarsDispo - All toolbars which can be import by the current user
M. Chardon's avatar
M. Chardon committed
31
32
33
34
35
}}

<div class="assignfeedback_editpdfplus_widget_admin">                                                                                                             
    <h5>{{# str }} adminsubtitle, assignfeedback_editpdfplus {{/ str }}</h5> 

M. Chardon's avatar
M. Chardon committed
36
37
38
39
40
41
42
43
    <ul class="nav nav-tabs m-b-2">
        <li class="nav-item">
            <a class="nav-link {{#model}}active{{/model}}" data-toggle="tab" href="#import">{{# str }} adminaxisimporttitle, assignfeedback_editpdfplus {{/ str }}</a>
        </li>
        <li class="nav-item">
            <a class="nav-link {{^model}}active{{/model}}" data-toggle="tab" href="#currenttoolbar">{{# str }} admincurrenttoolbar, assignfeedback_editpdfplus {{/ str }}</a>
        </li>
    </ul>
M. Chardon's avatar
M. Chardon committed
44

M. Chardon's avatar
M. Chardon committed
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
    <div class="tab-content">
        <div class="tab-pane container {{#model}}active{{/model}}{{^model}}fade{{/model}}" id="import">
            {{# str }} adminaxisimport, assignfeedback_editpdfplus {{/ str }}
            {{{ axisimportform.render }}}
            {{{ modeldeleteform.render }}}
            <div id="message_del_modal" class="alert" style="display:none;"></div>
            <table class='table table-bordered table-striped'>
                <thead>
                    <tr>
                        <th>{{# str }} adminaxisimport_name, assignfeedback_editpdfplus {{/ str }}</th>
                        <th>{{# str }} adminaxisimport_tool, assignfeedback_editpdfplus {{/ str }}</th>
                        <th>{{# str }} adminaxisimport_action, assignfeedback_editpdfplus {{/ str }}</th>
                        <th>{{# str }} adminaxisimport_delete, assignfeedback_editpdfplus {{/ str }}</th>
                    </tr>
                </thead>
                <tbody>
                    {{# toolbarsDispo }}
                    <tr>
                        <td>{{model.label}}</td>
                        <td>
                            <div class="btn-group">
                                {{# tools }}
                                <button class="btn" style="{{style}}">
                                    {{label}}
                                </button>
                                {{/ tools }}
                            </div>
                        </td>
                        <td>
                            <button class='btn btn-primary btn-sm btnimport' data-axis='{{axis.id}}'><i class='fa fa-download'></i></button>
                        </td>
                        <td>
                            <button class='btn btn-danger btn-sm btnimportdel' data-model='{{model.id}}'><i class='fa fa-remove'></i></button>
                        </td>
                    </tr>
                    {{/ toolbarsDispo }}
                </tbody>
            </table>
M. Chardon's avatar
M. Chardon committed
83
        </div>
M. Chardon's avatar
M. Chardon committed
84
85
86
87


        <div class="tab-pane container {{#model}}fade{{/model}}{{^model}}active{{/model}}" id="currenttoolbar">
            {{{ axisdeleteform.render }}}
M. Chardon's avatar
M. Chardon committed
88
            <div id="message_import_axis" class="alert" style="display:none;"></div>
M. Chardon's avatar
M. Chardon committed
89
            <div id="message_export_axis" class="alert" style="display:none;"></div>
90
            <div id="message_order_tool" class="alert" style="display:none;"></div>
91
            <table>
M. Chardon's avatar
M. Chardon committed
92
                <tr>
93
                    <td class='assignfeedback_editpdfplus_widget_admin_col1'>
M. Chardon's avatar
M. Chardon committed
94
95
                        <h6>
                            {{# str }} adminaxis, assignfeedback_editpdfplus {{/ str }}
96
                            <button type="button" class="btn" id="assignfeedback_editpdfplus_widget_admin_button_addaxis">
M. Chardon's avatar
M. Chardon committed
97
                                <i class="fa fa-plus" aria-hidden="true"></i>
M. Chardon's avatar
M. Chardon committed
98
                            </button>
M. Chardon's avatar
M. Chardon committed
99
100
                        </h6>
                    </td>
101
                    <td id='assignfeedback_editpdfplus_widget_admin_toolheader' class='assignfeedback_editpdfplus_widget_admin_col2'>
M. Chardon's avatar
M. Chardon committed
102
103
                        <h6>
                            {{# str }} admintools, assignfeedback_editpdfplus {{/ str }}
104
                            <button type="button" class="btn" id="assignfeedback_editpdfplus_widget_admin_button_addtool">
M. Chardon's avatar
M. Chardon committed
105
                                <i class="fa fa-plus" aria-hidden="true"></i>
M. Chardon's avatar
M. Chardon committed
106
                            </button>
M. Chardon's avatar
M. Chardon committed
107
108
                        </h6>
                    </td>
109
                    <td></td>
M. Chardon's avatar
M. Chardon committed
110
111
                </tr>
                <tr id='assignfeedback_editpdfplus_widget_admin_workspace'>
112
                    <td  id='editpdlplus_axes_worspace' class='assignfeedback_editpdfplus_widget_admin_col1'>
M. Chardon's avatar
M. Chardon committed
113
114
                        <select id='editpdlplus_axes' class='form-control'>
                            {{# axis }}
M. Chardon's avatar
M. Chardon committed
115
                            <option value="{{id}}" data-delete="{{containannotations}}" data-nbtool="{{children}}">{{label}}</option>
M. Chardon's avatar
M. Chardon committed
116
117
                            {{/ axis }}
                        </select>
M. Chardon's avatar
M. Chardon committed
118
119
                        <div class="card" id="axistool">
                            <div class="card-body" style="text-align: center;">
120
                                <button type="button" class="btn" id="assignfeedback_editpdfplus_widget_admin_button_editaxis">
M. Chardon's avatar
M. Chardon committed
121
122
                                    <i class="fa fa-pencil" aria-hidden="true"></i>
                                </button>
M. Chardon's avatar
M. Chardon committed
123
124
125
126
                                <button type="button" class="btn" id="assignfeedback_editpdfplus_widget_admin_button_exportaxis">
                                    <i class="fa fa-upload" aria-hidden="true"></i>
                                </button>
                                <button type="button" class="btn btn-danger" id="assignfeedback_editpdfplus_widget_admin_button_delaxis">
M. Chardon's avatar
M. Chardon committed
127
128
129
130
131
                                    <i class="fa fa-remove" aria-hidden="true"></i>
                                </button>
                            </div>
                        </div>
                    </td>
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
                    <td>
                        <div class="d-flex">
                            <div id='assignfeedback_editpdfplus_widget_admin_toolworkspace' class='assignfeedback_editpdfplus_widget_admin_col2 w-100'>
                                <div id='editpdlplus_toolbars'>
                                    {{# toolbars }}
                                    <div id="editpdlplus_toolbar_{{axis.id}}" class="btn-group toolbar sortable" style="display: none;width: 100%;">
                                        <ul class="sortable" style="list-style-type: none;margin: 0;padding: 0;width: 100%;">
                                            {{# tools }}
                                            <li style="float: left;display: block;">
                                                <button class="btn {{button}} editpdlplus_tool" id="editpdlplus_tool_{{id}}" value="{{id}}" style="{{style}}" data-enable="{{enabled}}">
                                                    {{label}}
                                                </button>
                                            </li>
                                            {{/ tools }}
                                        </ul>
                                    </div>
                                    {{/ toolbars }}
                                </div>
                                {{{ toolorderform.render }}}
M. Chardon's avatar
M. Chardon committed
151

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

154
155
                                <div id="editpdlplus_tool_item"></div>
                            </div>
156
157
                            <div id="assignfeedback_editpdfplus_widget_admin_div_axis" style="display:none;" class="assignfeedback_editpdfplus_widget_admin_div_axis">
                                <div id="assignfeedback_editpdfplus_widget_admin_div_addaxis" style="display:none;" class="card w-100 ml-2 border-primary">
158
                                </div>
159
                                <div id="assignfeedback_editpdfplus_widget_admin_div_editaxis" style="display:none;" class="card w-100 ml-2 border-primary">
160
                                </div>
161
                                <div id="assignfeedback_editpdfplus_widget_admin_div_delaxis" style="display:none;" class="card w-100 ml-2 border-primary">
162
                                </div>
163
                                <div id="assignfeedback_editpdfplus_widget_admin_div_exportaxis" style="display:none;" class="card w-100 ml-2 border-primary">
164
165
                                </div>
                            </div>   
M. Chardon's avatar
M. Chardon committed
166
                        </div>
M. Chardon's avatar
M. Chardon committed
167
168
169
                    </td>
                </tr>
            </table>
M. Chardon's avatar
M. Chardon committed
170
171
        </div>
    </div>
M. Chardon's avatar
M. Chardon committed
172

M. Chardon's avatar
M. Chardon committed
173
174
175
176
</div>

{{# js }}
require(['assignfeedback_editpdfplus/admin_panel'], function(AdminPanel) {
M. Chardon's avatar
M. Chardon committed
177
var adminpanel = new AdminPanel({{context.id}},'{{{toollibs}}}');
M. Chardon's avatar
M. Chardon committed
178
179
});
{{/ js }}