This repository has been archived by the owner on Aug 20, 2018. It is now read-only.
/
form.html
113 lines (103 loc) · 3.77 KB
/
form.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. #}
{% extends 'base/base.html' %}
{% block site_css %}
{{ super() }}
{{ task_form.media['css'] }}
{% endblock %}
{% block site_js %}
{{ super() }}
{{ task_form.media['js'] }}
{% endblock %}
{% from 'tasks/macros.html' import form_field %}
{% if action == 'Import' %}
{% set title = _('{action} task batch')|f(action=action) %}
{% else %}
{% set title = _('{action} task {task_name}')|f(action=action,task_name=task_form['name'].value() or '') %}
{% endif %}
{% block content %}
<main class="billboard content-container feedback">
{% if action == 'Add' %}
<div style="float:right">
<a href="{{ url('tasks.import') }}" class="button">{{ _('Import Tasks') }}</a>
</div>
{% endif %}
<h4>{{ title }}</h4>
{% if action == 'Import' %}
{{ batch_form.non_field_errors() }}
{{ criterion_formset.non_form_errors() }}
{% endif %}
{{ task_form.non_field_errors() }}
<form method="post" class="task-form">
{{ csrf() }}
{% if action == 'Import' %}
{{ stage_form__preview }}
{{ form_field(batch_form['description'], help_text=True) }}
{{ form_field(batch_form['query'], help_text=True) }}
<div class="subsection content-container">
<h5>{{ _('Invalidation Criteria') }}</h5>
<p>{{_('Under what conditions should the tasks imported by this batch become invalid? (If any one condition is satisfied, the tasks will become invalid.)')}}</p>
{% include 'tasks/criterion_formset.html' %}
</div>
<h5>{{ _('Base Task Description') }}</h5>
{% endif %}
{% if action == 'Import' %}
{{ form_field(task_form['name'], custom_text=_('The task title will be suffixed with "Bug [id]" for each imported bug.')) }}
{% else %}
{{ form_field(task_form['name']) }}
{% endif %}
{{ form_field(task_form['short_description']) }}
{{ form_field(task_form['keywords'], help_text=True) }}
{{ form_field(task_form['owner']) }}
<fieldset class="task-category first">
{{ form_field(task_form['team']) }}
{{ form_field(task_form['project']) }}
{{ form_field(task_form['type']) }}
</fieldset>
<fieldset class="task-info">
{{ form_field(task_form['execution_time']) }}
{{ form_field(task_form['difficulty']) }}
{{ form_field(task_form['priority']) }}
</fieldset>
<fieldset class="task-dates">
{{ form_field(task_form['start_date']) }}
{{ form_field(task_form['end_date']) }}
{% if action != 'Import' %}
<div class="field">
{{ task_form['repeatable'].errors }}
<label for="id_repeatable">
{{ task_form['repeatable'] }}
Repeatable
</label>
</div>
{% endif %}
<div class="field">
{{ task_form['is_draft'].errors }}
<label for="id_is_draft">
{{ task_form['is_draft'] }}
{{ _('Draft') }}
</label>
</div>
<div class="field">
{{ task_form['is_invalid'].errors }}
<label for="id_is_invalid">
{{ task_form['is_invalid'] }}
{{ _('Invalid') }}
</label>
</div>
</fieldset>
{{ form_field(task_form['why_this_matters'], 'why-this-matters') }}
{{ form_field(task_form['prerequisites']) }}
{{ form_field(task_form['instructions']) }}
<div class="actions-container">
<div class="without-message">
<a href="{{ cancel_url }}" class="button" id="cancel">{{ _('Cancel') }}</a>
</div>
<button type="submit" class="button">
{{ _('{action} {import_obj}')|f(action=action, import_obj=import_obj or 'task') }}
</button>
</div>
</form>
</main>
{% endblock %}