mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
move macros to new file
This commit is contained in:
parent
c7254781d0
commit
31c958cb6f
@ -49,7 +49,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
{{ submit_button(edit_user_form.submit) }}
|
||||
{{ macros.submit_button(edit_user_form.submit) }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -59,7 +59,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
{{ submit_button(login_form.submit) }}
|
||||
{{ macros.submit_button(login_form.submit) }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -57,7 +57,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
{{ submit_button(registration_form.submit) }}
|
||||
{{ macros.submit_button(registration_form.submit) }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -27,7 +27,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
{{ submit_button(reset_password_form.submit) }}
|
||||
{{ macros.submit_button(reset_password_form.submit) }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -20,7 +20,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
{{ submit_button(reset_password_request_form.submit) }}
|
||||
{{ macros.submit_button(reset_password_request_form.submit) }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -41,7 +41,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
{{ submit_button(add_corpus_form.submit) }}
|
||||
{{ macros.submit_button(add_corpus_form.submit) }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -1,18 +1,5 @@
|
||||
{% extends "nopaque.html.j2" %}
|
||||
|
||||
{% macro render_field(field) %}
|
||||
<div class="input-field">
|
||||
<i class="prefix">{{ field.name[0:1]|upper }}</i>
|
||||
{{ field.label }}
|
||||
{{ field(data_length='255')|safe }}
|
||||
</div>
|
||||
{% if field.errors %}
|
||||
{% for error in field.errors %}
|
||||
<span class="helper-text red-text">{{ error }}</span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12 m4">
|
||||
<h3>{{ corpus.title }}</h3>
|
||||
@ -74,7 +61,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
{{ submit_button(add_corpus_file_form.submit) }}
|
||||
{{ macros.submit_button(add_corpus_file_form.submit) }}
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
@ -91,7 +78,7 @@
|
||||
or field.name == "csrf_token"
|
||||
or field.name == "title"
|
||||
or field.name == "publishing_year") %}
|
||||
{{ render_field(field)}}
|
||||
{{ macros.render_field(field)}}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,18 +1,5 @@
|
||||
{% extends "nopaque.html.j2" %}
|
||||
|
||||
{% macro render_field_with_value(field, corpus_file) %}
|
||||
<div class="input-field">
|
||||
<i class="prefix">{{ field.name[0:1]|upper }}</i>
|
||||
{{ field.label }}
|
||||
{{ field(value=corpus_file[field.name], data_length='255')| safe }}
|
||||
</div>
|
||||
{% if field.errors %}
|
||||
{% for error in field.errors %}
|
||||
<span class="helper-text red-text">{{ error }}</span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12 m4">
|
||||
<h3 id="title">...</h3>
|
||||
@ -59,7 +46,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
{{ submit_button(edit_corpus_file_form.submit) }}
|
||||
{{ macros.submit_button(edit_corpus_file_form.submit) }}
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
@ -76,7 +63,7 @@
|
||||
or field.name == "csrf_token"
|
||||
or field.name == "title"
|
||||
or field.name == "publishing_year") %}
|
||||
{{ render_field_with_value(field, corpus_file)}}
|
||||
{{ macros.render_field_with_value(field, corpus_file)}}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
31
app/templates/macros.jinja
Normal file
31
app/templates/macros.jinja
Normal file
@ -0,0 +1,31 @@
|
||||
{% macro render_field(field) %}
|
||||
<div class="input-field">
|
||||
<i class="prefix">{{ field.name[0:1]|upper }}</i>
|
||||
{{ field.label }}
|
||||
{{ field(data_length='255')|safe }}
|
||||
</div>
|
||||
{% if field.errors %}
|
||||
{% for error in field.errors %}
|
||||
<span class="helper-text red-text">{{ error }}</span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
{% macro render_field_with_value(field, corpus_file) %}
|
||||
<div class="input-field">
|
||||
<i class="prefix">{{ field.name[0:1]|upper }}</i>
|
||||
{{ field.label }}
|
||||
{{ field(value=corpus_file[field.name], data_length='255')| safe }}
|
||||
</div>
|
||||
{% if field.errors %}
|
||||
{% for error in field.errors %}
|
||||
<span class="helper-text red-text">{{ error }}</span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
{% macro submit_button(input) %}
|
||||
<button class="btn waves-effect waves-light" id="{{ input.id }}" name="{{ input.name }}" type="submit" value="{{ input.label.text }}">{{ input.label.text }}<i class="material-icons right">send</i></button>
|
||||
{% endmacro %}
|
@ -123,7 +123,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
{{ submit_button(login_form.submit) }}
|
||||
{{ macros.submit_button(login_form.submit) }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -1,6 +1,4 @@
|
||||
{% macro submit_button(input) %}
|
||||
<button class="btn waves-effect waves-light" id="{{ input.id }}" name="{{ input.name }}" type="submit" value="{{ input.label.text }}">{{ input.label.text }}<i class="material-icons right">send</i></button>
|
||||
{% endmacro %}
|
||||
{% import "macros.jinja" as macros %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
@ -31,7 +31,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
{{ submit_button(edit_general_settings_form.save_settings) }}
|
||||
{{ macros.submit_button(edit_general_settings_form.save_settings) }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -76,7 +76,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
{{ submit_button(edit_password_form.save_password) }}
|
||||
{{ macros.submit_button(edit_password_form.save_password) }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -105,7 +105,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
{{ submit_button(edit_email_form.save_email) }}
|
||||
{{ macros.submit_button(edit_email_form.save_email) }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -110,7 +110,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
{{ submit_button(add_job_form.submit) }}
|
||||
{{ macros.submit_button(add_job_form.submit) }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -185,7 +185,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
{{ submit_button(add_job_form.submit) }}
|
||||
{{ macros.submit_button(add_job_form.submit) }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -76,7 +76,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
{{ submit_button(add_job_form.submit) }}
|
||||
{{ macros.submit_button(add_job_form.submit) }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user