{{!
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_deepler/glossary_table_view
    displays lists of glossaries (non managebale) to user prefs.

    Classes required for JS: none

      Data attributes required for JS: none

      Context variables required for this template:
      * title
      * glossaries
          * glossaryid
          * name
          * sourcelang
          * targetlang
          * entrycount
          * entrycountlink
          * lastused

    Example context (json):
    {
    "title":"title",
    "glossaries": [
        {"glossaryid": "uuid",
        "name": "myglossary",
        "sourcelang": "en",
        "targetlang": "ja",
        "entrycount": "3",
        "entrycountlink" :"<a href='#' class='action-icon' data-id='local_deepler/glossary_entriesviewer' data-source='en' data-target='ja'><i class='icon fa fa-magnifying-glass-plus fa-fw' title='View' role='img' aria-label='View'></i></a>",
        "lastused": "Monday 4 april 2025"
    }]
    }
}}
<h4>{{title}}</h4>
<table class="generaltable">
    <thead>
    <tr>
        <th>{{#str}}glossary:name, local_deepler{{/str}}</th>
        <th>{{#str}}glossary:sourcelang, local_deepler{{/str}} &gt; {{#str}}glossary:targetlang, local_deepler{{/str}}</th>
        <th>{{#str}}glossary:nbentries, local_deepler{{/str}}</th>
        <th>{{#str}}glossary:lastused, local_deepler{{/str}}</th>
    </tr>
    </thead>
    <tbody>
    {{#glossaries}}
        <tr>
            <td title="{{glossaryid}}"><strong>{{name}}</strong><br><small>{{glossaryid}}</small></td>
            <td>{{sourcelang}} &gt; {{targetlang}}</td>
            <td>{{entrycount}} {{{entrycountlink}}}</td>
            <td>{{lastused}}</td>
        </tr>
    {{/glossaries}}
    </tbody>
</table>
