{{!
    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 local_unifiedgrader/note_item

    Renders a single teacher note. Used by JS to populate the notes list.

    Context variables required:
    * id - int - Note ID
    * authorname - string - Author full name
    * content - string - Formatted note content
    * timecreated - int - Timestamp
    * canmanagenotes - bool - Whether the current user can delete this note

    Example context (json):
    {
        "id": 1,
        "authorname": "Prof Smith",
        "content": "Student needs additional support.",
        "timecreated": 1708000000,
        "canmanagenotes": true
    }
}}
<div class="note-item mb-2 p-2 rounded" data-noteid="{{id}}">
    <div class="d-flex justify-content-between align-items-start">
        <small class="text-muted">
            <strong>{{authorname}}</strong>
            &middot;
            <span data-region="note-time">{{timecreated}}</span>
        </small>
        {{#canmanagenotes}}
        <button data-action="delete-note"
                data-noteid="{{id}}"
                class="btn btn-sm btn-link text-danger p-0"
                type="button"
                title="{{#str}} deletenote, local_unifiedgrader {{/str}}">
            &times;
        </button>
        {{/canmanagenotes}}
    </div>
    <div class="mt-1 small">{{{content}}}</div>
</div>
