core: add user settings and user delete

This commit is contained in:
Jens Langhammer
2018-12-10 16:58:35 +01:00
parent 276c6fb297
commit 71f41e655f
12 changed files with 99 additions and 32 deletions

View File

@ -1,52 +0,0 @@
{% load utils %}
{% csrf_token %}
{% for field in form %}
<div class="form-group">
{% if field.field.widget|fieldtype == 'RadioSelect' %}
<label class="col-sm-2 control-label" {% if field.field.required %}class="required"{% endif %} for="{{ field.name }}-{{ forloop.counter0 }}">
{{ field.label }}
</label>
{% for c in field %}
<div class="radio col-sm-10">
<input type="radio" id="{{ field.name }}-{{ forloop.counter0 }}" name="{% if wizard %}{{ wizard.steps.current }}-{% endif %}{{ field.name }}" value="{{ c.data.value }}" {% if c.data.selected %} checked {% endif %}>
<label class="col-sm-2 control-label" for="{{ field.name }}-{{ forloop.counter0 }}">{{ c.choice_label }}</label>
</div>
{% endfor %}
{% elif field.field.widget|fieldtype == 'Select' %}
<label class="col-sm-2 control-label" {% if field.field.required %}class="required"{% endif %} for="{{ field.name }}-{{ forloop.counter0 }}">
{{ field.label }}
</label>
<div class="select col-sm-10">
{{ field }}
</div>
{% elif field.field.widget|fieldtype == 'CheckboxInput' %}
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
{{ field }} {{ field.label }}
</label>
</div>
</div>
{% else %}
<label class="col-sm-2 control-label" {% if field.field.required %}class="required"{% endif %} for="{{ field.name }}-{{ forloop.counter0 }}">
{{ field.label }}
</label>
<div class="col-sm-10">
{{ field|css_class:'form-control' }}
{% if field.help_text %}
<span>
{{ field.help_text }}
</span>
{% endif %}
{% for error in field.errors %}
<hr>
<div class="alert alert-danger">
<span class="pficon pficon-error-circle-o"></span>
<strong>{{ error }}</strong>
</div>
{% endfor %}
</div>
{% endif %}
</div>
{% endfor %}

View File

@ -1,20 +0,0 @@
{% extends "administration/base.html" %}
{% load i18n %}
{% load utils %}
{% block content %}
<div class="container">
{% block above_form %}
<h1>{% trans 'Delete' %}</h1>
{% endblock %}
<div class="">
<form method="post" class="form-horizontal">
{% csrf_token %}
<p>Are you sure you want to delete "{{ object }}"?</p>
<a href="{% back %}" class="btn btn-default">{% trans 'Back' %}</a>
<input type="submit" class="btn btn-danger" value="{% trans 'Delete' %}" />
</form>
</div>
</div>
{% endblock %}

View File

@ -9,10 +9,10 @@
{% endblock %}
<div class="">
<form action="" method="post" class="form-horizontal">
{% include 'blocks/form.html' with form=form %}
{% include 'partials/form.html' with form=form %}
<a class="btn btn-default" href="{% back %}">{% trans "Cancel" %}</a>
<input type="submit" class="btn btn-primary" value="{% trans 'Create' %}" />
</form>
</div>
</div>
{% endblock %}
{% endblock %}