{{!
    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_subject_with_context_links

    Template to render a breadcrumb-style subject.

    Classes required for JS:
    * none

    Data attributes required for JS:
    * none

    Example context (json):
    {
        "coursename": "Test course",
        "forumname": "Test forum",
        "discussionname": "Test discussion",
        "subject": "Test post subject",
        "urls": {
            "viewcourse": "#",
            "viewforum": "#",
            "viewdiscussion": "#",
            "viewparent": "#"
        },
        "showdiscussionname": true,
        "hasparent": true
    }
}}
<ol class="breadcrumb breadcrumb--in-content my-1 forum-post-core-subject">
{{#coursename}}
    {{#urls.viewcourse}}
        <li class="breadcrumb-item"><a href="{{{urls.viewcourse}}}"><span class="text-truncate">{{{coursename}}}</span></a></li>
    {{/urls.viewcourse}}
    {{^urls.viewcourse}}
        <li class="breadcrumb-item"><span class="breadcrumbs-textonly"><span class="text-truncate">{{coursename}}</span></span></li>
    {{/urls.viewcourse}}
{{/coursename}}
{{#urls.viewforum}}
    <li class="breadcrumb-item"><a href="{{{urls.viewforum}}}"><span class="text-truncate">{{{forumname}}}</span></a></li>
{{/urls.viewforum}}
{{^urls.viewforum}}
    <li class="breadcrumb-item"><span class="breadcrumbs-textonly"><span class="text-truncate">{{{forumname}}}</span></span></li>
{{/urls.viewforum}}
{{#showdiscussionname}}
    {{#urls.viewdiscussion}}
        <li class="breadcrumb-item"><a href="{{{urls.viewdiscussion}}}"><span class="text-truncate">{{{discussionname}}}</span></a></li>
    {{/urls.viewdiscussion}}
    {{^urls.viewdiscussion}}
        <li class="breadcrumb-item"><span class="breadcrumbs-textonly"><span class="text-truncate">{{{discussionname}}}</span></span></li>
    {{/urls.viewdiscussion}}
    {{#hasparent}}
        {{#urls.viewparent}}
            <li class="breadcrumb-item"><a href="{{{urls.viewparent}}}"><span class="text-truncate">{{{subject}}}</span></a></li>
        {{/urls.viewparent}}
        {{^urls.viewparent}}
            <li class="breadcrumb-item"><span class="breadcrumbs-textonly"><span class="text-truncate">{{{subject}}}</span></span></li>
        {{/urls.viewparent}}
    {{/hasparent}}
{{/showdiscussionname}}
</ol>