mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-03 20:02:47 +00:00 
			
		
		
		
	Add macro for submit button
This commit is contained in:
		@@ -1,25 +0,0 @@
 | 
			
		||||
{% 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 %}
 | 
			
		||||
@@ -38,16 +38,10 @@
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="switch">
 | 
			
		||||
          <i class="material-icons prefix">check</i>
 | 
			
		||||
          <label class="active" for="{{ edit_user_form.confirmed.name }}">
 | 
			
		||||
            Confirmed status:
 | 
			
		||||
            Off
 | 
			
		||||
            {% if edit_user_form.confirmed.data == True %}
 | 
			
		||||
            <input type="checkbox" id="{{ edit_user_form.confirmed.name }}" name="{{ edit_user_form.confirmed.name }}" checked="checked">
 | 
			
		||||
            {% else %}
 | 
			
		||||
            <input type="checkbox" id="{{ edit_user_form.confirmed.name }}" name="{{ edit_user_form.confirmed.name }}">
 | 
			
		||||
            {% endif %}
 | 
			
		||||
          <label>
 | 
			
		||||
            Confirmed
 | 
			
		||||
            {{ edit_user_form.confirmed() }}
 | 
			
		||||
            <span class="lever"></span>
 | 
			
		||||
            On
 | 
			
		||||
          </label>
 | 
			
		||||
          {% for error in edit_user_form.confirmed.errors %}
 | 
			
		||||
          <span class="helper-text red-text">{{ error }}</span>
 | 
			
		||||
