{{!
    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 core_course/completion_automatic

    Template for displaying an automatic completion rule and its status.

    Example context (json):
    {
        "statuscomplete": 1,
        "description": "View",
        "istrackeduser": true,
        "accessibledescription": "Done: View (Set by Admin User)"
    }
}}
{{#istrackeduser}}
    {{#statuscomplete}}
    <span class="badge-sm badge-success my-1 mr-1" role="listitem" {{!
        }}{{#accessibledescription}}{{!
            }}title="{{.}}" {{!
            }}aria-label="{{.}}" {{!
        }}{{/accessibledescription}}>
        <svg width="14" height="14" fill="none" viewBox="0 0 24 24">
            <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5.75 12.8665L8.33995 16.4138C9.15171 17.5256 10.8179 17.504 11.6006 16.3715L18.25 6.75"/>
        </svg>
        <strong class="mx-2">{{#str}}completion_automatic:done, core_course{{/str}}</strong> <span class="font-weight-normal">{{description}}</span>
    </span>
    {{/statuscomplete}}
    {{#statuscompletefail}}
    <span class="badge-sm badge-danger my-1 mr-1" role="listitem" {{!
        }}{{#accessibledescription}}{{!
            }}title="{{.}}" {{!
            }}aria-label="{{.}}" {{!
        }}{{/accessibledescription}}>
        <strong class="mr-2">{{#str}}completion_automatic:failed, core_course{{/str}}</strong> <span class="font-weight-normal">{{description}}</span>
    </span>
    {{/statuscompletefail}}
    {{#statusincomplete}}
    <span class="badge-sm badge-secondary my-1 mr-1" role="listitem" {{!
        }}{{#accessibledescription}}{{!
            }}title="{{.}}" {{!
            }}aria-label="{{.}}" {{!
        }}{{/accessibledescription}}>
        <strong>{{#str}}completion_automatic:todo, core_course{{/str}}</strong> <span class="ml-2 font-weight-normal">{{description}}</span>
    </span>
    {{/statusincomplete}}
{{/istrackeduser}}
{{^istrackeduser}}
    <span class="badge-sm badge-secondary my-1 mr-1" role="listitem">
        <span>{{description}}</span>
    </span>
{{/istrackeduser}}
