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_forum/forum_post_email_htmlemail_body
19
 
20
    Template which defines the body component of a forum post for sending in a single-post HTML email.
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
    * courselink
30
    * coursename
31
    * forumindexlink
32
    * forumviewlink
33
    * forumname
34
    * discussionlink
35
    * discussionname
36
    * showdiscussionname
37
    * firstpost
38
    * subject
39
    * authorlink
40
    * authorpicture
41
    * authorfullname
42
    * postdate
43
    * grouppicture
44
    * attachments
45
    * message
46
    * parentpostlink
47
    * canreply
48
    * replylink
49
    * permalink
50
    * unsubscribeforumlink
51
    * unsubscribediscussionlink
52
    * isprivatereply
53
 
54
    Example context (json):
55
    {
56
        "courselink": "https://example.com/course/view.php?id=2",
57
        "coursename": "Example course",
58
        "forumindexlink": "https://example.com/mod/forum/index.php?id=2",
59
        "forumviewlink": "https://example.com/mod/forum/view.php?f=2",
60
        "forumname": "Lorem ipsum dolor",
61
        "discussionlink": "https://example.com/mod/forum/discuss.php?d=70",
62
        "discussionname": "Is Lorem ipsum Latin?",
63
        "showdiscussionname": 1,
64
        "firstpost": 1,
65
        "subject": "Is Lorem ipsum Latin?",
66
        "authorlink": "https://example.com/user/view.php?id=2&course=2",
67
        "authorpicture": "<a href=\"https://example.com/user/view.php?id=2&amp;course=6\"><img src=\"https://example.com/theme/image.php?theme=clean&amp;component=core&amp;image=u%2Ff2&amp;svg=0\" alt=\"Picture of Admin User\" title=\"Picture of Admin User\" class=\"userpicture defaultuserpic\" width=\"35\" height=\"35\" /></a>",
68
        "authorfullname": "Lucius Caecilius lucundus",
69
        "postdate": "Sunday, 13 September 2015, 2:22 pm",
70
        "grouppicture": "",
71
        "attachments": "",
72
        "message": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum et auctor libero. Quisque porta egestas neque, et bibendum libero dignissim at. Nulla facilisi. Morbi eget accumsan felis. Nunc et vulputate odio, vel venenatis nisl. Nunc maximus ipsum sed tincidunt mollis. Integer nunc erat, luctus sit amet arcu tincidunt, volutpat dignissim mi. Sed ut magna quam.  Mauris accumsan porta turpis sed aliquam. Etiam at justo tristique, imperdiet augue quis, consectetur sapien. Ut nec erat malesuada sem suscipit lobortis. Vivamus posuere nibh eu ipsum porta fringilla.  Sed vitae dapibus ipsum, ac condimentum enim. Sed dignissim ante at elit mollis, ac tempor lacus iaculis. Etiam nec lectus vitae nibh vulputate volutpat. Nulla quis tellus aliquam, commodo nisi et, dictum est.</p><p><br /></p>",
73
        "parentpostlink": "",
74
        "canreply": 1,
75
        "replylink": "https://example.com/mod/forum/post.php?reply=2",
76
        "permalink": "https://example.com/mod/forum/discuss.php?d=2#2",
77
        "unsubscribeforumlink": "https://example.com/mod/forum/subscribe.php?id=2",
78
        "unsubscribediscussionlink": "https://example.com/mod/discussion/subscribe.php?id=2&d=2"
79
    }
80
}}
81
<table border="0" cellpadding="3" cellspacing="0" class="forumpost">
82
    <tr class="header">
83
        <td width="35" valign="top" class="picture left">
84
            {{{ authorpicture }}}
85
        </td>
86
        <td class="topic {{# firstpost }}starter{{/ firstpost }}">
87
            <div class="subject">
88
                {{{ subject }}}
89
            </div>
90
            <div class="author">
91
                {{# str }} bynameondate, forum, {
92
                        "name": {{# quote }}<a target='_blank' href='{{{ authorlink }}}'>{{ authorfullname }}</a>{{/ quote }},
93
                        "date": {{# quote }}{{ postdate }}{{/ quote }}
94
                    } {{/ str }}
95
            </div>
96
            {{# isprivatereply }}
97
            <div class="privatereplyinfo">
98
                {{# str }} postisprivatereply, forum {{/ str }}
99
            </div>
100
            {{/ isprivatereply }}
101
        </td>
102
    </tr>
103
    <tr>
104
        <td class="left side" valign="top">
105
            {{# grouppicture }}
106
                {{{ grouppicture }}}
107
            {{/ grouppicture }}
108
            {{^ grouppicture }}
109
                &nbsp;
110
            {{/ grouppicture }}
111
        </td>
112
        <td class="content">
113
            {{# attachments }}
114
                <div class="attachments">
115
                    {{{ attachments }}}
116
                </div>
117
            {{/ attachments }}
118
            {{{ message }}}
119
 
120
            <div class="commands">
121
                {{^ firstpost }}
122
                    <a target="_blank" href="{{{ parentpostlink }}}">
123
                        {{# str }} parent, forum {{/ str }}
124
                    </a>
125
                    {{# canreply }}
126
                        {{^ isprivatereply }}
127
                        |
128
                        {{/ isprivatereply }}
129
                    {{/ canreply }}
130
                {{/ firstpost }}
131
                {{# canreply }}
132
                    {{^ isprivatereply }}
133
                    <a target="_blank" href="{{{ replylink }}}">
134
                        {{# str }} reply, forum {{/ str }}
135
                    </a>
136
                    {{/ isprivatereply }}
137
                {{/ canreply }}
138
            </div>
139
 
140
            <div class="link">
141
                <a target="_blank" href="{{{ permalink }}}">
142
                    {{# str }} postincontext, forum {{/ str }}
143
                </a>
144
            </div>
145
        </td>
146
    </tr>
147
</table>