diff --git a/app/templates/_formhelpers.html.j2 b/app/templates/_formhelpers.html.j2 deleted file mode 100644 index d3aa5c19..00000000 --- a/app/templates/_formhelpers.html.j2 +++ /dev/null @@ -1,25 +0,0 @@ -{% macro render_field(field) %} -
- {{ field.name[0:1]|upper }} - {{ field.label }} - {{ field(data_length='255')|safe }} -
- {% if field.errors %} - {% for error in field.errors %} - {{ error }} - {% endfor %} - {% endif %} -{% endmacro %} - -{% macro render_field_with_value(field, corpus_file) %} -
- {{ field.name[0:1]|upper }} - {{ field.label }} - {{ field(value=corpus_file[field.name], data_length='255')| safe }} -
- {% if field.errors %} - {% for error in field.errors %} - {{ error }} - {% endfor %} - {% endif %} -{% endmacro %} diff --git a/app/templates/admin/edit_user.html.j2 b/app/templates/admin/edit_user.html.j2 index 76e42881..69f4cfca 100644 --- a/app/templates/admin/edit_user.html.j2 +++ b/app/templates/admin/edit_user.html.j2 @@ -38,16 +38,10 @@
check -
- + {{ submit_button(edit_user_form.submit) }}
diff --git a/app/templates/auth/login.html.j2 b/app/templates/auth/login.html.j2 index 4e0a6ada..ecd4df5c 100644 --- a/app/templates/auth/login.html.j2 +++ b/app/templates/auth/login.html.j2 @@ -59,7 +59,7 @@
- + {{ submit_button(login_form.submit) }}
diff --git a/app/templates/auth/register.html.j2 b/app/templates/auth/register.html.j2 index 194a12ef..6b909297 100644 --- a/app/templates/auth/register.html.j2 +++ b/app/templates/auth/register.html.j2 @@ -57,7 +57,7 @@
- + {{ submit_button(registration_form.submit) }}
diff --git a/app/templates/auth/reset_password.html.j2 b/app/templates/auth/reset_password.html.j2 index aaa918dd..178fa67a 100644 --- a/app/templates/auth/reset_password.html.j2 +++ b/app/templates/auth/reset_password.html.j2 @@ -27,7 +27,7 @@
- + {{ submit_button(reset_password_form.submit) }}
diff --git a/app/templates/auth/reset_password_request.html.j2 b/app/templates/auth/reset_password_request.html.j2 index 3eff233c..fa294d94 100644 --- a/app/templates/auth/reset_password_request.html.j2 +++ b/app/templates/auth/reset_password_request.html.j2 @@ -20,7 +20,7 @@
- + {{ submit_button(reset_password_request_form.submit) }}
diff --git a/app/templates/corpora/add_corpus.html.j2 b/app/templates/corpora/add_corpus.html.j2 index 6ea38aaf..debfd1cf 100644 --- a/app/templates/corpora/add_corpus.html.j2 +++ b/app/templates/corpora/add_corpus.html.j2 @@ -41,7 +41,7 @@
- + {{ submit_button(add_corpus_form.submit) }}
diff --git a/app/templates/corpora/add_corpus_file.html.j2 b/app/templates/corpora/add_corpus_file.html.j2 index 7cd7d807..acaad17f 100644 --- a/app/templates/corpora/add_corpus_file.html.j2 +++ b/app/templates/corpora/add_corpus_file.html.j2 @@ -1,5 +1,18 @@ {% extends "nopaque.html.j2" %} +{% macro render_field(field) %} +
+ {{ field.name[0:1]|upper }} + {{ field.label }} + {{ field(data_length='255')|safe }} +
+ {% if field.errors %} + {% for error in field.errors %} + {{ error }} + {% endfor %} + {% endif %} +{% endmacro %} + {% block page_content %}

{{ corpus.title }}

@@ -61,7 +74,7 @@
- + {{ submit_button(add_corpus_file_form.submit) }}

@@ -72,7 +85,6 @@
- {% from "_formhelpers.html.j2" import render_field %} {% for field in add_corpus_file_form if not (field.name == "file" or field.name == "author" or field.name == "submit" diff --git a/app/templates/corpora/edit_corpus_file.html.j2 b/app/templates/corpora/edit_corpus_file.html.j2 index 249effed..81f6726a 100644 --- a/app/templates/corpora/edit_corpus_file.html.j2 +++ b/app/templates/corpora/edit_corpus_file.html.j2 @@ -1,5 +1,18 @@ {% extends "nopaque.html.j2" %} +{% macro render_field_with_value(field, corpus_file) %} +
+ {{ field.name[0:1]|upper }} + {{ field.label }} + {{ field(value=corpus_file[field.name], data_length='255')| safe }} +
+ {% if field.errors %} + {% for error in field.errors %} + {{ error }} + {% endfor %} + {% endif %} +{% endmacro %} + {% block page_content %}

...

@@ -46,32 +59,31 @@
- + {{ submit_button(edit_corpus_file_form.submit) }}
-
-
- + {% endblock %} diff --git a/app/templates/main/index.html.j2 b/app/templates/main/index.html.j2 index 8e53aa6d..40c698fe 100644 --- a/app/templates/main/index.html.j2 +++ b/app/templates/main/index.html.j2 @@ -123,7 +123,7 @@
- + {{ submit_button(login_form.submit) }}
diff --git a/app/templates/nopaque.html.j2 b/app/templates/nopaque.html.j2 index ef35227d..b5a10009 100644 --- a/app/templates/nopaque.html.j2 +++ b/app/templates/nopaque.html.j2 @@ -1,3 +1,7 @@ +{% macro submit_button(input) %} + +{% endmacro %} + diff --git a/app/templates/profile/settings.html.j2 b/app/templates/profile/settings.html.j2 index ccef6774..4b7b72fd 100644 --- a/app/templates/profile/settings.html.j2 +++ b/app/templates/profile/settings.html.j2 @@ -31,7 +31,7 @@
- {{ edit_general_settings_form.save_settings(class='btn') }} + {{ submit_button(edit_general_settings_form.save_settings) }}
@@ -76,7 +76,7 @@
- {{ edit_password_form.save_password(class='btn') }} + {{ submit_button(edit_password_form.save_password) }}
@@ -105,7 +105,7 @@
- {{ edit_email_form.save_email(class='btn') }} + {{ submit_button(edit_email_form.save_email) }}
@@ -139,7 +139,7 @@
- + {{ submit_button(add_job_form.submit) }}
diff --git a/app/templates/services/ocr.html.j2 b/app/templates/services/ocr.html.j2 index de2a514b..e635380f 100644 --- a/app/templates/services/ocr.html.j2 +++ b/app/templates/services/ocr.html.j2 @@ -185,7 +185,7 @@
- + {{ submit_button(add_job_form.submit) }}
diff --git a/app/templates/services/setup_files.html.j2 b/app/templates/services/setup_files.html.j2 index f9b74939..f3b7b2a9 100644 --- a/app/templates/services/setup_files.html.j2 +++ b/app/templates/services/setup_files.html.j2 @@ -76,7 +76,7 @@
- + {{ submit_button(add_job_form.submit) }}