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_mobile/subscription
|
|
|
19 |
|
|
|
20 |
Template for subscription information.
|
|
|
21 |
|
|
|
22 |
Classes required for JS:
|
|
|
23 |
* none
|
|
|
24 |
|
|
|
25 |
Data attributes required for JS:
|
|
|
26 |
* none
|
|
|
27 |
|
|
|
28 |
Context variables required for this template:
|
|
|
29 |
* registered - Whether the site is registered
|
|
|
30 |
* appsportalurl - Apps portal url
|
|
|
31 |
|
|
|
32 |
Example context (json):
|
|
|
33 |
{
|
|
|
34 |
"registered" : true,
|
|
|
35 |
"appsportalurl": "https://apps.moodle.com",
|
|
|
36 |
"subscription": {
|
|
|
37 |
"name": "Pro",
|
|
|
38 |
"description": "This subscription has a Moodle Product Premium plan free of charge",
|
|
|
39 |
"timecreated": 1587548810,
|
|
|
40 |
"expiretime": 1618963200,
|
|
|
41 |
"features": [
|
|
|
42 |
{
|
|
|
43 |
"name": "multimediapushnotifications",
|
|
|
44 |
"enabled": true,
|
|
|
45 |
"description": "Multimedia push notifications",
|
|
|
46 |
"humanstatus": "Enabled",
|
|
|
47 |
"message": {
|
|
|
48 |
"type" : "warning",
|
|
|
49 |
"message" : "Temporary disabled for a promotion"
|
|
|
50 |
}
|
|
|
51 |
},
|
|
|
52 |
{
|
|
|
53 |
"name": "pushnotificationsdevices",
|
|
|
54 |
"enabled": false,
|
|
|
55 |
"limit": 50,
|
|
|
56 |
"showbar": 1,
|
|
|
57 |
"description": "Active user devices for notifications",
|
|
|
58 |
"status": 55,
|
|
|
59 |
"humanstatus": "55/50",
|
|
|
60 |
"barclass": "bg-danger"
|
|
|
61 |
},
|
|
|
62 |
{
|
|
|
63 |
"name": "custommenuitems",
|
|
|
64 |
"enabled": false,
|
|
|
65 |
"limit": 4,
|
|
|
66 |
"showbar": 1,
|
|
|
67 |
"description": "Custom menu items",
|
|
|
68 |
"status": 2,
|
|
|
69 |
"humanstatus": "2/4"
|
|
|
70 |
}
|
|
|
71 |
]
|
|
|
72 |
},
|
|
|
73 |
"messageswarning": [
|
|
|
74 |
{
|
|
|
75 |
"message" : "You have surpassed your monthly active user devices limit, some messages are beign ignored. We recommend you to upgrade to a paid plan."
|
|
|
76 |
}
|
|
|
77 |
],
|
|
|
78 |
"notifications": {
|
|
|
79 |
"totalsentnotifications" : 7600,
|
|
|
80 |
"totaldevices" : 60,
|
|
|
81 |
"currentactivedevices" : 55,
|
|
|
82 |
"ignorednotificationswarning": {
|
|
|
83 |
"message" : "You have surpassed your monthly active user devices limit, some messages are beign ignored. We recommend you to upgrade to a paid plan."
|
|
|
84 |
},
|
|
|
85 |
"monthly" : [
|
|
|
86 |
{
|
|
|
87 |
"year": 2020,
|
|
|
88 |
"month": 4,
|
|
|
89 |
"sentnotifications": 4500,
|
|
|
90 |
"newdevices": 20,
|
|
|
91 |
"activedevices": 55,
|
|
|
92 |
"ignorednotifications": 40,
|
|
|
93 |
"limitreachedtime": 1586548810
|
|
|
94 |
},
|
|
|
95 |
{
|
|
|
96 |
"year": 2020,
|
|
|
97 |
"month": 3,
|
|
|
98 |
"sentnotifications": 4500,
|
|
|
99 |
"newdevices":10,
|
|
|
100 |
"activedevices": 45,
|
|
|
101 |
"ignorednotifications": 0,
|
|
|
102 |
"limitreachedtime": 0
|
|
|
103 |
}
|
|
|
104 |
]
|
|
|
105 |
}
|
|
|
106 |
}
|
|
|
107 |
}}
|
|
|
108 |
|
|
|
109 |
{{#messageserror}}
|
|
|
110 |
{{> core/notification_error}}
|
|
|
111 |
{{/messageserror}}
|
|
|
112 |
{{#messagessuccess}}
|
|
|
113 |
{{> core/notification_success}}
|
|
|
114 |
{{/messagessuccess}}
|
|
|
115 |
{{#messageswarning}}
|
|
|
116 |
{{> core/notification_warning}}
|
|
|
117 |
{{/messageswarning}}
|
|
|
118 |
{{#messagesinfo}}
|
|
|
119 |
{{> core/notification_info}}
|
|
|
120 |
{{/messagesinfo}}
|
|
|
121 |
|
|
|
122 |
<div id="subscription-overview" class="box">
|
|
|
123 |
|
|
|
124 |
<h2>{{# str }} mobileappsubscription, tool_mobile {{/ str }}</h2>
|
|
|
125 |
|
|
|
126 |
{{#messageshtml}}
|
|
|
127 |
{{{message}}}
|
|
|
128 |
{{/messageshtml}}
|
|
|
129 |
|
|
|
130 |
{{#subscription}}
|
|
|
131 |
<dl class="list-narrow">
|
|
|
132 |
<dt>{{# str }} name {{/ str }}</dt><dd>{{name}}</dd>
|
|
|
133 |
<dt>{{# str }} description {{/ str }}</dt><dd>{{description}}</dd>
|
|
|
134 |
<dt>{{# str }} subscriptioncreated, tool_mobile {{/ str }}</dt><dd>{{#userdate}} {{timecreated}}, {{#str}} strftimedate {{/str}} {{/userdate}}</dd>
|
|
|
135 |
{{#expiretime}}
|
|
|
136 |
<dt>{{# str }} subscriptionexpiration, tool_mobile {{/ str }}</dt><dd>{{#userdate}} {{expiretime}}, {{#str}} strftimedate {{/str}} {{/userdate}}</dd>
|
|
|
137 |
{{/expiretime}}
|
|
|
138 |
</dl>
|
|
|
139 |
|
|
|
140 |
{{^registered}}
|
|
|
141 |
{{# str }} subscriptionregister, tool_mobile, {{ appsportalurl }} {{/ str }}
|
|
|
142 |
{{/registered}}
|
|
|
143 |
|
|
|
144 |
<h3>{{# str }} subscriptionfeatures, tool_mobile {{/ str }}</h3>
|
|
|
145 |
|
|
|
146 |
{{#features}}
|
|
|
147 |
<dl>
|
|
|
148 |
{{^limit}}
|
|
|
149 |
<dt>{{{description}}}</dt><dd>{{{humanstatus}}}</dd>
|
|
|
150 |
{{/limit}}
|
|
|
151 |
{{#limit}}
|
|
|
152 |
<dt>{{{description}}}</dt><dd>
|
|
|
153 |
{{#showbar}}
|
|
|
154 |
<div class="progress">
|
|
|
155 |
<div class="progress-bar progress-bar-animated {{barclass}}" role="progressbar" style="width: 100%" aria-valuenow="{{status}}" aria-valuemin="0" aria-valuemax="{{limit}}">{{humanstatus}}
|
|
|
156 |
</div>
|
|
|
157 |
</div>
|
|
|
158 |
{{/showbar}}
|
|
|
159 |
{{^showbar}}
|
|
|
160 |
{{humanstatus}}
|
|
|
161 |
{{/showbar}}
|
|
|
162 |
</dd>
|
|
|
163 |
{{/limit}}
|
|
|
164 |
{{#message}}
|
|
|
165 |
<span class="badge badge-{{type}}">{{message}}</span>
|
|
|
166 |
{{/message}}
|
|
|
167 |
</dl>
|
|
|
168 |
{{/features}}
|
|
|
169 |
|
|
|
170 |
{{#registered}}
|
|
|
171 |
{{# str }} subscriptionsseemore, tool_mobile, {{ appsportalurl }} {{/ str }}
|
|
|
172 |
{{/registered}}
|
|
|
173 |
|
|
|
174 |
{{/subscription}}
|
|
|
175 |
</div>
|
|
|
176 |
|
|
|
177 |
<div id="notifications-overview" class="box">
|
|
|
178 |
<h3>{{# str }} notifications, tool_mobile {{/ str }}</h3>
|
|
|
179 |
|
|
|
180 |
{{^registered}}
|
|
|
181 |
{{# str }} subscriptionregister, tool_mobile, {{ appsportalurl }} {{/ str }}
|
|
|
182 |
{{/registered}}
|
|
|
183 |
|
|
|
184 |
{{#notifications}}
|
|
|
185 |
|
|
|
186 |
{{#ignorednotificationswarning}}
|
|
|
187 |
{{> core/notification_error}}
|
|
|
188 |
{{/ignorednotificationswarning}}
|
|
|
189 |
|
|
|
190 |
<dl>
|
|
|
191 |
<dt>{{# str }} notificationscurrentactivedevices, tool_mobile {{/ str }}</dt><dd>{{currentactivedevices}}</dd>
|
|
|
192 |
</dl>
|
|
|
193 |
|
|
|
194 |
<table id="notificationstable" class="generaltable fullwidth">
|
|
|
195 |
<thead>
|
|
|
196 |
<tr>
|
|
|
197 |
<th class="text-center" scope="col">{{#str}}year, form{{/str}}</th>
|
|
|
198 |
<th class="text-center" scope="col">{{#str}}month{{/str}}</th>
|
|
|
199 |
<th class="text-center" scope="col">{{#str}}notificationssentnotifications, tool_mobile{{/str}}</th>
|
|
|
200 |
<th class="text-center" scope="col">{{#str}}notificationsactivedevices, tool_mobile{{/str}}</th>
|
|
|
201 |
<th class="text-center" scope="col">{{#str}}notificationsnewdevices, tool_mobile{{/str}}</th>
|
|
|
202 |
<th class="text-center" scope="col">{{#str}}notificationsignorednotifications, tool_mobile{{/str}}</th>
|
|
|
203 |
</tr>
|
|
|
204 |
</thead>
|
|
|
205 |
<tbody>
|
|
|
206 |
{{#notifications.monthly}}
|
|
|
207 |
<tr>
|
|
|
208 |
<td class="text-center">{{year}}</td>
|
|
|
209 |
<td class="text-center">{{month}}</td>
|
|
|
210 |
<td class="text-center">{{sentnotifications}}</td>
|
|
|
211 |
<td class="text-center">{{activedevices}}</td>
|
|
|
212 |
<td class="text-center">{{newdevices}}</td>
|
|
|
213 |
<td class="text-center">{{ignorednotifications}}</td>
|
|
|
214 |
</tr>
|
|
|
215 |
{{/notifications.monthly}}
|
|
|
216 |
</tbody>
|
|
|
217 |
</table>
|
|
|
218 |
|
|
|
219 |
{{#registered}}
|
|
|
220 |
{{# str }} notificationsseemore, tool_mobile, {{ appsportalurl }} {{/ str }}
|
|
|
221 |
{{/registered}}
|
|
|
222 |
|
|
|
223 |
{{/notifications}}
|
|
|
224 |
|
|
|
225 |
{{^notifications}}
|
|
|
226 |
{{# str }} notificationsmissingwarning, tool_mobile {{/ str }}
|
|
|
227 |
{{/notifications}}
|
|
|
228 |
|
|
|
229 |
</div>
|