Proyectos de Subversion Moodle

Rev

Rev 1159 | | Comparar con el anterior | 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 course_course/coursecard
19
 
20
    This template renders the a card for the course cards.
21
 
22
    Example context (json):
23
    {
24
        "courses": [
25
            {
26
                "name": "Assignment due 1",
27
                "viewurl": "https://moodlesite/course/view.php?id=2",
28
                "courseimage": "https://moodlesite/pluginfile/123/course/overviewfiles/123.jpg",
29
                "fullname": "course 3",
30
                "hasprogress": true,
31
                "progress": 10,
32
                "visible": true
33
            }
34
        ]
35
    }
36
}}
1441 ariadna 37
<div class="rui-course-card {{#progress}}rui-progress-{{progress}}{{/progress}} {{#showcoursecategory}}rui-course-card--cat{{/showcoursecategory}}" role="listitem"
1 efrain 38
    data-region="course-content"
39
    data-course-id="{{{id}}}">
40
 
1441 ariadna 41
    <div class="rui-course-card-icons">
42
    {{> core_course/favouriteicon }}
43
    </div>
1 efrain 44
 
1441 ariadna 45
    {{$menu}}{{/menu}}
46
    <a href="{{viewurl}}" tabindex="-1" title="{{#str}}courseoverviewfiles, moodle {{/str}}">
47
        <figure class="rui-course-card-img-top" style="background-image: url('{{{courseimage}}}');"></figure>
48
    </a>
1 efrain 49
 
1441 ariadna 50
    <div class="rui-course-card-body d-flex align-items-start">
51
        <div class="w-100">
52
            <div class="rui-course-cat d-flex align-self-end mb-1">
53
                <div class="rui-course-cat-badge"><span class="text-truncate">{{$coursecategory}}{{/coursecategory}}</span></div>
1 efrain 54
            </div>
1441 ariadna 55
            {{#showshortname}}
56
            <div class="rui-course-card-shortname flex-wrap">
57
                <span class="sr-only">
58
                    {{#str}}aria:courseshortname, core_course{{/str}}
59
                </span>
60
                <h5>
61
                    {{{shortname}}}
62
                </h5>
63
            </div>
64
            {{/showshortname}}
65
            <h4 class="rui-course-card-title mb-1 w-100">
66
                <a href="{{viewurl}}">
67
                    <span class="sr-only">{{#str}}aria:coursename, core_course{{/str}}</span>
68
                    {{$coursename}}{{/coursename}}
69
                </a>
70
            </h4>
1 efrain 71
        </div>
1441 ariadna 72
 
1159 ariadna 73
        {{^visible}}
74
        <div class="rui-course-card-margin mt-2 d-inline-flex flex-wrap mb-0 align-self-start">
75
            <span class="rui-course-hidden-badge">
76
                <svg width="15" height="15" fill="none" viewBox="0 0 24 24">
77
                    <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.6247 10C19.0646 10.8986 19.25 11.6745 19.25 12C19.25 13 17.5 18.25 12 18.25C11.2686 18.25 10.6035 18.1572 10 17.9938M7 16.2686C5.36209 14.6693 4.75 12.5914 4.75 12C4.75 11 6.5 5.75 12 5.75C13.7947 5.75 15.1901 6.30902 16.2558 7.09698"></path>
78
                    <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19.25 4.75L4.75 19.25"></path>
79
                    <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.409 13.591C9.53033 12.7123 9.53033 11.2877 10.409 10.409C11.2877 9.5303 12.7123 9.5303 13.591 10.409"></path>
80
                </svg>
81
                {{#str}} hiddenfromstudents {{/str}}
82
            </span>
83
        </div>
84
        {{/visible}}
85
 
1441 ariadna 86
        <div class="w-100 align-self-end mt-2">{{$progress}}{{/progress}}</div>
1159 ariadna 87
    </div>
1441 ariadna 88
 
1 efrain 89
</div>