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 message_popup/message_content_item
19
 
20
    This template will render the message content item for the
21
    navigation bar message menu.
22
 
23
    Classes required for JS:
24
    * none
25
 
26
    Data attributes required for JS:
27
    * All data attributes are required
28
 
29
    Context variables required for this template:
30
    * isread If the message is read or not
31
    * contexturl The link to the message on the messages page
32
    * fullname The name of the sender
33
    * profileimageurl The URL for the sender's profile image
34
    * sentfromcurrentuser Was the last message sent by the current user
35
    * lastmessage The message text
36
    * unreadcount The number of unread messages in this conversation
37
 
38
    Example context (json):
39
    {
40
        "isread": true,
41
        "contexturl": "http://www.moodle.com",
42
        "fullname": "Some Person",
43
        "profileimageurl": "http://www.moodle.com",
44
        "sentfromcurrentuser": false,
45
        "lastmessage": "Hello, this is Some Person!",
46
        "unreadcount": 1
47
    }
48
 
49
}}
50
<a class="content-item-container {{^isread}}unread{{/isread}}"
51
    data-region="message-content-item-container"
52
    role="listitem"
53
    href="{{{contexturl}}}"
54
    {{^isread}}aria-label="{{#str}} viewunreadmessageswith, message, {{fullname}} {{/str}}"{{/isread}}
55
    {{#isread}}aria-label="{{#str}} viewmessageswith, message, {{fullname}} {{/str}}"{{/isread}}
56
    tabindex="0">
57
 
58
    <div class="content-item">
59
        <div class="profile-image-container">
60
            <img src="{{{profileimageurl}}}" />
61
        </div>
62
        <div class="content-item-body">
63
            <h3>{{fullname}}</h3>
64
            <p>
65
                {{#sentfromcurrentuser}}
66
                    <span data-region="last-message-user">{{#str}}you, message{{/str}}</span>
67
                {{/sentfromcurrentuser}}
68
                {{lastmessage}}
69
            </p>
70
        </div>
71
        <div class="unread-count-container">
72
            <span data-region="unread-count" class="badge bg-danger text-white">{{unreadcount}}</span>
73
        </div>
74
    </div>
75
</a>