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 core_courseformat/local/content/cm/activity
19
 
20
    Display the activity content of a cm.
21
 
22
    Example context (json):
23
    {
24
        "cmname": {
25
            "displayvalue" : "<a class=\"aalink\" href=\"#\"><span class=\"instancename\">Activity example</span></a>"
26
        },
27
        "hasname": "true",
28
        "afterlink": "<span class=\"resourcelinkdetails\">24.7&nbsp;KB · Uploaded 26/05/23, 16:29</span>",
29
        "activitybadge": {
30
            "badgecontent": "PDF",
31
            "badgestyle": "badge-none",
32
            "badgeurl": "http://example.org/help",
33
            "badgeelementid": "myelementid",
34
            "badgeextraattributes": [
35
                {
36
                    "name": "data-el1name",
37
                    "value": "el1value"
38
                },
39
                {
40
                    "name": "data-el2name",
41
                    "value": "el2value"
42
                }
43
            ]
44
        },
45
        "hasextras": true,
46
        "extras": ["<span class=\"badge badge-secondary\">[extras]</span>"],
47
        "activityinfo": {
48
            "hasmodavailability": true,
49
            "activityname": "Activity example",
50
            "hascompletion": true,
51
            "uservisible": true,
52
            "hasdates": true,
53
            "isautomatic": true,
54
            "istrackeduser": true,
55
            "activitydates": [
56
                {
57
                    "label": "Opens:",
58
                    "datestring": "6 April 2021, 6:46 PM"
59
                }
60
            ],
61
            "completiondetails": [
62
                {
63
                    "statuscomplete": 1,
64
                    "description": "Viewed"
65
                },
66
                {
67
                    "statusincomplete": 1,
68
                    "description": "Receive a grade"
69
                }
70
            ]
71
        },
72
        "visibility": {
73
            "isInteractive": false,
74
            "modhiddenfromstudents": true
75
        }
76
    }
77
}}
78
<div class="d-grid align-items-center {{^isautomatic}}rui--activity-notautomatic {{/isautomatic}}{{#isautomatic}}rui--activity-is-automatic{{/isautomatic}}{{#hascompletion}}rui--activity-is-manual{{/hascompletion}}">
79
 
80
    {{#moveicon}} {{{moveicon}}} {{/moveicon}}
81
 
82
    <div class="w-100">
83
        {{! Dates }}
84
        {{#dates}}
85
            {{#hasdates}}
86
                <div data-region="activity-dates" class="rui-activity-dates activity-dates course-description-item">
87
                    {{#activitydates}}
88
                        {{$core_course/activity_date}}
89
                            {{>core_course/activity_date}}
90
                        {{/core_course/activity_date}}
91
                    {{/activitydates}}
92
                </div>
93
            {{/hasdates}}
94
        {{/dates}}
95
 
96
        {{$ core_courseformat/local/content/cm/badges }}
97
            {{> core_courseformat/local/content/cm/badges }}
98
        {{/ core_courseformat/local/content/cm/badges }}
99
 
100
        <div class="activity-basis d-flex align-items-center flex-wrap">
101
            <div class="d-flex flex-row align-items-center mr-auto">
102
                {{#cmname}}
103
                {{$ core_courseformat/local/content/cm/cmname }}
104
                    {{> core_courseformat/local/content/cm/cmname }}
105
                {{/ core_courseformat/local/content/cm/cmname }}
106
                {{/cmname}}
107
            </div>
108
            {{! Completion }}
109
            {{! Group mode }}
110
            {{#groupmodeinfo}}
111
                <div
112
                    class="activity-groupmode-info align-self-center mr-2"
113
                    data-region="groupmode"
114
                >
115
                    {{$ core_courseformat/local/content/cm/groupmode}}
116
                        {{> core_courseformat/local/content/cm/groupmode}}
117
                    {{/ core_courseformat/local/content/cm/groupmode}}
118
                </div>
119
            {{/groupmodeinfo}}
120
            {{#completion}}
121
                {{#hascompletion}}
122
                    <div class="activity-completion align-self-center mt-2 mt-md-0 ml-0 ml-md-2">
123
                        {{$ core_courseformat/local/content/cm/activity_info}}
124
                            {{> core_courseformat/local/content/cm/activity_info}}
125
                        {{/ core_courseformat/local/content/cm/activity_info}}
126
                    </div>
127
                {{/hascompletion}}
128
            {{/completion}}
129
            {{#controlmenu}}
130
                <div class="activity-actions align-self-start">
131
                    {{$ core_courseformat/local/content/cm/controlmenu }}
132
                        {{> core_courseformat/local/content/cm/controlmenu }}
133
                    {{/ core_courseformat/local/content/cm/controlmenu }}
134
                </div>
135
            {{/controlmenu}}
136
        </div>
137
 
138
        {{#altcontent}}
139
        <div class="rui-contentafterlink contentafterlink description {{^completion}}rui--nocompletion{{/completion}}">
140
            <div class="activity-altcontent {{#hasname}}mt-2 course-description-item {{/hasname}}{{^hasname}}contentwithoutlink{{/hasname}} d-flex text-break">
141
                <div class="flex-fill description-inner">
142
                    {{{altcontent}}}
143
                </div>
144
            </div>
145
        </div>
146
        {{/altcontent}}
147
 
148
        {{#modavailability}}
149
        <div class="rui-modavailability description">
150
                {{$ core_courseformat/local/content/cm/availability }}
151
                    {{> core_courseformat/local/content/cm/availability }}
152
                {{/ core_courseformat/local/content/cm/availability }}
153
        </div>
154
        {{/modavailability}}
155
 
156
        {{! Afterlink }}
157
        {{#afterlink}}
158
            <div class="rui-contentafterlink afterlink mt-2">
159
                {{{afterlink}}}
160
            </div>
161
        {{/afterlink}}
162
 
163
    </div>
164
 
165
 
166
</div>