[x] 1. The lang-wrapper should be displayed on page load.
[x] 2. The lang-picker selector should have the following default text: "Please select a file first."
[x] 3. The lang-picker selector should be disabled until a file is added.
[x] 4. After file is added, lang-picker behavior should be almost same. Only change is that the "Please select a file first." options should be removed.
[x] 5. It is an uncommon case (but it happens) where there is actually no language specified in the form. If this happens, then the lang-picker should continue to be disabled, but it should only display the following option: name='none', label='No language specified in form.'
Additional details.
Regarding point (5), you can test to see if it is working by trying to upload and convert the file attached at the bottom of the issue. Also FYI, I added some code to views.py to expect the 'none' case, as shown below.
language = request.form.get('language')
lang_option = \
'--language ' + language if language and language != 'none' else ''
preset = request.form.get('preset', 'standard')
command_line = ' '.join((
'python',
'-m ppp',
shlex.quote(in_file_path),
lang_option,
'--format ' + out_format,
'--preset ' + preset,
'--template ' + 'old',
'--outpath ' + shlex.quote(out_file_path)
))
Tasks
lang-wrapper
should be displayed on page load.lang-picker
selector should have the following default text: "Please select a file first."lang-picker
selector should be disabled until a file is added.lang-picker
behavior should be almost same. Only change is that the "Please select a file first." options should be removed.lang-picker
should continue to be disabled, but it should only display the following option: name='none'
, label='No language specified in form.'
Additional details.
Regarding point (5), you can test to see if it is working by trying to upload and convert the file attached at the bottom of the issue. Also FYI, I added some code to
views.py
to expect the'none'
case, as shown below.Attachments