{% import "forms.twig" as forms %}
{% verbatim %}
<script type="text/x-handlebars-template" id="reminderEventTemplate">
            <div class="form-group row">
                <input class="form-control" name="reminder_scheduleReminderId[]" type="hidden" value="{{ scheduleReminderId }}" />

                <div class="col-sm-2">
                    <label for="reminder_value[]">
                        <input class="form-control" name="reminder_value[]" type="number" value="{{ value }}" />
                    </label>
                </div>
                <div class="col-sm-2">
                    <label for="reminder_type[]">
                        <select class="form-control" name="reminder_type[]">
                            <option value="1" {{#eq type 1}}selected{{/eq}}>{% endverbatim %}{% trans "Minute" %}{% verbatim %}</option>
                            <option value="2" {{#eq type 2}}selected{{/eq}}>{% endverbatim %}{% trans "Hour" %}{% verbatim %}</option>
                            <option value="3" {{#eq type 3}}selected{{/eq}}>{% endverbatim %}{% trans "Day" %}{% verbatim %}</option>
                            <option value="4" {{#eq type 4}}selected{{/eq}}>{% endverbatim %}{% trans "Week" %}{% verbatim %}</option>
                            <option value="5" {{#eq type 5}}selected{{/eq}}>{% endverbatim %}{% trans "Month" %}{% verbatim %}</option>
                        </select>
                    </label>
                </div>
                <div class="col-sm-3">
                    <label for="reminder_option[]">
                        <select class="form-control" name="reminder_option[]">
                            <option value="1" {{#eq option 1}}selected{{/eq}}>{% endverbatim %}{% trans "Before schedule starts" %}{% verbatim %}</option>
                            <option value="2" {{#eq option 2}}selected{{/eq}}>{% endverbatim %}{% trans "After schedule starts" %}{% verbatim %}</option>
                            <option value="3" {{#eq option 3}}selected{{/eq}}>{% endverbatim %}{% trans "Before schedule ends" %}{% verbatim %}</option>
                            <option value="4" {{#eq option 4}}selected{{/eq}}>{% endverbatim %}{% trans "After schedule ends" %}{% verbatim %}</option>
                        </select>
                    </label>
                </div>
                <div class="col-sm-3">
                    <label for="reminder_isEmail[]">
                        <input type="checkbox" name="reminder_isEmail[]" {{#eq isEmail 1}}checked{{/eq}}/>
                        {% endverbatim %}{% trans "Notify by email?" %}{% verbatim %}
                        <input type="hidden" name="reminder_isEmailHidden[]" />
                    </label>
                </div>
                <div class="col-sm-2">
                    <button class="btn btn-white"><i class="fa {{ buttonGlyph }}"></i></button>
                </div>
            </div>
</script>

{% endverbatim %}
<script type="text/x-handlebars-template" id="full-screen-schedule-template">
            <!-- Modal -->
            <div id="full-screen-schedule-modal" class="modal fade inner-modal" role="dialog">
                <div class="modal-dialog modal-md modal-dialog-centered">
                    <!-- Modal content-->
                    <div class="modal-content">
                        <div class="modal-header bg-light">
                            <h4 class="modal-title">{% verbatim %}{{#eq type "Media"}}{% endverbatim %}{% trans "Select Media" %}{% verbatim %}{{/eq}}{{#eq type "Playlist"}}{% endverbatim %}
                             {% trans "Select Playlist" %}{% verbatim %}{{/eq}}{% endverbatim %}</h4>
                            <button type="button" class="close" data-dismiss="modal">&times;</button>
                        </div>
                        <div class="modal-body">
                            <form id="scheduleFullScreenForm" autocomplete="off" class="form-horizontal" method="post" action="{{ url_for('layout.add.full.screen.schedule') }}"
                             data-full-screen-url="{{ url_for('layout.add.full.screen.schedule') }}">
                            {% verbatim %}
                                <input type="hidden" id="eventTypeId" value="{{ eventTypeId }}">
                            {{#eq type "Media"}}
                            {% endverbatim %}
                                {% set title %}{% trans "Media" %}{% endset %}
                                {% set helpText %}{% trans "Select a Media file from the Library to use. The selected file will be shown full screen for this event." %}{% endset %}
                                {% set attributes = [
                                    { name: "data-width", value: "100%" },
                                    { name: "data-search-url", value: url_for("library.search") ~ "?fullScreenScheduleCheck=true&types[]=image&types[]=video" },
                                    { name: "data-search-term", value: "media" },
                                    { name: "data-id-property", value: "mediaId" },
                                    { name: "data-text-property", value: "name" },
                                    { name: "data-additional-property", value: "hasFullScreenLayout" },
                                    { name: "data-initial-key", value: "mediaId"},
                                    { name: "data-initial-value", value: mediaId}
                                ] %}
                                {{ forms.dropdown("mediaId", "single", title, "", null, "mediaId", "name", helpText, "pagedSelect media-control", "", "", "", attributes, "", "", "", readonlySelect) }}

                                {% verbatim %}
                                 {{/eq}}
                                 {{#eq type "Playlist"}}
                                 {% endverbatim %}
                                {% set title %}{% trans "Playlist" %}{% endset %}
                                {% set helpText %}{% trans "Select a Playlist to use. The selected playlist will be shown full screen for this event." %}{% endset %}
                                {% set attributes = [
                                    { name: "data-width", value: "100%" },
                                    { name: "data-search-url", value: url_for("playlist.search") ~ "?fullScreenScheduleCheck=true" },
                                    { name: "data-search-term", value: "name" },
                                    { name: "data-id-property", value: "playlistId" },
                                    { name: "data-text-property", value: "name" },
                                    { name: "data-additional-property", value: "hasFullScreenLayout" },
                                    { name: "data-initial-key", value: "playlistId"},
                                    { name: "data-initial-value", value: playlistId}
                                ] %}
                                {{ forms.dropdown("playlistId", "single", title, "", null, "playlistId", "name", helpText, "pagedSelect playlist-control", "", "", "", attributes, "", "", "", readonlySelect) }}
                                {% verbatim %}
                                {{/eq}}
                                {% endverbatim %}

                                {% set title %}{% trans "Duration in loop" %}{% endset %}
                                {% set helpText %}{% trans "Set how long this item should be shown each time it appears in the schedule. Leave blank to use the Media Duration set in the Library" %}{% endset %}
                                {{ forms.number('layoutDuration', title, "", helpText, 'media-control no-full-screen-layout') }}

                                {% set title %}{% trans "Resolution" %}{% endset %}
                                {% set helpText %}{% trans "Optionally select a Resolution to use for the selected Media. Leave blank to match with an existing Resolution closest in size to the selected media." %}{% endset %}
                                {% set attributes = [
                                    { name: "data-search-url", value: url_for("resolution.search") },
                                    { name: "data-search-term", value: "resolution" },
                                    { name: "data-id-property", value: "resolutionId" },
                                    { name: "data-text-property", value: "resolution" },
                                    { name: "data-trans-media-help-text", value: "Optionally select a Resolution to use for the selected Media. Leave blank to match with an existing Resolution closest in size to the selected media."|trans },
                                    { name: "data-trans-playlist-help-text", value: "Optionally select a Resolution to use for the selected Playlist. Leave blank to default to a 1080p Resolution"|trans },
                                ] %}
                                {{ forms.dropdown("resolutionId", "single", title, "", null, "resolutionId", "resolution", helpText, "pagedSelect media-playlist-control resolution-control no-full-screen-layout", "", "", "", attributes) }}

                                {% set title %}{% trans "Background Colour" %}{% endset %}
                                {% set helpText %}{% trans "Optionally set a colour to use as a background for if the item selected does not fill the entire screen" %}{% endset %}
                                {{ forms.colorPicker("backgroundColor", title, '#000', helpText, 'media-playlist-control no-full-screen-layout') }}
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-outline-primary" id="btnFullScreenLayoutConfirm">{% trans "Save" %}</button>
                        </div>
                    </div>
                </div>
            </div>

</script>