@@ -55,7 +49,7 @@
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="card-action right-align">
 | 
			
		||||
        <button class="btn waves-effect waves-light" id="submit" name="submit" type="submit">Submit<i class="material-icons right">send</i></button>
 | 
			
		||||
        {{ submit_button(edit_user_form.submit) }}
 | 
			
		||||
      </div>
 | 
			
		||||
    </form>
 | 
			
		||||
  </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -59,7 +59,7 @@
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="card-action right-align">
 | 
			
		||||
        <button class="btn waves-effect waves-light" id="login-form-submit" name="login-form-submit" type="submit">Log in<i class="material-icons right">send</i></button>
 | 
			
		||||
        {{ submit_button(login_form.submit) }}
 | 
			
		||||
      </div>
 | 
			
		||||
    </form>
 | 
			
		||||
  </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -57,7 +57,7 @@
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="card-action right-align">
 | 
			
		||||
        <button class="btn waves-effect waves-light" id="registration-form-submit" name="registration-form-submit" type="submit">Register<i class="material-icons right">send</i></button>
 | 
			
		||||
        {{ submit_button(registration_form.submit) }}
 | 
			
		||||
      </div>
 | 
			
		||||
    </form>
 | 
			
		||||
  </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="card-action right-align">
 | 
			
		||||
        <button class="btn waves-effect waves-light" id="reset-password-form-submit" name="reset-password-form-submit" type="submit">Reset Password<i class="material-icons right">send</i></button>
 | 
			
		||||
        {{ submit_button(reset_password_form.submit) }}
 | 
			
		||||
      </div>
 | 
			
		||||
    </form>
 | 
			
		||||
  </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,7 @@
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="card-action right-align">
 | 
			
		||||
        <button class="btn waves-effect waves-light" id="reset-password-request-form-submit" name="reset-password-request-form-submit" type="submit">Reset Password<i class="material-icons right">send</i></button>
 | 
			
		||||
        {{ submit_button(reset_password_request_form.submit) }}
 | 
			
		||||
      </div>
 | 
			
		||||
    </form>
 | 
			
		||||
  </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -41,7 +41,7 @@
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="card-action right-align">
 | 
			
		||||
        <button class="btn waves-effect waves-light" id="submit" name="submit" type="submit">Submit<i class="material-icons right">send</i></button>
 | 
			
		||||
        {{ submit_button(add_corpus_form.submit) }}
 | 
			
		||||
      </div>
 | 
			
		||||
    </form>
 | 
			
		||||
  </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,18 @@
 | 
			
		||||
{% 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>
 | 
			
		||||
@@ -61,7 +74,7 @@
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="card-action right-align">
 | 
			
		||||
        <button class="btn waves-effect waves-light" id="submit" name="submit" type="submit">Submit<i class="material-icons right">send</i></button>
 | 
			
		||||
        {{ submit_button(add_corpus_file_form.submit) }}
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <br>
 | 
			
		||||
@@ -72,7 +85,6 @@
 | 
			
		||||
          <span>
 | 
			
		||||
            <div class="row">
 | 
			
		||||
              <div class="col s12">
 | 
			
		||||
                {% 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"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,18 @@
 | 
			
		||||
{% 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>
 | 
			
		||||
@@ -46,32 +59,31 @@
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="card-action right-align">
 | 
			
		||||
        <button class="btn waves-effect waves-light" id="submit" name="submit" type="submit">Submit<i class="material-icons right">send</i></button>
 | 
			
		||||
        {{ submit_button(edit_corpus_file_form.submit) }}
 | 
			
		||||
      </div>
 | 
			
		||||
  </div>
 | 
			
		||||
      <br>
 | 
			
		||||
      <ul class="collapsible hoverable">
 | 
			
		||||
        <li>
 | 
			
		||||
          <div class="collapsible-header"><i class="material-icons">edit</i>Edit additional metadata</div>
 | 
			
		||||
          <div class="collapsible-body">
 | 
			
		||||
            <span>
 | 
			
		||||
              <div class="row">
 | 
			
		||||
                <div class="col s12">
 | 
			
		||||
                  {% from "_formhelpers.html.j2" import render_field_with_value %}
 | 
			
		||||
                  {% for field in edit_corpus_file_form if not (field.name == "file"
 | 
			
		||||
                    or field.name == "author"
 | 
			
		||||
                    or field.name == "submit"
 | 
			
		||||
                    or field.name == "csrf_token"
 | 
			
		||||
                    or field.name == "title"
 | 
			
		||||
                    or field.name == "publishing_year") %}
 | 
			
		||||
                    {{ render_field_with_value(field, corpus_file)}}
 | 
			
		||||
                  {% endfor %}
 | 
			
		||||
                </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <br>
 | 
			
		||||
    <ul class="collapsible hoverable">
 | 
			
		||||
      <li>
 | 
			
		||||
        <div class="collapsible-header"><i class="material-icons">edit</i>Edit additional metadata</div>
 | 
			
		||||
        <div class="collapsible-body">
 | 
			
		||||
          <span>
 | 
			
		||||
            <div class="row">
 | 
			
		||||
              <div class="col s12">
 | 
			
		||||
                {% for field in edit_corpus_file_form if not (field.name == "file"
 | 
			
		||||
                  or field.name == "author"
 | 
			
		||||
                  or field.name == "submit"
 | 
			
		||||
                  or field.name == "csrf_token"
 | 
			
		||||
                  or field.name == "title"
 | 
			
		||||
                  or field.name == "publishing_year") %}
 | 
			
		||||
                  {{ render_field_with_value(field, corpus_file)}}
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
              </div>
 | 
			
		||||
            </span>
 | 
			
		||||
          </div>
 | 
			
		||||
        </li>
 | 
			
		||||
      </ul>
 | 
			
		||||
    </form>
 | 
			
		||||
            </div>
 | 
			
		||||
          </span>
 | 
			
		||||
        </div>
 | 
			
		||||
      </li>
 | 
			
		||||
    </ul>
 | 
			
		||||
  </form>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 
 | 
			
		||||
@@ -123,7 +123,7 @@
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="card-action right-align">
 | 
			
		||||
                <button class="btn waves-effect waves-light" id="login-form-submit" name="login-form-submit" type="submit">Log in<i class="material-icons right">send</i></button>
 | 
			
		||||
                {{ submit_button(login_form.submit) }}
 | 
			
		||||
              </div>
 | 
			
		||||
            </form>
 | 
			
		||||
          </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,7 @@
 | 
			
		||||
{% 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 %}
 | 
			
		||||
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
  <head>
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="card-action right-align">
 | 
			
		||||
        {{ edit_general_settings_form.save_settings(class='btn') }}
 | 
			
		||||
        {{ submit_button(edit_general_settings_form.save_settings) }}
 | 
			
		||||
      </div>
 | 
			
		||||
    </form>
 | 
			
		||||
  </div>
 | 
			
		||||
@@ -76,7 +76,7 @@
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="card-action right-align">
 | 
			
		||||
        {{ edit_password_form.save_password(class='btn') }}
 | 
			
		||||
        {{ submit_button(edit_password_form.save_password) }}
 | 
			
		||||
      </div>
 | 
			
		||||
    </form>
 | 
			
		||||
  </div>
 | 
			
		||||
@@ -105,7 +105,7 @@
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="card-action right-align">
 | 
			
		||||
        {{ edit_email_form.save_email(class='btn') }}
 | 
			
		||||
        {{ submit_button(edit_email_form.save_email) }}
 | 
			
		||||
      </div>
 | 
			
		||||
    </form>
 | 
			
		||||
  </div>
 | 
			
		||||
@@ -139,7 +139,7 @@
 | 
			
		||||
<div class="modal" id="delete-account-modal">
 | 
			
		||||
  <div class="modal-content">
 | 
			
		||||
    <h4>Confirm deletion</h4>
 | 
			
		||||
    <p>Do you really want to delete your account and all associated data? All associated jobs and job files will be permanently deleted!</p>
 | 
			
		||||
    <p>Do you really want to delete your account and all associated data? All associated corpora, jobs and files will be permanently deleted!</p>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="modal-footer">
 | 
			
		||||
    <a href="#!" class="btn modal-close waves-effect waves-light">Cancel</a>
 | 
			
		||||
 
 | 
			
		||||
@@ -110,7 +110,7 @@
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="card-action right-align">
 | 
			
		||||
          <button class="btn waves-effect waves-light" id="submit" name="submit" type="submit">Submit<i class="material-icons right">send</i></button>
 | 
			
		||||
          {{ submit_button(add_job_form.submit) }}
 | 
			
		||||
        </div>
 | 
			
		||||
      </form>
 | 
			
		||||
    </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -185,7 +185,7 @@
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="card-action right-align">
 | 
			
		||||
          <button class="btn waves-effect waves-light" id="add-job-form-submit" name="add-job-form-submit" type="submit">Submit<i class="material-icons right">send</i></button>
 | 
			
		||||
          {{ submit_button(add_job_form.submit) }}
 | 
			
		||||
        </div>
 | 
			
		||||
      </form>
 | 
			
		||||
    </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -76,7 +76,7 @@
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="card-action right-align">
 | 
			
		||||
          <button class="btn waves-effect waves-light" id="submit" name="submit" type="submit">Submit<i class="material-icons right">send</i></button>
 | 
			
		||||
          {{ submit_button(add_job_form.submit) }}
 | 
			
		||||
        </div>
 | 
			
		||||
      </form>
 | 
			
		||||
    </div>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user