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 enrol_fee/payment_region
19
 
20
    This template will render information about course fee along with a button for payment.
21
 
22
    Classes required for JS:
23
    * none
24
 
25
    Data attributes required for JS:
26
    * data-component
27
    * data-paymentarea
28
    * data-itemid
29
    * data-cost
30
    * data-description
31
    * data-successurl
32
 
33
    Context variables required for this template:
34
    * cost - Human readable cost string including amount and currency
35
    * instanceid - Id of the enrolment instance
36
    * description - The description for this purchase
37
    * successurl - The URL of the course
38
 
39
    Example context (json):
40
    {
41
        "cost": "$108.50",
42
        "instanceid": 11,
43
        "description": "Enrolment in course Introduction to algorithms",
44
        "successurl": "https://moodlesite/course/view.php?id=2",
45
        "isguestuser": false
46
    }
47
 
48
}}
49
<div class="enrol_fee_payment_region text-center">
50
    {{#isguestuser}}
51
        <div class="mdl-align">
52
            <p>{{# str }} paymentrequired {{/ str}}</p>
53
            <p><b>{{cost}}</b></p>
54
            <p><a href="{{config.wwwroot}}/login/">{{# str }} loginsite {{/ str }}</a></p>
55
        </div>
56
    {{/isguestuser}}
57
    {{^isguestuser}}
58
        <p>{{# str }} paymentrequired {{/ str}}</p>
59
        <p><b>{{cost}}</b></p>
60
        <button
61
            class="btn btn-secondary"
62
            type="button"
63
            id="gateways-modal-trigger-{{ uniqid }}"
64
            data-action="core_payment/triggerPayment"
65
            data-component="enrol_fee"
66
            data-paymentarea="fee"
67
            data-itemid="{{instanceid}}"
68
            data-cost="{{cost}}"
69
            data-successurl="{{successurl}}"
70
            data-description="{{description}}"
71
        >
72
            {{# str }} sendpaymentbutton, enrol_fee {{/ str }}
73
        </button>
74
    {{/isguestuser}}
75
</div>
76
{{#js}}
77
    require(['core_payment/gateways_modal'], function(modal) {
78
        modal.init();
79
    });
80
{{/js}}