all teh german

stable
neingeist 6 years ago
parent 965f0da2bb
commit e1ebe66806

@ -23,10 +23,10 @@ attachment_filenames = {}
class DownloadForm(FlaskForm):
start_time = DateTimeField('Start time',
start_time = DateTimeField('Startzeit',
validators=[InputRequired()],
format='%Y-%m-%d %H:%M')
length = IntegerField('Length',
length = IntegerField('Länge',
validators=[
InputRequired(),
NumberRange(min=1, max=app.config['MAX_LENGTH'])])
@ -43,12 +43,12 @@ def download():
try:
output_filename, attachment_filename = prepare_download(form)
attachment_filenames[output_filename] = attachment_filename
flash('The download should start immediately.', 'success')
flash('Der Download sollte sofort starten.', 'success')
return render_template('download.html', form=form, filename=output_filename)
except ValueError as e:
flash('Error preparing download: {}'.format(e), 'warning')
flash('Fehler beim Erstellen des Downloads: {}'.format(e), 'warning')
else:
flash('Error in form!', 'warning')
flash('Fehler im Formular!', 'warning')
return render_template('download.html', form=form)
@ -96,7 +96,7 @@ def prepare_download(form):
if source['start_time'] <= form.start_time.data < source['start_time'] + source['length']:
start_index = i
if start_index is None:
raise ValueError('Could not find start file')
raise ValueError('Konnte Startdatei nicht finden!')
sources = sources[start_index:]
# Super lazy: Limit to 5 source files input

@ -11,7 +11,7 @@
{% endblock %}
{% block page_header %}
<h1>Download</h1>
<h1>Sendungsmitschnitt herunterladen</h1>
{% endblock %}
{% block app_content %}
@ -25,12 +25,13 @@
{% block scripts %}
{{ super() }}
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment-with-locales.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#start_time').datetimepicker({
locale: 'de',
format: 'YYYY-MM-DD HH:mm',
sideBySide: true
});

Loading…
Cancel
Save