This repository has been archived by the owner on Oct 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ask.html
70 lines (65 loc) · 1.95 KB
/
ask.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
66
67
68
69
70
{% extends 'layouts/base.html' %} {% load static %} {% block content %}
<h1>New Question</h1>
<div class="flex flex-column">
{% if form.errors %}
<div class="row">
<div class="alert alert-danger" role="alert">
{% for field, errors in form.errors.items %}
{% for error in errors %}
<p>{{ field }}: {{ error }}</p>
{% endfor %}
{% endfor %}
</div>
</div>
{% endif %}
<form method="post" enctype='multipart/form-data'>
{% csrf_token %}
<div class="row mb-3">
<div class="col-1">Title</div>
<div class="col-9">
<input type="text" name="title" class="form-control" value="{{ form.title.value|default:'' }}" />
</div>
</div>
<div class="row mb-3">
<div class="col-1">Text</div>
<div class="col-9">
<textarea class="form-control" name="text">{{ form.text.value|default:'' }}</textarea>
</div>
</div>
<div class="row mb-3">
<div class="col-1">Image</div>
<div class="col-9">
<input class="form-control" type="file" name="image"></input>
</div>
</div>
<div class="row mb-3">
<div class="col-1">Tags</div>
<div class="col-9">
<select
name="tags"
data-multiple="true"
data-replace="jselect"
data-locale="en"
data-search="true"
data-placeholder="Select tags"
id="tags_select"
>
<optgroup label="All tags">
{% for tag in all_tags %}
<option value="{{ tag.slug }}" data-img="{{ tag.bootstrap_icon }}">{{ tag.title }}</option>
{% endfor %}
</optgroup>
</select>
</div>
</div>
<div class="row mt-5">
<div class="col-4">
<button class="btn btn-success" type="submit">
<i class="bi-check-lg"></i> Ask!
</button>
</div>
</div>
</form>
</div>
<script src="{% static 'js-select' %}/select.min.js"></script>
{% endblock %}