-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.html
175 lines (174 loc) · 8.4 KB
/
home.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
{% load static %}
{% load crispy_forms_tags %}
{% load widget_tweaks %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RECIPRY</title>
{% block headjavascript %}{{ form.media.js }}{% endblock %}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="{% static 'css/style.css'%}">
<script>
$(document).ready(function() {
$("select").on("change", function() {
if($("select[name='category']").val() == "") {
$("select[name='category'] > option:first-child").text('Category');
$("select[name='subcategory']").prop('disabled', 'disabled');
$("select[name='subcategory'] > option:first-child").text('Subcategory');
$("select[name='recipename']").prop('disabled', 'disabled');
$("select[name='recipename'] > option:first-child").text('Recipe');
} else {
$("select[name='subcategory']").removeAttr("disabled");
}
}).trigger('change');
$("select[name='subcategory']").on("change", function() {
if($("select[name='subcategory']").val() == "") {
$("select[name='recipename']").prop('disabled', 'disabled');
} else {
$("select[name='recipename']").removeAttr("disabled");
$("select[name='category'] > option:first-child").text('Category');
}
}).trigger('change');
});
</script>
</head>
<body>
{% block content %}
<div class="container">
<div class="row">
<div class="col-12">
<img src="http://96.126.105.58/media/images/recipry.png" alt="">
</div>
</div>
<br/>
<form method="POST">
<div class="form-row">
{% csrf_token %}
<div class="form-group custom-control col-md-3">
{{form.category|add_class:"custom-select custom-select-lg"}}
</div>
<div class="form-group custom-control col-md-3">
<select name="subcategory" disabled class="custom-select custom-select-lg chained-fk" required="required" id="id_subcategory" data-chainfield="category" data-url="/chaining/filter/recipe/Subcategory/category/recipe/Recipe/subcategory" data-value="null" data-auto_choose="false" data-empty_label="Subcategory">
</select>
</div>
<div class="form-group custom-control col-md-3">
<select name="recipename" disabled class="custom-select custom-select-lg chained-fk" required="required" id="id_recipename" data-chainfield="subcategory" data-url="/chaining/filter/recipe/RecipeName/subcategory/recipe/Recipe/recipename" data-value="null" data-auto_choose="false" data-empty_label="Recipe">
</select>
</div>
<div class="form-group col-md-3">
<input type="submit" value="Submit" class="btn-lg btn-block" >
</div>
</div>
</form>
<div class="md">
</div>
{% if recipes %}
<div class="row">
<div class="col-12">
{% for recipe in recipes %}
<h4>{{recipe.recipename__recipename}}</h4>
{% endfor %}
</div>
</div>
<div class="row">
<div class="col-12">
{% for image in images %}
<img class="rounded " src="{{image.image.url}}" alt="recimage" width=100%/>
{% endfor %}
</div>
</div>
<div class="row">
<div class="col-12 hour">
<p>
<u>Time</u>:
{% for cooktime in cooktimes %}
{{cooktime.hour}} hr {{cooktime.minute}} min
{% endfor %}
<u>Servings</u>:
{% for servingsize in servingsizes %}
{{servingsize.servingsize}}
{% endfor %}
</p>
</div>
</div>
<div class="row">
<div class="col-12 descrp">
{% for recipe in recipes %}
<p>{{recipe.description}}</p>
{% endfor %}
</div>
</div>
<div class="row">
<div class="col-12">
<ul class="nav nav-tabs nav-fill" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="ingredients-tab" data-toggle="tab" href="#ingredients" role="tab" aria-controls="ingredients" aria-selected="true">INGREDIENTS</a>
</li>
<li class="nav-item ">
<a class="nav-link" id="directions-tab" data-toggle="tab" href="#directions" role="tab" aria-controls="directions" aria-selected="false">DIRECTIONS</a>
</li>
</ul>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="tab-content mt-4" id="myTabContent">
<div class="tab-pane fade show active" id="ingredients" role="tabpanel" aria-labelledby="ingredients-tab">
<!-- <table style="width: 100%">
{% for cookware in cookwares %}
<tr>
<td> <a href="{{cookware.cookware.link}}" target="_blank">{{cookware.cookware}}</a></td>
</tr>
{% endfor %}
</table> -->
<table style="width: 100%">
{% for ingredient in ingredients %}
<tr>
<td> </td>
<td><img width="56px" src="{% if ingredient.ingredient.image %}{{ingredient.ingredient.image.url}}{% else %}#{% endif %}" alt="recimage" width=100%/></td>
<td class="test2">{{ingredient.amount}}</td>
<td>{{ingredient.unit}}</td>
<td><a href="{{ingredient.ingredient.link}}" target="_blank">{{ingredient.ingredient}}</a></td>
<td> </td>
</tr>
{% endfor %}
</table>
</div>
<div class="tab-pane fade" id="directions" role="tabpanel" aria-labelledby="directions-tab">
<table style="width: 100%">
{% for direction in directions %}
<tr>
<td class="test">{{forloop.counter}}</td>
<td>{{direction.directions|linebreaks}}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>
</div>
<!-- {% else %}
<div class="row">
<div class="col-12">
<img src="http://96.126.105.58/media/images/recipry.png" alt="">
</div>
</div> -->
{% endif %}
<hr>
<div class="row">
<div class="col-12 footer">
<p class="copy">© 2020 Recipry.com All Rights Reserved
</br>Powered by <a class="copy" href="https://baffledjet.com" target="_blank">BAFFLEDJET.COM</a>
</p>
</div>
</div>
</div>
{% endblock %}
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
</body>
</html>