Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-ide committed Jun 4, 2024
2 parents 9b8c3d0 + 40b21c3 commit dbb07f8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
11 changes: 8 additions & 3 deletions webapp/home/templates/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@
<p></p>
<table>
<tr>
<td colspan="2"><h4>Enable Complex Text Element Editing:</h4></td>
<td colspan="3"><h4>Enable Complex Text Element Editing:</h4></td>
<td valign="middle" style="padding-top: 5px;padding-left: 10px;">{{ macros.help_button(help_settings_text_editing_btn) }}</td>
</tr>
<tr><td style="width: 10%">&nbsp;</td><td colspan="2">{{ wtf.form_field(form.complex_text_editing_document) }}</td></tr>
<tr><td style="width: 10%">&nbsp;</td><td colspan="2">{{ wtf.form_field(form.complex_text_editing_global) }}</td></tr>
<tr><td style="width: 30px;">&nbsp;</td><td colspan="2">{{ wtf.form_field(form.complex_text_editing_document) }}</td></tr>
{% if programmatic %}
<tr><td style="width: 30px;">&nbsp;</td><td style="width: 5%">&nbsp;</td><td style="width: 390px;"><i><b>Note: </b>This document contains complex text elements,
so complex text element editing has been enabled automatically.</i>
</td></tr>
{% endif %}
<tr><td style="width: 30px;">&nbsp;</td><td colspan="2">{{ wtf.form_field(form.complex_text_editing_global) }}</td></tr>
</table>

<br>
Expand Down
10 changes: 8 additions & 2 deletions webapp/home/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1133,10 +1133,16 @@ def settings():
return redirect(get_back_url())

if request.method == 'GET':
form.complex_text_editing_document.data = user_data.get_enable_complex_text_element_editing_document()
current_document = user_data.get_active_document()
document_has_complex_texttypes = False
if current_document:
eml_node = load_eml(filename=current_document)
document_has_complex_texttypes = texttype_node_processing.model_has_complex_texttypes(eml_node)
form.complex_text_editing_document.data = user_data.get_enable_complex_text_element_editing_document() or \
document_has_complex_texttypes
form.complex_text_editing_global.data = user_data.get_enable_complex_text_element_editing_global()
help = get_helps(['settings_text'])
return render_template('settings.html', form=form, help=help)
return render_template('settings.html', programmatic=document_has_complex_texttypes, form=form, help=help)


@home_bp.route('/check_data_tables', methods=['GET', 'POST'])
Expand Down

0 comments on commit dbb07f8

Please sign in to comment.