Proyectos de Subversion Moodle

Rev

Autoría | Ultima modificación | Ver Log |

{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template mod_forum/forum_post_emaildigestfull_htmlemail_body

    Template which defines the body component of a forum post for sending in a single-post HTML email.

    Classes required for JS:
    * none

    Data attributes required for JS:
    * none

    Context variables required for this template:
    * courselink
    * coursename
    * forumindexlink
    * forumviewlink
    * forumname
    * discussionlink
    * discussionname
    * showdiscussionname
    * firstpost
    * subject
    * authorlink
    * authorpicture
    * authorfullname
    * postdate
    * grouppicture
    * attachments
    * message
    * parentpostlink
    * canreply
    * replylink
    * permalink
    * unsubscribeforumlink
    * unsubscribediscussionlink
    * isprivatereply

    Example context (json):
    {
        "courselink": "https://example.com/course/view.php?id=2",
        "coursename": "Example course",
        "forumindexlink": "https://example.com/mod/forum/index.php?id=2",
        "forumviewlink": "https://example.com/mod/forum/view.php?f=2",
        "forumname": "Lorem ipsum dolor",
        "discussionlink": "https://example.com/mod/forum/discuss.php?d=70",
        "discussionname": "Is Lorem ipsum Latin?",
        "showdiscussionname": 1,
        "firstpost": 1,
        "subject": "Is Lorem ipsum Latin?",
        "authorlink": "https://example.com/user/view.php?id=2&course=2",
        "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>",
        "authorfullname": "Lucius Caecilius lucundus",
        "postdate": "Sunday, 13 September 2015, 2:22 pm",
        "grouppicture": "",
        "attachments": "",
        "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>",
        "parentpostlink": "",
        "canreply": 1,
        "replylink": "https://example.com/mod/forum/post.php?reply=2",
        "permalink": "https://example.com/mod/forum/discuss.php?d=2#2",
        "unsubscribeforumlink": "https://example.com/mod/forum/subscribe.php?id=2",
        "unsubscribediscussionlink": "https://example.com/mod/discussion/subscribe.php?id=2&d=2"
    }
}}
    <style>
        @media only screen {
            body {
                margin: 0;
                -webkit-font-smoothing: antialiased;
                width:100% !important;
                background-color: #F3F3F3;
                -webkit-text-size-adjust:none;
            }

            .content img {
                max-width: 100%;
            }
        }
    </style>

<div style="width: 90%; max-width: 700px; border-radius: 10px; background-color: #fff; padding: 30px; margin-top: 15px; margin-left: auto; margin-right: auto;">
    <div class="forum-post" style="background-color: #fff;">
        <div class="header">
            <div class="topic {{# firstpost }}starter{{/ firstpost }}">
                <div class="picture left" style="margin-bottom: 20px;">
                {{{ authorpicture }}}
                </div>
                <div class="subject" style="font-size: 24px; font-weight: bold; margin-bottom: 10px;">
                    {{{ subject }}}
                </div>
                <div class="author" style="color: #919191">
                    {{# str }} bynameondate, forum, {
                            "name": {{# quote }}<a target='_blank' href='{{{ authorlink }}}'>{{ authorfullname }}</a>{{/ quote }},
                            "date": {{# quote }}{{ postdate }}{{/ quote }}
                        } {{/ str }}
                </div>
                {{# isprivatereply }}
                <div class="privatereplyinfo" style="margin-top: 10px; font-weight: bold;">
                    {{# str }} postisprivatereply, forum {{/ str }}
                </div>
                {{/ isprivatereply }}
            </div>
        </div>
        <div>
            <div class="left side" valign="top">
                {{# grouppicture }}
                    {{{ grouppicture }}}
                {{/ grouppicture }}
                {{^ grouppicture }}
                    &nbsp;
                {{/ grouppicture }}
            </div>
            <div class="content" style="margin-top: 20px; margin-bottom: 20px;">
                {{# attachments }}
                    <div class="attachments">
                        {{{ attachments }}}
                    </div>
                {{/ attachments }}

                <div style="margin-top: 20px; font-size: 16px; line-height: 1.6">{{{ message }}}</div>

                <div class="commands" style="margin-top: 10px; margin-bottom: 10px; display: inline-flex; align-items: center">
                    {{^ firstpost }}
                        <a target="_blank" href="{{{ parentpostlink }}}" style="display:inline-block; margin-bottom: 20px; margin-right: 10px; background-color: #fff; border: 1px solid #DCDCDC; color: #323232; font-size: 12px; font-weight: bold; padding: 10px 20px; border-radius: 5px; text-decoration: none; word-break: break-all; white-space: normal;">
                            {{# str }} parent, forum {{/ str }}
                        </a>
                    {{/ firstpost }}
                    {{# canreply }}
                        <a target="_blank" href="{{{ replylink }}}" style="display:inline-block; background-color: #fff; margin-bottom: 20px; border: 1px solid #007AFF; color: #007AFF; font-size: 12px; font-weight: bold; padding: 10px 20px; border-radius: 5px; text-decoration: none; word-break: break-all; white-space: normal;">
                            {{# str }} reply, forum {{/ str }}
                        </a>
                    {{/ canreply }}
                </div>

                <div class="link">
                    <a target="_blank" href="{{{ permalink }}}" style="background-color: #007AFF; color: #fff; font-size: 12px; font-weight: bold; padding: 10px 20px; border-radius: 5px; text-decoration: none; word-break: break-all; white-space: normal;">
                        {{# str }} postincontext, forum {{/ str }}
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>