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 comments.
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 booktool_print/print_book
19
 
20
    Print book page.
21
 
22
    Classes required for JS:
23
    * none
24
 
25
    Data attributes required for JS:
26
    * none
27
 
28
    * printdialoglink string The URL pointing to the print book chapter popup window.
29
    * booktitle string The HTML of the book title.
30
    * bookintro string The book description.
31
    * sitelink string The HTML link pointing to the site's dashboard.
32
    * coursename string The name of the course.
33
    * modulename string The name of the module.
34
    * username string The user name.
35
    * printdate string The print date.
36
    * chaptertitle string The title of the chapter.
37
    * toc object The HTML of the table of contents.
38
    * chapters array The array of book chapters, their content and visibility information.
39
 
40
    Example context (json):
41
    {
42
        "printdialoglink": "<a>Print book</a>",
43
        "booktitle": "<h2>Book title</h2>",
44
        "bookintro": "Book description",
45
        "sitelink" : "<a>Site title</a>",
46
        "coursename" : "Course name",
47
        "modulename" : "Module name",
48
        "username" : "User name",
49
        "printdate" : "Tuesday, 22 January 2019, 10:17 AM",
50
        "chaptertitle": "Chapter title",
51
        "toc" : "<div>Table of contents</div>",
52
        "chapters": [
53
            {
54
                "content": "<div>Chapter1 content</div>",
55
                "visible": "true"
56
            },
57
            {
58
                "content": "<div>Chapter2 content</div>",
59
                "visible": "false"
60
            }
61
        ]
62
    }
63
}}
64
<div class="book p-4">
65
    <div class="text-right">{{{ printdialoglink }}}</div>
66
    <div class="text-center pb-3 book_title">{{{ booktitle }}}</div>
67
    <div class="book_info w-100 pt-6 d-inline-block">
68
        <div class="w-50 float-left">
69
            <table>
70
                <tr>
71
                    <td>
72
                        {{# str }} site {{/ str }}:
73
                    </td>
74
                    <td class="pl-3">
75
                        {{{ sitelink }}}
76
                    </td>
77
                </tr>
78
                <tr>
79
                    <td>
80
                        {{# str }} course {{/ str }}:
81
                    </td>
82
                    <td class="pl-3">
83
                        {{{ coursename }}}
84
                    </td>
85
                </tr>
86
                <tr>
87
                    <td>
88
                        {{# str }} modulename, mod_book {{/ str }}:
89
                    </td>
90
                    <td class="pl-3">
91
                        {{{ modulename }}}
92
                    </td>
93
                </tr>
94
            </table>
95
        </div>
96
        <div class="w-50 float-left">
97
            <table class="float-right">
98
                <tr>
99
                    <td>
100
                        {{# str }} printedby, booktool_print {{/ str }}:
101
                    </td>
102
                    <td class="pl-3">
103
                        {{{ username }}}
104
                    </td>
105
                </tr>
106
                <tr>
107
                    <td>
108
                        {{# str }} printdate, booktool_print {{/ str }}:
109
                    </td>
110
                    <td class="pl-3">
111
                        {{{ printdate }}}
112
                    </td>
113
                </tr>
114
            </table>
115
        </div>
116
    </div>
117
    {{#bookintro}}
118
    <div class="w-100 book_description">
119
        <div class="py-5">
120
            <h2 class="text-center pb-5">{{#str}} description {{/str}}</h2>
121
             <p class="book_summary">{{{ bookintro }}}</p>
122
        </div>
123
    </div>
124
    {{/bookintro}}
125
    <div class="w-100">
126
        <div class="py-5">{{{ toc }}}</div>
127
    </div>
128
    <div class="w-100">
129
     {{#chapters}}
130
        {{#visible }}
131
            <div class="pb-5">
132
            {{{ content }}}
133
            </div>
134
        {{/visible}}
135
    {{/chapters}}
136
    </div>
137
</div>