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/guestconsent
19
 
20
    Template for the guest consent message.
21
 
22
    Classes required for JS:
23
    * eupopup
24
    * policyactions
25
 
26
    Data attributes required for JS:
27
    -
28
 
29
    Context variables required for this template:
30
    * pluginbaseurl
31
    * returnurl - urlencoded URL to return to
32
    * haspolicies - true if there are guest policies; false otherwise
33
    * policies - array of policy documents
34
 
35
    Example context (json):
36
    {
37
        "pluginbaseurl": "https://example.com",
38
        "returnurl": "/",
39
        "haspolicies": true,
40
        "policies": [
41
            {
42
                "id": 1,
43
                "name": "Terms &amp; conditions"
44
            }
45
        ]
46
    }
47
}}
48
 
49
{{#haspolicies}}
50
    {{! Only show message if there is some policy related to guests. }}
51
    <div {{!
52
        }}class="eupopup eupopup-container eupopup-container-block eupopup-container-bottom eupopup-block eupopup-style-compact" {{!
53
        }}role="dialog" {{!
54
        }}aria-label="{{# str }} acceptancepolicies, tool_policy {{/str}}"{{!
55
    }}>
56
    </div>
57
    <div class="eupopup-markup d-none">
58
        <div class="eupopup-head"></div>
59
        <div class="eupopup-body">
60
            {{# str }} guestconsentmessage, tool_policy {{/ str }}
61
            <ul>
62
                {{#policies}}
63
                    <li>
64
                        <a href=\"{{pluginbaseurl}}/view.php?versionid={{id}}{{#returnurl}}&amp;returnurl={{.}}{{/returnurl}} {{!
65
                            }}data-action="view-guest" data-versionid="{{id}}" data-behalfid="1">
66
                            {{{name}}}
67
                        </a>
68
                    </li>
69
                {{/policies}}
70
            </ul>
71
        </div>
72
        <div class="eupopup-buttons">
73
            <a href="#" class="eupopup-button eupopup-button_1">{{# str }} guestconsent:continue, tool_policy {{/ str }}</a>
74
        </div>
75
        <div class="clearfix"></div>
76
        <a href="#" class="eupopup-closebutton">x</a>
77
    </div>
78
 
79
    {{#js}}
80
        require(['jquery', 'tool_policy/jquery-eu-cookie-law-popup', 'tool_policy/policyactions'], function($, Popup, ActionsMod) {
81
            // Initialise the guest popup.
82
            $(document).ready(function() {
83
                // Initialize popup.
84
                $(document.body).addClass('eupopup');
85
                if ($(".eupopup").length > 0) {
86
                    $(document).euCookieLawPopup().init();
87
                }
88
 
89
                // Initialise the JS for the modal window which displays the policy versions.
90
                ActionsMod.init('[data-action="view-guest"]');
91
            });
92
        });
93
    {{/js}}
94
{{/haspolicies}}