generated from Code-Institute-Org/gitpod-full-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
editplant.html
134 lines (131 loc) · 5.89 KB
/
editplant.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{% extends 'base.html' %}
{% block title %}Edit Plant{% endblock %}
{% block content %}
<!-- Edit Plant page -->
<div class="row">
<h3><i class="fas fa-edit"></i> Edit Plant</h3>
<!-- form -->
<form action="{{ url_for('update_plant', plant_id=plant._id) }}" method="POST" class="col s12">
<div class="row col s12">
<div class="row identity-section">
<div class="left">
<i class="material-icons prefix">fingerprint</i>
<label id="identity">Identity</label>
</div>
<div class="row">
<div class="input-field col s12">
<i class="material-icons prefix">assignment</i>
<input id="scientific_name" name="scientific_name" type="text" class="validate" required="" aria-required="true" value="{{ plant.scientific_name }}">
<label for="scientific_name" data-error="wrong" data-success="right">Scientific name</label>
</div>
<div class="input-field col s12">
<i class="material-icons prefix">assignment</i>
<input id="common_name" name="common_name" type="text" class="validate" required="" aria-required="true" value="{{ plant.common_name }}">
<label for="common_name" data-error="wrong" data-success="right">Common name</label>
</div>
<div class="input-field col s12">
<i class="material-icons prefix">subject</i>
<input id="genus" name="genus" type="text" class="validate" required="" aria-required="true" value="{{ plant.genus }}">
<label for="genus" data-error="wrong" data-success="right">Genus</label>
</div>
<div class="input-field col s12">
<i class="material-icons prefix">subject</i>
<input id="species" name="species" type="text" class="validate" required="" aria-required="true" value="{{ plant.species }}">
<label for="species" data-error="wrong" data-success="right">Species</label>
</div>
<div class="input-field col s12">
<i class="material-icons prefix">subject</i>
<input id="family" name="family" type="text" class="validate" required="" aria-required="true" value="{{ plant.family }}">
<label for="family" data-error="wrong" data-success="right">Family</label>
</div>
</div>
</div>
<div class="row">
<div class="left">
<i class="material-icons prefix">category</i>
<label id="category">Category</label>
</div>
<div class="row">
<div class="input-field col s12 dropdown-category">
<select id="category_name" name="category_name">
<option value="" disabled>Choose Category</option>
{% for category in categories %}
{% if category.category_name == plant.category_name %}
<option value="{{category.category_name}}" selected>{{category.category_name}}</option>
{% else %}
<option value="{{category.category_name}}">{{category.category_name}}</option>
{% endif %}
{% endfor %}
</select>
<label for="category_name" data-error="wrong" data-success="right">Category</label>
</div>
</div>
</div>
<div class="row">
<div class="left">
<i class="material-icons prefix">eco</i>
<label id="botanic">Botanic</label>
</div>
<div class="row">
<div class="input-field col s12 dropdown-plant-type">
<select id="plant_type" name="plant_type">
<option value="" disabled>Choose Plant type</option>
{% for type in plant_types %}
{% if type.plant_type_name == plant.plant_type %}
<option value="{{type.plant_type_name}}" selected>{{type.plant_type_name}}</option>
{% else %}
<option value="{{type.plant_type_name}}">{{type.plant_type_name}}</option>
{% endif %}
{% endfor %}
</select>
<label for="plant_type" data-error="wrong" data-success="right">Plant type</label>
</div>
</div>
</div>
<div class="row">
<div class="left">
<i class="material-icons prefix">wb_sunny</i>
<label id="culture">Culture</label>
</div>
<div class="row">
<div class="input-field col s12 dropdown-shade-tolerance">
<select id="shade_tolerance" name="shade_tolerance">
<option value="" disabled>Choose Plant type</option>
{% for tolerance in shade_tolerance %}
{% if tolerance.shade_tolerance_name == plant.shade_tolerance %}
<option value="{{tolerance.shade_tolerance_name}}" selected>{{tolerance.shade_tolerance_name}}</option>
{% else %}
<option value="{{tolerance.shade_tolerance_name}}">{{tolerance.shade_tolerance_name}}</option>
{% endif %}
{% endfor %}
</select>
<label>Shade tolerance</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="left">
<i class="material-icons prefix">sticky_note_2</i>
<label id="note_label">Note</label>
</div>
<div class="row">
<div class="input-field col s12">
<i class="material-icons prefix">notes</i>
<textarea id="note" name="note" class="materialize-textarea">{{ plant.note }}</textarea>
<label for="note">Note</label>
</div>
</div>
</div>
<!-- buttons -->
<div class="row">
<button class="waves-effect waves-light btn grey" type="submit" name="action">Edit Plant
<i class="material-icons right">playlist_add</i>
</button>
<a class="waves-effect waves-light btn btn-cancel grey" href="{{ url_for('get_plants') }}">Cancel
<i class="material-icons right">cancel</i>
</a>
</div>
</form>
</div>
{% endblock %}