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
                {{#indented}}
103
                <div style="float:left">
104
                    {{#pix}} level, tool_policy {{/pix}}
105
                </div>
106
                {{/indented}}
107
                <div {{#indented}}style="margin-left: 24px" {{/indented}}>
108
                    <div>{{{name}}}</div>
109
                    <div class="text-muted, muted"><small>{{{typetext}}}, {{{audiencetext}}}, {{{optionaltext}}}</small></div>
110
                </div>
111
            </td>
112
            <td>
113
                {{{statustext}}}
114
            </td>
115
            <td>
116
                {{revision}}
117
                <div class="text-muted, muted">
118
                    <small>
119
                        <time title="{{#str}} lastmodified, core {{/str}}" datetime="{{#userdate}} {{timemodified}}, %Y-%m-%dT%T%z {{/userdate}}">
120
                            {{#userdate}} {{timemodified}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}
121
                        </time>
122
                    </small>
123
                </div>
124
            </td>
125
            {{#canviewacceptances}}
126
            <td>
127
                {{#acceptancescounturl}}
128
                    <a href="{{acceptancescounturl}}">{{acceptancescounttext}}</a>
129
                {{/acceptancescounturl}}
130
                {{^acceptancescounturl}}
131
                    {{acceptancescounttext}}
132
                {{/acceptancescounturl}}
133
            </td>
134
            {{/canviewacceptances}}
135
            {{#canmanage}}
136
            <td>
137
                {{#actionmenu}}
138
                {{>core/action_menu}}
139
                {{/actionmenu}}
140
            </td>
141
            {{/canmanage}}
142
        </tr>
143
        {{/versions}}
144
    </tbody>
145
</table>
146
 
147
{{#js}}
148
require(['tool_policy/managedocsactions'], function(ManageDocsActions) {
149
    ManageDocsActions.init('tool-policy-managedocs-wrapper');
150
});
151
{{/js}}