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 mod_customcert/mobile_view_activity_page
19
 
20
    The main page to view the custom certificate activity
21
 
22
    Classes required for JS:
23
    * None
24
 
25
    Data attibutes required for JS:
26
    * All data attributes are required
27
 
28
    Context variables required for this template:
29
    * certificate
30
    * cmid
31
    * hasissues
32
    * issues
33
    * showgroups
34
    * groups
35
    * canmanage
36
    * requiredtimemet
37
    * hasrecipients
38
    * recipients
39
    * fileurl
40
    * showreport
41
    * currenttimestamp
42
 
43
    Example context (json):
44
    {
45
        "certificate": {
46
            "id": "1",
47
            "course": "2",
48
            "name": "A rad certificate name!",
49
            "intro": "A certificate",
50
            "requiredtime": "60"
51
        },
52
        "cmid": "25",
53
        "issue": {
54
            "timecreated": "1528370177"
55
        },
56
        "showgroups": "true",
57
        "groups": [
58
            {
59
                "id": "2",
60
                "selected": "false",
61
                "name": "Group A"
62
            }
63
        ],
64
        "canmanage": "true",
65
        "requiredtimemet": "true",
66
        "fileurl": "http://yoursite.com/mod/customcert/mobile/pluginfile.php?id=4",
67
        "showreport": "true",
68
        "hasrecipients": "true",
69
        "recipients": [
70
            {
71
                "id": "2",
72
                "issueid": "3",
73
                "displayname": "Michaelangelo (Mickey)",
74
                "fileurl": "http://yoursite.com/mod/customcert/mobile/pluginfile.php?id=4",
75
                "timecreated": "1528370177"
76
            }
77
        ],
78
        "currenttimestamp": "1528370177"
79
    }
80
}}
81
{{=<% %>=}}
82
<div>
83
    <core-course-module-description description="<% certificate.intro %>" component="mod_customcert" componentId="<% cmid %>"></core-course-module-description>
84
    <%^canmanage%>
85
        <%#requiredtimemet%>
86
            <ion-item>
87
                <ion-grid>
88
                    <ion-row>
89
                        <ion-col col-6 class="text-left">
90
                            {{ 'plugin.mod_customcert.receiveddate' | translate }}
91
                            <br />
92
                            <div class="timerewarded">
93
                                <%#issue%>
94
                                    {{ <% timecreated %> | coreToLocaleString }}
95
                                <%/issue%>
96
                                <%^issue%>
97
                                    {{ 'plugin.mod_customcert.notissued' | translate }}
98
                                <%/issue%>
99
                            </div>
100
                        </ion-col>
101
                        <ion-col col-6 class="text-right">
102
                            <button ion-button icon-only clear [core-download-file]="{fileurl: '<% fileurl %>', timemodified: '<% currenttimestamp %>'}" moduleId="<% cmid %>" courseId="<% certificate.course %>" component="mod_customcert">
103
                                <ion-icon name="download"></ion-icon>
104
                            </button>
105
                        </ion-col>
106
                    </ion-row>
107
                </ion-grid>
108
            </ion-item>
109
        <%/requiredtimemet%>
110
        <%^requiredtimemet%>
111
            <ion-item>
112
                <p>{{ 'plugin.mod_customcert.requiredtimenotmet' | translate: {$a: { requiredtime: <% certificate.requiredtime %>} } }}</p>
113
            </ion-item>
114
        <%/requiredtimemet%>
115
    <%/canmanage%>
116
    <%#canmanage%>
117
        <ion-item>
118
            <button ion-button block core-course-download-module-main-file moduleId="<% cmid %>" courseId="<% certificate.course %>" component="mod_customcert" [files]="[{fileurl: '<% fileurl %>', timemodified: '<% currenttimestamp %>'}]">
119
                <ion-icon name="download" item-start></ion-icon>
120
                {{ 'plugin.mod_customcert.getcustomcert' | translate }}
121
            </button>
122
        </ion-item>
123
    <%/canmanage%>
124
    <%#showreport%>
125
        <ion-item>
126
            {{ 'plugin.mod_customcert.listofissues' | translate }}
127
        </ion-item>
128
        <%#showgroups%>
129
            <ion-item>
130
                <ion-label>{{ 'plugin.mod_customcert.selectagroup' | translate }}</ion-label>
131
                <ion-select (ionChange)="updateContent({cmid: <% cmid %>, courseid: <% certificate.course %>, group: $event})" interface="popover">
132
                    <%#groups%>
133
                        <ion-option value="<% id %>" <%#selected%>selected<%/selected%>><% name %></ion-option>
134
                    <%/groups%>
135
                </ion-select>
136
            </ion-item>
137
        <%/showgroups%>
138
        <%#hasrecipients%>
139
            <ion-list>
140
                <%#recipients%>
141
                    <ion-item>
142
                        <ion-grid>
143
                            <ion-row>
144
                                <ion-col col-6 class="text-left">
145
                                    <% displayname %>
146
                                    <br />
147
                                    <div class="timerewarded">{{ <% timecreated %> | coreToLocaleString }}</div>
148
                                </ion-col>
149
                                <ion-col col-6 class="text-right">
150
                                    <button ion-button icon-only clear [core-download-file]="{fileurl: '<% fileurl %>', timemodified: '<% currenttimestamp %>'}" moduleId="<% cmid %>" courseId="<% certificate.course %>" component="mod_customcert">
151
                                        <ion-icon name="download"></ion-icon>
152
                                    </button>
153
                                    <%#canmanage%>
154
                                        <button ion-button icon-only clear core-site-plugins-call-ws name="mod_customcert_delete_issue"
155
                                                [params]="{certificateid: <% certificate.id %>, issueid: <% issueid %>}"
156
                                                [preSets]="{getFromCache: 0, saveToCache: 0, typeExpected: 'boolean'}"
157
                                                confirmMessage="{{ 'plugin.mod_customcert.deleteissueconfirm' | translate }}"
158
                                                refreshOnSuccess="true">
159
                                            <ion-icon name="trash"></ion-icon>
160
                                        </button>
161
                                    <%/canmanage%>
162
                                </ion-col>
163
                            </ion-row>
164
                        </ion-grid>
165
                    </ion-item>
166
                <%/recipients%>
167
            </ion-list>
168
        <%/hasrecipients%>
169
        <%^hasrecipients%>
170
            <ion-item>
171
                {{ 'plugin.mod_customcert.nothingtodisplay' | translate }}
172
            </ion-item>
173
        <%/hasrecipients%>
174
    <%/showreport%>
175
</div>