fediplan/templates/fediplan/schedule.html.twig
2019-08-09 14:11:13 +02:00

375 lines
17 KiB
Twig
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends 'base.html.twig' %}
{% trans_default_domain 'fediplan' %}
{% block title %}{{ 'common.schedule'|trans }}{% endblock %}
{% block content %}
{% include 'nav.html.twig' %}
<h1>Schedule</h1>
{{ form_row(form._token) }}
<div class="row">
<div class="col-md-12">
<div class="row">
<div class=" col-md-6">
<div class="form-group has-feedback">
{{ form_label(form.content_warning) }}
{{ form_widget(form.content_warning, {'attr': {'class': 'form-control'}}) }}
{% if not form.content_warning.vars.errors is empty %}
<span class="label label-danger">
{% for errorItem in form.content_warning.vars.errors %}
{{ errorItem.message }}
{% endfor %}
</span>
{% endif %}
</div>
</div>
</div>
<div class="row">
<div class=" col-md-6">
<div class="form-group has-feedback">
{{ form_label(form.content) }}
{{ form_widget(form.content, {'attr': {'class': 'form-control','id':'composer_content'}}) }}
{% if not form.content.vars.errors is empty %}
<span class="label label-danger">
{% for errorItem in form.content.vars.errors %}
{{ errorItem.message }}
{% endfor %}
</span>
{% endif %}
</div>
</div>
</div>
<div class="row">
<div class=" col-md-3">
<div class="form-group has-feedback">
{{ form_label(form.visibility) }}
{{ form_widget(form.visibility, {'attr': {'class': 'form-control'}}) }}
{% if not form.visibility.vars.errors is empty %}
<span class="label label-danger">
{% for errorItem in form.visibility.vars.errors %}
{{ errorItem.message }}
{% endfor %}
</span>
{% endif %}
</div>
</div>
</div>
<div class="row">
<div class=" col-md-4">
<div class="form-group has-feedback">
{{ form_label(form.scheduled_at) }}
{{ form_widget(form.scheduled_at, {'attr': {'class': 'form-control'}}) }}
{% if not form.scheduled_at.vars.errors is empty %}
<span class="label label-danger">
{% for errorItem in form.scheduled_at.vars.errors %}
{{ errorItem.message }}
{% endfor %}
</span>
{% endif %}
</div>
</div>
<div class=" col-md-7"></div>
</div>
</div>
<div class="container">
<!-- The file upload form used as target for the file upload widget -->
<form
id="fileupload"
action="https://jquery-file-upload.appspot.com/"
method="POST"
enctype="multipart/form-data"
>
<!-- Redirect browsers with JavaScript disabled to the origin page -->
<noscript
><input
type="hidden"
name="redirect"
value="https://blueimp.github.io/jQuery-File-Upload/"
/></noscript>
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<div class="row fileupload-buttonbar">
<div class="col-lg-7">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
<i class="glyphicon glyphicon-plus"></i>
<span>Add files...</span>
<input type="file" name="files[]" multiple />
</span>
<button type="submit" class="btn btn-primary start">
<i class="glyphicon glyphicon-upload"></i>
<span>Start upload</span>
</button>
<button type="reset" class="btn btn-warning cancel">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>Cancel upload</span>
</button>
<button type="button" class="btn btn-danger delete">
<i class="glyphicon glyphicon-trash"></i>
<span>Delete selected</span>
</button>
<input type="checkbox" class="toggle" />
<!-- The global file processing state -->
<span class="fileupload-process"></span>
</div>
<!-- The global progress state -->
<div class="col-lg-5 fileupload-progress fade">
<!-- The global progress bar -->
<div
class="progress progress-striped active"
role="progressbar"
aria-valuemin="0"
aria-valuemax="100"
>
<div
class="progress-bar progress-bar-success"
style="width:0%;"
></div>
</div>
<!-- The extended global progress state -->
<div class="progress-extended">&nbsp;</div>
</div>
</div>
<!-- The table listing the files available for upload/download -->
<table role="presentation" class="table table-striped">
<tbody class="files"></tbody>
</table>
</form>
</div>
</div>
{% endblock %}
{% block stylesheets %}
{{ parent() }}
<link rel="stylesheet" href="{{ asset('js/jQuery-File-Upload-10.1.0/css/doka.min.css') }}">
<link rel="stylesheet" href="{{ asset('js/jQuery-File-Upload-10.1.0/css/blueimp-gallery.min.css') }}">
<link rel="stylesheet" href="{{ asset('js/jQuery-File-Upload-10.1.0/css/jquery.fileupload.css') }}">
{% endblock %}
{% block javascripts %}
<!-- The blueimp Gallery widget -->
<div
id="blueimp-gallery"
class="blueimp-gallery blueimp-gallery-controls"
data-filter=":even"
>
<div class="slides"></div>
<h3 class="title"></h3>
<a class="prev"></a>
<a class="next"></a>
<a class="close">×</a>
<a class="play-pause"></a>
<ol class="indicator"></ol>
</div>
{% verbatim %}
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload">
<td>
<span class="preview"></span>
</td>
<td>
{% if (window.innerWidth > 480 || !o.options.loadImageFileTypes.test(file.type)) { %}
<p class="name">{%=file.name%}</p>
{% } %}
<strong class="error text-danger"></strong>
</td>
<td>
<p class="size">Processing...</p>
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="progress-bar progress-bar-success" style="width:0%;"></div></div>
</td>
<td>
{% if (!o.options.autoUpload && o.options.edit && o.options.loadImageFileTypes.test(file.type)) { %}
<button class="btn btn-success edit" data-index="{%=i%}" disabled>
<i class="glyphicon glyphicon-edit"></i>
<span>Edit</span>
</button>
{% } %}
{% if (!i && !o.options.autoUpload) { %}
<button class="btn btn-primary start" disabled>
<i class="glyphicon glyphicon-upload"></i>
<span>Start</span>
</button>
{% } %}
{% if (!i) { %}
<button class="btn btn-warning cancel">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>Cancel</span>
</button>
{% } %}
</td>
</tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-download">
<td>
<span class="preview">
{% if (file.thumbnailUrl) { %}
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
{% } %}
</span>
</td>
<td>
{% if (window.innerWidth > 480 || !file.thumbnailUrl) { %}
<p class="name">
{% if (file.url) { %}
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
{% } else { %}
<span>{%=file.name%}</span>
{% } %}
</p>
{% } %}
{% if (file.error) { %}
<div><span class="label label-danger">Error</span> {%=file.error%}</div>
{% } %}
</td>
<td>
<span class="size">{%=o.formatFileSize(file.size)%}</span>
</td>
<td>
{% if (file.deleteUrl) { %}
<button class="btn btn-danger delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
<i class="glyphicon glyphicon-trash"></i>
<span>Delete</span>
</button>
<input type="checkbox" name="delete" value="1" class="toggle">
{% } else { %}
<button class="btn btn-warning cancel">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>Cancel</span>
</button>
{% } %}
</td>
</tr>
{% } %}
</script>
{% endverbatim %}
<script src="{{ asset('js/jquery.min.js') }}"></script>
<script src="{{ asset('js/jQuery-File-Upload-10.1.0/js/vendor/jquery.ui.widget.js') }}"></script>
<script src="{{ asset('js/jQuery-File-Upload-10.1.0/js/tmpl.min.js') }}"></script>
<script src="{{ asset('js/jQuery-File-Upload-10.1.0/js/load-image.all.min.js') }}"></script>
<script src="{{ asset('js/jQuery-File-Upload-10.1.0/js/canvas-to-blob.min.js') }}"></script>
<script src="{{ asset('js/bootstrap.min.js') }}"></script>
<!-- Doka Image Editor polyfills -->
<script>
[
{
supported: 'Promise' in window,
fill:
'https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js'
},
{
supported: 'fetch' in window,
fill: 'https://cdn.jsdelivr.net/npm/fetch-polyfill@0.8.2/fetch.min.js'
},
{
supported:
'CustomEvent' in window &&
'log10' in Math &&
'sign' in Math &&
'assign' in Object &&
'from' in Array &&
['find', 'findIndex', 'includes'].reduce(function(previous, prop) {
return prop in Array.prototype ? previous : false;
}, true),
fill: 'js/vendor/doka.polyfill.min.js'
}
].forEach(function(p) {
if (p.supported) return;
document.write('<script src="' + p.fill + '"><\/script>');
});
</script>
<script src="{{ asset('js/jQuery-File-Upload-10.1.0/js/vendor/doka.min.js') }}"></script>
<script src="{{ asset('js/jQuery-File-Upload-10.1.0/js/vendor/jquery.blueimp-gallery.min.js') }}"></script>
<script src="{{ asset('js/jQuery-File-Upload-10.1.0/js/jquery.iframe-transport.js') }}"></script>
<script src="{{ asset('js/jQuery-File-Upload-10.1.0/js/jquery.fileupload.js') }}"></script>
<script src="{{ asset('js/jQuery-File-Upload-10.1.0/js/jquery.fileupload-process.js') }}"></script>
<script src="{{ asset('js/jQuery-File-Upload-10.1.0/js/jquery.fileupload-image.js') }}"></script>
<script src="{{ asset('js/jQuery-File-Upload-10.1.0/js/jquery.fileupload-audio.js') }}"></script>
<script src="{{ asset('js/jQuery-File-Upload-10.1.0/js/jquery.fileupload-video.js') }}"></script>
<script src="{{ asset('js/jQuery-File-Upload-10.1.0/js/jquery.fileupload-validate.js') }}"></script>
<script src="{{ asset('js/jQuery-File-Upload-10.1.0/js/jquery.fileupload-ui.js') }}"></script>
<script type="text/javascript">
$(function() {
'use strict';
// Initialize the jQuery File Upload widget:
$('#fileupload').fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
headers: [{ name: 'Authorization', value: '{{ token }}' }],
url: 'schedule/'
});
// Enable iframe cross-domain access via redirect option:
$('#fileupload').fileupload(
'option',
'redirect',
window.location.href.replace(/\/[^/]*$/, '/cors/result.html?%s')
);
if (window.location.hostname === 'blueimp.github.io') {
// Demo settings:
$('#fileupload').fileupload('option', {
url: '//jquery-file-upload.appspot.com/',
// Enable image resizing, except for Android and Opera,
// which actually support image resizing, but fail to
// send Blob objects via XHR requests:
disableImageResize: /Android(?!.*Chrome)|Opera/.test(
window.navigator.userAgent
),
maxFileSize: 999000,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i
});
// Upload server status check for browsers with CORS support:
if ($.support.cors) {
$.ajax({
url: '//jquery-file-upload.appspot.com/',
type: 'HEAD'
}).fail(function() {
$('<div class="alert alert-danger"/>')
.text('Upload server currently unavailable - ' + new Date())
.appendTo('#fileupload');
});
}
} else {
// Load existing files:
$('#fileupload').addClass('fileupload-processing');
$.ajax({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: $('#fileupload').fileupload('option', 'url'),
dataType: 'json',
context: $('#fileupload')[0]
})
.always(function() {
$(this).removeClass('fileupload-processing');
})
.done(function(result) {
$(this)
.fileupload('option', 'done')
// eslint-disable-next-line new-cap
.call(this, $.Event('done'), { result: result });
});
}
});
</script>
{% endblock %}