mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 12:22:47 +00:00 
			
		
		
		
	merge settings into users route
This commit is contained in:
		@@ -1,6 +0,0 @@
 | 
			
		||||
{% set breadcrumbs %}
 | 
			
		||||
<li class="tab disabled"><i class="material-icons">navigate_next</i></li>
 | 
			
		||||
{% if request.path == url_for('settings.settings') %}
 | 
			
		||||
<li class="tab"><a{%if request.path == url_for('settings.settings') %} class="active"{% endif %} href="{{ url_for('settings.settings') }}" target="_self">Settings</a></li>
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% endset %}
 | 
			
		||||
@@ -1,84 +0,0 @@
 | 
			
		||||
{% extends "base.html.j2" %}
 | 
			
		||||
{% from "settings/_breadcrumbs.html.j2" import breadcrumbs with context %}
 | 
			
		||||
{% import "materialize/wtf.html.j2" as wtf %}
 | 
			
		||||
 | 
			
		||||
{% block page_content %}
 | 
			
		||||
<div class="container">
 | 
			
		||||
  <div class="row">
 | 
			
		||||
    <div class="col s12">
 | 
			
		||||
      <h1 id="title">{{ title }}</h1>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="col s12">
 | 
			
		||||
      <form method="POST">
 | 
			
		||||
        {{ edit_notification_settings_form.hidden_tag() }}
 | 
			
		||||
        <div class="card">
 | 
			
		||||
          <div class="card-content">
 | 
			
		||||
            <span class="card-title">Notification settings</span>
 | 
			
		||||
            {{ wtf.render_field(edit_notification_settings_form.job_status_mail_notification_level, material_icon='notifications') }}
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="card-action">
 | 
			
		||||
            <div class="right-align">
 | 
			
		||||
              {{ wtf.render_field(edit_notification_settings_form.submit, material_icon='send') }}
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </form>
 | 
			
		||||
 | 
			
		||||
      <form method="POST">
 | 
			
		||||
        {{ change_password_form.hidden_tag() }}
 | 
			
		||||
        <div class="card">
 | 
			
		||||
          <div class="card-content">
 | 
			
		||||
            <span class="card-title">Change Password</span>
 | 
			
		||||
            {{ wtf.render_field(change_password_form.password, material_icon='vpn_key') }}
 | 
			
		||||
            {{ wtf.render_field(change_password_form.new_password, material_icon='vpn_key') }}
 | 
			
		||||
            {{ wtf.render_field(change_password_form.new_password_2, material_icon='vpn_key') }}
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="card-action">
 | 
			
		||||
            <div class="right-align">
 | 
			
		||||
              {{ wtf.render_field(change_password_form.submit, material_icon='send') }}
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </form>
 | 
			
		||||
 | 
			
		||||
      <div class="card">
 | 
			
		||||
        <div class="card-content">
 | 
			
		||||
          <span class="card-title">Delete account</span>
 | 
			
		||||
          <p>Deleting an account has the following effects:</p>
 | 
			
		||||
          <ul>
 | 
			
		||||
            <li>All data associated with your corpora and jobs will be permanently deleted.</li>
 | 
			
		||||
            <li>All settings will be permanently deleted.</li>
 | 
			
		||||
          </ul>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="card-action right-align">
 | 
			
		||||
          <a class="btn red waves-effect waves-light modal-trigger" href="#delete-user"><i class="material-icons left">delete</i>Delete</a>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock page_content %}
 | 
			
		||||
 | 
			
		||||
{% block modals%}
 | 
			
		||||
<div class="modal" id="delete-user">
 | 
			
		||||
  <div class="modal-content">
 | 
			
		||||
    <h4>Confirm User deletion</h4>
 | 
			
		||||
    <p>Do you really want to delete the User <b>{{ current_user.username }}</b>? All files will be permanently deleted!</p>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="modal-footer">
 | 
			
		||||
    <a class="btn modal-close waves-effect waves-light">Cancel</a>
 | 
			
		||||
    <a class="btn modal-close red waves-effect waves-light" id="delete-user-button">Delete</a>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock modals %}
 | 
			
		||||
 | 
			
		||||
{% block scripts %}
 | 
			
		||||
{{ super() }}
 | 
			
		||||
<script>
 | 
			
		||||
document.querySelector('#delete-user-button').addEventListener('click', (event) => {
 | 
			
		||||
  Requests.users.entity.delete(currentUserId)
 | 
			
		||||
    .then((response) => {window.location.href = '/';});
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
{% endblock scripts %}
 | 
			
		||||
		Reference in New Issue
	
	Block a user