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_action_menu
19
 
20
    This template renders action menu for a forum discussion.
21
 
22
    Context variables required for this template:
23
    * capabilities Object - Uses the following attributes:
24
      * manage boolean - Whether to render the lock action.
25
      * favourite boolean - Whether to render the star/unstar action.
26
      * pin boolean - Whether to render the star/unstar action.
27
      * subscribe boolean - Whether to render the subscribe action.
28
    * id int - The discussion ID.
29
    * forumid int - The forum ID.
30
    * istimelocked boolean - Whether this forum is time locked.
31
    * settings Object - Uses the following attributes:
32
      * excludetext boolean - Whether to show an icon only.
33
      * togglemoreicon - Whether to show a toggle-more icon or not.
34
 
35
    Example context (json):
36
    {
37
        "capabilities": {
38
            "manage": true,
39
            "favourite": true,
40
            "pin": true,
41
            "subscribe": true
42
        },
43
        "id": 1,
44
        "forumid": 1,
45
        "istimelocked": false,
46
        "settingsselector": true,
47
        "settings": {
48
            "excludetext": false,
49
            "togglemoreicon": false
50
        }
51
    }
52
}}
53
<div class="ml-auto dropdown">
54
    {{#settingsselector}}
55
        <button class="dropdown-toggle btn btn-outline-secondary"
56
                data-toggle="dropdown"
57
                aria-haspopup="true"
58
                tabindex="0"
59
                aria-controls="forum-action-menu-{{id}}-menu"
60
                aria-label="{{#str}}togglediscussionmenu, mod_forum{{/str}}"
61
                aria-expanded="false">
62
            {{#str}} settings, mod_forum {{/str}}
63
        </button>
64
    {{/settingsselector}}
65
    {{^settingsselector}}
66
        <a href="#" class="{{^settings.excludetext}}dropdown-toggle{{/settings.excludetext}} btn btn-link {{#settings.togglemoreicon}}btn-icon colour-inherit text-decoration-none d-flex align-items-center justify-content-center{{/settings.togglemoreicon}}"
67
           role="button"
68
           data-toggle="dropdown"
69
           data-boundary="window"
70
           aria-haspopup="true"
71
           tabindex="0"
72
           aria-controls="forum-action-menu-{{id}}-menu"
73
           aria-label="{{#str}}togglediscussionmenu, mod_forum{{/str}}"
74
           aria-expanded="false">
75
            {{#settings.togglemoreicon}}
76
                {{#pix}} i/menu, core{{/pix}}
77
            {{/settings.togglemoreicon}}
78
            {{^settings.togglemoreicon}}
79
                {{#pix}} i/settings, core{{/pix}}
80
            {{/settings.togglemoreicon}}
81
            {{^settings.excludetext}}
82
                {{#str}} settings, mod_forum {{/str}}
83
            {{/settings.excludetext}}
84
        </a>
85
    {{/settingsselector}}
86
    <div class="dropdown-menu dropdown-menu-right"
87
         aria-labelledby="forum-action-menu-{{id}}-menu"
88
         data-rel="menu-content"
89
         role="menu"
90
         id="forum-action-menu-{{id}}-menu">
91
        {{#capabilities.favourite}}
92
            {{> mod_forum/discussion_favourite_toggle}}
93
        {{/capabilities.favourite}}
94
        {{#capabilities.pin}}
95
            {{> mod_forum/discussion_pin_toggle}}
96
        {{/capabilities.pin}}
97
        {{#capabilities.manage}}
98
            {{^istimelocked}}
99
                {{> forum/discussion_lock_toggle }}
100
            {{/istimelocked}}
101
        {{/capabilities.manage}}
102
        {{^settings.excludesubscription}}
103
            {{> forum/discussion_subscription_toggle }}
104
        {{/settings.excludesubscription}}
105
        {{#unread}}
106
            {{> forum/mark_as_read }}
107
        {{/unread}}
108
    </div>
109
</div>