subtitles: Add documentation, limit uploads to *.vtt files, only show for video ...
[mediagoblin.git] / mediagoblin / plugins / subtitles / forms.py
CommitLineData
c27ecd5b 1# GNU MediaGoblin -- federated, autonomous media hosting
7ab18019 2# Copyright (C) 2016 MediaGoblin contributors. See AUTHORS.
c27ecd5b 3#
4# This program is free software: you can redistribute it and/or modify
5# it under the terms of the GNU Affero General Public License as published by
6# the Free Software Foundation, either version 3 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Affero General Public License for more details.
13#
14# You should have received a copy of the GNU Affero General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17import wtforms
18
a9b7bd60
BS
19from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
20
c27ecd5b 21class CustomizeSubtitlesForm(wtforms.Form):
22 subtitle = wtforms.TextAreaField(
23 ('Subtitle'),
24 [wtforms.validators.Optional()],
a9b7bd60 25 description=_('Subtitles in <a href="https://en.wikipedia.org/wiki/WebVTT" target="_blank">WebVTT format</a>'))
c27ecd5b 26
27class EditSubtitlesForm(wtforms.Form):
28 subtitle_language = wtforms.StringField(
29 'Language')
30 subtitle_file = wtforms.FileField(
a9b7bd60
BS
31 'File',
32 description=_('Subtitles in <a href="https://en.wikipedia.org/wiki/WebVTT" target="_blank">WebVTT format</a>'))