MDL-64820 forum: fix up issues from review
[moodle.git] / mod / forum / templates / forum_posts_with_context_links.mustache
1 {{!
2     This file is part of Moodle - http://moodle.org/
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.
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.
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_posts_with_context_links
20     Template to render a list of posts with breadcrumb style subject and a link
21     in the footer to the full discussion.
23     Classes required for JS:
24     * none
26     Data attributes required for JS:
27     * none
29     Example context (json):
30     {
31     }
32 }}
33 {{#posts}}
34     {{< mod_forum/forum_discussion_post }}
35         {{$subject}}
36             {{#coursename}}
37                 {{#urls.viewcourse}}
38                     <a href="{{{urls.viewcourse}}}">{{{coursename}}}</a> ->
39                 {{/urls.viewcourse}}
40                 {{^urls.viewcourse}}
41                     {{coursename}} ->
42                 {{/urls.viewcourse}}
43             {{/coursename}}
44             {{#urls.viewforum}}
45                 <a href="{{{urls.viewforum}}}">{{{forumname}}}</a>
46             {{/urls.viewforum}}
47             {{^urls.viewforum}}
48                 {{{forumname}}}
49             {{/urls.viewforum}}
50             {{#showdiscussionname}}
51                 {{#urls.viewdiscussion}}
52                     -> <a href="{{{urls.viewdiscussion}}}">{{{discussionname}}}</a>
53                 {{/urls.viewdiscussion}}
54                 {{^urls.viewdiscussion}}
55                     {{{discussionname}}}
56                 {{/urls.viewdiscussion}}
57                 {{#hasparent}}
58                     {{#urls.viewparent}}
59                         -> <a href="{{{urls.viewparent}}}">{{{subject}}}</a>
60                     {{/urls.viewparent}}
61                     {{^urls.viewparent}}
62                         {{{subject}}}
63                     {{/urls.viewparent}}
64                 {{/hasparent}}
65             {{/showdiscussionname}}
66         {{/subject}}
67         {{$replies}}{{/replies}}
68         {{$footer}}
69             <div><a href="{{{urls.view}}}">{{#str}} postincontext, mod_forum {{/str}}</a></div>
70         {{/footer}}
71     {{/ mod_forum/forum_discussion_post }}
72 {{/posts}}