Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
{{!
2
    This file is part of Moodle - http://moodle.org/
3
 
4
    Moodle is free software: you can redistribute it and/or modify
5
    it under the terms of the GNU General Public License as published by
6
    the Free Software Foundation, either version 3 of the License, or
7
    (at your option) any later version.
8
 
9
    Moodle is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
    GNU General Public License for more details.
13
 
14
    You should have received a copy of the GNU General Public License
15
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16
}}
17
{{!
18
    @template tool_policy/page_managedocs_list
19
 
20
    Template for the policy documents management page.
21
 
22
    Classes required for JS:
23
    -
24
 
25
    Data attributes required for JS:
26
    * data-policy-name
27
    * data-policy-revision
28
    * data-action
29
 
30
    Context variables required for this template:
31
    * haspolicies
32
    * policies
33
 
34
    Example context (json):
35
    {
36
        "title": "Manage policies",
37
        "backurl": "/",
38
        "pluginbaseurl": "/admin/tool/policy/",
39
        "canviewacceptances": true,
40
        "canmanage": true,
41
        "versions": [
42
            {
43
                "id": 1,
44
                "name": "Terms &amp; conditions",
45
                "typetext": "Site policy",
46
                "audiencetext": "All users",
47
                "statustext": "Active",
48
                "optionaltext": "Optional",
49
                "revision": "1.0",
50
                "timemodified": 1521531208,
51
                "acceptancescounturl": "#",
52
                "acceptancescounttext": "10 out of 1000 (1%)"
53
            },
54
            {
55
                "indented": true,
56
                "name": "Terms &amp; conditions",
57
                "typetext": "Site policy",
58
                "audiencetext": "All users",
59
                "statustext": "Draft",
60
                "optionaltext": "Compulsory",
61
                "revision": "2.0",
62
                "timemodified": 1521531208,
63
                "acceptancescounttext": "N/A"
64
            }
65
        ]
66
    }
67
}}
68
<h2>{{{title}}}</h2>
69
{{#backurl}}
70
    <div>
71
        <div class="btn-group">
72
            <a href="{{backurl}}" class="btn btn-secondary">{{#str}} back {{/str}}</a>
73
        </div>
74
    </div>
75
{{/backurl}}
76
{{#canaddnew}}
77
    <div>
78
        <div class="btn-group">
79
            <a href="{{pluginbaseurl}}/editpolicydoc.php" class="btn btn-primary">{{#str}} newpolicy, tool_policy {{/str}}</a>
80
        </div>
81
    </div>
82
{{/canaddnew}}
83
 
84
<table id="tool-policy-managedocs-wrapper" class="generaltable fullwidth listpolicydocuments">
85
    <thead>
86
        <tr>
87
            <th scope="col">{{#str}} policydocname, tool_policy {{/str}}</th>
88
            <th scope="col">{{#str}} status, tool_policy {{/str}}</th>
89
            <th scope="col">{{#str}} policydocrevision, tool_policy {{/str}}</th>
90
            {{#canviewacceptances}}
91
            <th scope="col">{{#str}} usersaccepted, tool_policy {{/str}}</th>
92
            {{/canviewacceptances}}
93
            {{#canmanage}}
94
            <th scope="col"></th>
95
            {{/canmanage}}
96
        </tr>
97
    </thead>
98
    <tbody>
99
        {{#versions}}
100
        <tr data-policy-name="{{{name}}}" data-policy-revision="{{revision}}">
101
            <td>
102
                <div class="d-inline-flex">
103
                    {{#indented}}
104
                    <div>
105
                        <svg
106
                        width="24"
107
                        height="24"
108
                        viewBox="0 0 24 24"
109
                        fill="none"
110
                        xmlns="http://www.w3.org/2000/svg"
111
                        >
112
                        <path
113
                            d="M6.85046 13.4005C5.74589 13.4005 4.85046 12.5051 4.85046 11.4005V3.40051H2.85046V11.4005C2.85046 13.6097 4.64132 15.4005 6.85046 15.4005H17.156L13.3714 19.1852L14.7856 20.5994L21.1495 14.2354L14.7856 7.87146L13.3714 9.28567L17.4862 13.4005H6.85046Z"
114
                            fill="currentColor"
115
                        />
116
                        </svg>
117
                    </div>
118
                    {{/indented}}
119
                    <div {{#indented}}style="margin-left: 1rem" {{/indented}}>
120
                        <div class="mt-1">{{{name}}}</div>
121
                        <div><small>{{{typetext}}}, {{{audiencetext}}}, {{{optionaltext}}}</small></div>
122
                    </div>
123
                </div>
124
            </td>
125
            <td>
126
                {{{statustext}}}
127
            </td>
128
            <td>
129
                {{revision}}
130
                <div class="text-muted, muted">
131
                    <small>
132
                        <time title="{{#str}} lastmodified, core {{/str}}" datetime="{{#userdate}} {{timemodified}}, %Y-%m-%dT%T%z {{/userdate}}">
133
                            {{#userdate}} {{timemodified}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}
134
                        </time>
135
                    </small>
136
                </div>
137
            </td>
138
            {{#canviewacceptances}}
139
            <td>
140
                {{#acceptancescounturl}}
141
                    <a href="{{acceptancescounturl}}">{{acceptancescounttext}}</a>
142
                {{/acceptancescounturl}}
143
                {{^acceptancescounturl}}
144
                    {{acceptancescounttext}}
145
                {{/acceptancescounturl}}
146
            </td>
147
            {{/canviewacceptances}}
148
            {{#canmanage}}
149
            <td>
150
                {{#actionmenu}}
151
                {{>core/action_menu}}
152
                {{/actionmenu}}
153
            </td>
154
            {{/canmanage}}
155
        </tr>
156
        {{/versions}}
157
    </tbody>
158
</table>
159
 
160
{{#js}}
161
require(['tool_policy/managedocsactions'], function(ManageDocsActions) {
162
    ManageDocsActions.init('tool-policy-managedocs-wrapper');
163
});
164
{{/js}}