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/imagegrid
    Template to show the grid of the imageboard.

    Example context (json):
    {
        "helpergrids": [
            {
                "x": 10,
                "y": 10
            },
            {
                "x": 20,
                "y": 10
            },
            {
                "x": 30,
                "y": 10
            },
            {
                "x": 10,
                "y": 20
            }
        ],
        "gridcolor": "#000000",
        "cmid": "140"
    }
}}
<div id="unilabeltype-imageboard-helpergrid-{{cmid}}" class="hidden">
    {{#helpergrids}}
        <div style="position: absolute;
                left: {{x}}px;
                top: {{y}}px;
                width: 50px;
                height: 50px;
                border-right: solid 1px {{gridcolor}};
                border-bottom: solid 1px {{gridcolor}};
                z-index: 1;">
        </div>

        <!-- xAxis -->
        {{^y}}
            <div style="position: absolute;
                    left: calc({{x}}px - 10px);
                    top: -12px;
                    color: #fff;
                    text-shadow: 2px 2px #02023f;
                    z-index: 1;">
                {{x}}
            </div>
        {{/y}}

        <!-- yAxis -->
        {{^x}}
            <div style="position: absolute;
                    left: 0;
                    top: calc({{y}}px - 12px);
                    color: #fff;
                    text-shadow: 2px 2px #02023f;
                    z-index: 1;">
                {{y}}
            </div>
        {{/x}}

    {{/helpergrids}}

</div>