-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreate.html
65 lines (59 loc) · 2.4 KB
/
create.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{% extends 'base.html' %}
{% load i18n %}
{% load input_checker %}
{% block content %}
<h1>{% trans 'Create' %} {{ model_name }}</h1>
<div class="row">
<div class="col">
<form method="POST" enctype="multipart/form-data" class="">
{% csrf_token %}
{% if form.non_field_errors %}
<div class="non-field-errors">
{% for err in form.non_field_errors %}
<p class="form-error">{{ err }}</p>
{% endfor %}
</div>
{% endif %}
{% for input in form %}
<div class="row">
{% if input.errors %}
{{ input.errors }}
{% endif %}
</div>
<div class="form-group">
{% if input|is_checkbox %}
<div class="">
<label for="{{ input.auto_id }}">
{{ input }}
{{ input.label }}
</label>
</div>
{% elif input|is_select%}
<label>{{ input.label }}</label>
{{ input }}
{% elif input|is_file%}
<label>{{ input.label }}</label>
{{ input }}
{% elif input|is_text_area%}
<label for="{{ input.name }}">{{ input.label }}</label><br>
{{ input }}
{% else %}
<label for="{{ input.name }}">{{ input.label }}</label>
{{ input }}
{% endif %}
</div>
{% endfor %}
<div class="actions">
<a href="javascript:window.history.back();">
<div class="btn btn-default">
Back
</div>
</a>
<button type="submit" class="btn btn-success">
{% trans 'create' %}
</button>
</div>
</form>
</div>
</div>
{% endblock %}