{{!
    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 mod_plenum/report_motion

    This template will render the Plenary meeting single motion view page

    Variables required for this template:
    * motion - Motion data

    Variables optional for this template:

    Example context (json):
    {
        "motion": {
            "id": 3,
            "name": "Open",
            "type": "open",
            "typename": "Open",
            "user": {
                "fullname": "Joe Robert",
                "pictureurl": "https://example.com/pluginfile.php/345/user/icon/boost/f2?rev=31226"
            }
        }
    }
}}

<div data-motion="{{ motion.id }}" class="card plenum_motion_{{ motion.type }} m-1">
    <div class="card-body">
        <h5 class="card-title">
                {{^ motion.preview }}
                {{ motion.typename}}{{# motion.data.name }}: {{ motion.data.name }} {{/ motion.data.name }}
                {{/ motion.preview }}
                {{# motion.preview }}
                <a src="#" data-action="preview">{{ motion.typename}}{{# motion.data.name }}: {{ motion.data.name }} {{/ motion.data.name }} <i class="fa fa-magnifying-glass"></i></a>
                {{/ motion.preview }}
        </h5>
        <div class="">
            <div class="float-right">{{ motion.start }}</div>
                  {{# motion.immediate }}
                      <img class="" src="{{ motion.user.pictureurl }}" alt="{{ motion.user.fullname }}">
                  {{/ motion.immediate }}
                  {{^ motion.pending }}
                      <img class="" src="{{ motion.user.pictureurl }}" alt="{{ motion.user.fullname }}">
                  {{/ motion.pending }}
                  {{ motion.user.fullname }}
        </div>
        <div class="">
            <div class="card-text">
                {{ motion.content }}
                {{# motion.needssecond }}
                    <div class="alert alert-warning m-1">
                    {{# str }} needssecond, mod_plenum {{/ str }}
                    </div>
                {{/ motion.needssecond }}
            </div>
        </div>
        <div class="card-text m-3">
            {{# parent }}
                <div data-motion="{{parent}}">
                    <button class="btn btn-success m-1" data-action="preview">{{# str }} precedingmotion, mod_plenum {{/ str }}</button>
                </div>
            {{/ parent }}
{{debug}}
        </div>
    </div>
</div>
