Proyectos de Subversion Moodle

Rev

Autoría | Ultima modificación | Ver Log |

{{!
    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 unilabeltype_imageboard/imagelist
    Template to show a list of all images related to the imageboard.

    Example context (json):
    {
        "images": [
            {
                "title": "",
                "url": "http://localhost/mod/forum/view.php?id=136",
                "newwindow": 1,
                "imageurl": "http://localhost/image1.png",
                "nr": 0
            },
            {
                "title": "",
                "url": "",
                "newwindow": 1,
                "imageurl": "http://localhost/image2.png",
                "nr": 1
            }
        ],
        "cmid": "140"
    }
}}
<div class="unilabel-imageboard-list">
    <a class="unilabeltype-imageboard-controllbutton" href="#" data-toggle="collapse" data-target="#unilabel-imageboard-list{{cmid}}"
            aria-expanded="false" aria-controls="unilabel-imageboard-list{{cmid}}">
        <i class="fa fa-list fa-fw"></i> {{#str}} imagelist, unilabeltype_imageboard {{/str}}
    </a>
    <div class="collapse unilabel-imageboard-list-collapsable mt-2" id="unilabel-imageboard-list{{cmid}}">
        <ul class="list-group">
            {{#images}}
                <li class="list-group-item list-group-item-action">
                    <div class="d-flex">
                        <div class="unilabel-imageboard-list-nr">
                            {{nr}}
                        </div>
                        <div{{^imageurl}} class="text-muted"{{/imageurl}}>
                            {{#imageurl}}
                                <img class="rounded mr-2" src="{{{imageurl}}}" width="40" alt="{{title}}">
                            {{/imageurl}}
                            {{^imageurl}}
                                <i style="width: 40px" class="fa fa-picture-o fa-lg fa-fw mr-2"></i>
                            {{/imageurl}}
                            {{#url}}<a href="{{{.}}}"{{#newwindow}} target="_blank"{{/newwindow}}>{{/url}}
                                {{title}}
                            {{#url}}</a>{{/url}}
                        </div>
                    </div>
                </li>
            {{/images}}
        </ul>
    </div>
</div>