Spaces:
Running
Running
Update templates/results.html
Browse files- templates/results.html +344 -338
templates/results.html
CHANGED
|
@@ -1,339 +1,345 @@
|
|
| 1 |
-
<!-- templates/results.html -->
|
| 2 |
-
<!DOCTYPE html>
|
| 3 |
-
<html lang="en">
|
| 4 |
-
<head>
|
| 5 |
-
<meta charset="UTF-8">
|
| 6 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
-
<title>Plant Analysis Results</title>
|
| 8 |
-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
| 9 |
-
<style>
|
| 10 |
-
body {
|
| 11 |
-
background-color: #f8f9fa;
|
| 12 |
-
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 13 |
-
}
|
| 14 |
-
.header-section {
|
| 15 |
-
background-color: #28a745;
|
| 16 |
-
color: white;
|
| 17 |
-
padding: 2rem 0;
|
| 18 |
-
margin-bottom: 2rem;
|
| 19 |
-
}
|
| 20 |
-
.result-container {
|
| 21 |
-
background-color: white;
|
| 22 |
-
border-radius: 10px;
|
| 23 |
-
padding: 2rem;
|
| 24 |
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
| 25 |
-
margin-bottom: 2rem;
|
| 26 |
-
}
|
| 27 |
-
.image-container {
|
| 28 |
-
text-align: center;
|
| 29 |
-
margin-bottom: 2rem;
|
| 30 |
-
}
|
| 31 |
-
.image-container img {
|
| 32 |
-
max-height: 400px;
|
| 33 |
-
max-width: 100%;
|
| 34 |
-
border-radius: 8px;
|
| 35 |
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
| 36 |
-
}
|
| 37 |
-
.result-card {
|
| 38 |
-
border-left: 4px solid;
|
| 39 |
-
margin-bottom: 1.5rem;
|
| 40 |
-
padding: 1rem;
|
| 41 |
-
border-radius: 5px;
|
| 42 |
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
| 43 |
-
}
|
| 44 |
-
.healthy {
|
| 45 |
-
background-color: #d4edda;
|
| 46 |
-
border-left-color: #28a745;
|
| 47 |
-
}
|
| 48 |
-
.severity-low {
|
| 49 |
-
background-color: #e7f5e9;
|
| 50 |
-
border-left-color: #3cb371;
|
| 51 |
-
}
|
| 52 |
-
.severity-medium {
|
| 53 |
-
background-color: #fff3cd;
|
| 54 |
-
border-left-color: #ffc107;
|
| 55 |
-
}
|
| 56 |
-
.severity-high {
|
| 57 |
-
background-color: #f8d7da;
|
| 58 |
-
border-left-color: #dc3545;
|
| 59 |
-
}
|
| 60 |
-
.info-row {
|
| 61 |
-
display: flex;
|
| 62 |
-
margin-bottom: 0.5rem;
|
| 63 |
-
}
|
| 64 |
-
.info-label {
|
| 65 |
-
font-weight: bold;
|
| 66 |
-
width: 120px;
|
| 67 |
-
flex-shrink: 0;
|
| 68 |
-
}
|
| 69 |
-
.info-content {
|
| 70 |
-
flex-grow: 1;
|
| 71 |
-
}
|
| 72 |
-
.probability-bar {
|
| 73 |
-
height: 8px;
|
| 74 |
-
background-color: #e9ecef;
|
| 75 |
-
border-radius: 4px;
|
| 76 |
-
margin-top: 5px;
|
| 77 |
-
overflow: hidden;
|
| 78 |
-
}
|
| 79 |
-
.probability-fill {
|
| 80 |
-
height: 100%;
|
| 81 |
-
border-radius: 4px;
|
| 82 |
-
background-color: #28a745;
|
| 83 |
-
}
|
| 84 |
-
.product-card {
|
| 85 |
-
height: 100%;
|
| 86 |
-
transition: transform 0.3s;
|
| 87 |
-
}
|
| 88 |
-
.product-card:hover {
|
| 89 |
-
transform: translateY(-5px);
|
| 90 |
-
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
|
| 91 |
-
}
|
| 92 |
-
.info-source {
|
| 93 |
-
font-size: 0.8rem;
|
| 94 |
-
color: #6c757d;
|
| 95 |
-
margin-top: 0.5rem;
|
| 96 |
-
}
|
| 97 |
-
.resource-badge {
|
| 98 |
-
position: absolute;
|
| 99 |
-
top: 10px;
|
| 100 |
-
right: 10px;
|
| 101 |
-
font-size: 0.7rem;
|
| 102 |
-
}
|
| 103 |
-
</style>
|
| 104 |
-
</head>
|
| 105 |
-
<body>
|
| 106 |
-
<div class="header-section">
|
| 107 |
-
<div class="container text-center">
|
| 108 |
-
<h1 class="display-5">Plant Analysis Results</h1>
|
| 109 |
-
<p class="lead">Analysis for {{ plant_name }}</p>
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
<
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
<
|
| 131 |
-
|
| 132 |
-
<div class="info-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
<div class="info-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
<div class="info-
|
| 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 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
<
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
<div
|
| 192 |
-
|
| 193 |
-
{{ result.
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
<div class="info-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
<
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
<
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
<
|
| 321 |
-
<p
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 339 |
</html>
|
|
|
|
| 1 |
+
<!-- templates/results.html -->
|
| 2 |
+
<!DOCTYPE html>
|
| 3 |
+
<html lang="en">
|
| 4 |
+
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<title>Plant Analysis Results</title>
|
| 8 |
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
| 9 |
+
<style>
|
| 10 |
+
body {
|
| 11 |
+
background-color: #f8f9fa;
|
| 12 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 13 |
+
}
|
| 14 |
+
.header-section {
|
| 15 |
+
background-color: #28a745;
|
| 16 |
+
color: white;
|
| 17 |
+
padding: 2rem 0;
|
| 18 |
+
margin-bottom: 2rem;
|
| 19 |
+
}
|
| 20 |
+
.result-container {
|
| 21 |
+
background-color: white;
|
| 22 |
+
border-radius: 10px;
|
| 23 |
+
padding: 2rem;
|
| 24 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
| 25 |
+
margin-bottom: 2rem;
|
| 26 |
+
}
|
| 27 |
+
.image-container {
|
| 28 |
+
text-align: center;
|
| 29 |
+
margin-bottom: 2rem;
|
| 30 |
+
}
|
| 31 |
+
.image-container img {
|
| 32 |
+
max-height: 400px;
|
| 33 |
+
max-width: 100%;
|
| 34 |
+
border-radius: 8px;
|
| 35 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
| 36 |
+
}
|
| 37 |
+
.result-card {
|
| 38 |
+
border-left: 4px solid;
|
| 39 |
+
margin-bottom: 1.5rem;
|
| 40 |
+
padding: 1rem;
|
| 41 |
+
border-radius: 5px;
|
| 42 |
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
| 43 |
+
}
|
| 44 |
+
.healthy {
|
| 45 |
+
background-color: #d4edda;
|
| 46 |
+
border-left-color: #28a745;
|
| 47 |
+
}
|
| 48 |
+
.severity-low {
|
| 49 |
+
background-color: #e7f5e9;
|
| 50 |
+
border-left-color: #3cb371;
|
| 51 |
+
}
|
| 52 |
+
.severity-medium {
|
| 53 |
+
background-color: #fff3cd;
|
| 54 |
+
border-left-color: #ffc107;
|
| 55 |
+
}
|
| 56 |
+
.severity-high {
|
| 57 |
+
background-color: #f8d7da;
|
| 58 |
+
border-left-color: #dc3545;
|
| 59 |
+
}
|
| 60 |
+
.info-row {
|
| 61 |
+
display: flex;
|
| 62 |
+
margin-bottom: 0.5rem;
|
| 63 |
+
}
|
| 64 |
+
.info-label {
|
| 65 |
+
font-weight: bold;
|
| 66 |
+
width: 120px;
|
| 67 |
+
flex-shrink: 0;
|
| 68 |
+
}
|
| 69 |
+
.info-content {
|
| 70 |
+
flex-grow: 1;
|
| 71 |
+
}
|
| 72 |
+
.probability-bar {
|
| 73 |
+
height: 8px;
|
| 74 |
+
background-color: #e9ecef;
|
| 75 |
+
border-radius: 4px;
|
| 76 |
+
margin-top: 5px;
|
| 77 |
+
overflow: hidden;
|
| 78 |
+
}
|
| 79 |
+
.probability-fill {
|
| 80 |
+
height: 100%;
|
| 81 |
+
border-radius: 4px;
|
| 82 |
+
background-color: #28a745;
|
| 83 |
+
}
|
| 84 |
+
.product-card {
|
| 85 |
+
height: 100%;
|
| 86 |
+
transition: transform 0.3s;
|
| 87 |
+
}
|
| 88 |
+
.product-card:hover {
|
| 89 |
+
transform: translateY(-5px);
|
| 90 |
+
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
|
| 91 |
+
}
|
| 92 |
+
.info-source {
|
| 93 |
+
font-size: 0.8rem;
|
| 94 |
+
color: #6c757d;
|
| 95 |
+
margin-top: 0.5rem;
|
| 96 |
+
}
|
| 97 |
+
.resource-badge {
|
| 98 |
+
position: absolute;
|
| 99 |
+
top: 10px;
|
| 100 |
+
right: 10px;
|
| 101 |
+
font-size: 0.7rem;
|
| 102 |
+
}
|
| 103 |
+
</style>
|
| 104 |
+
</head>
|
| 105 |
+
<body>
|
| 106 |
+
<div class="header-section">
|
| 107 |
+
<div class="container text-center">
|
| 108 |
+
<h1 class="display-5">Plant Analysis Results</h1>
|
| 109 |
+
<p class="lead">Analysis for {{ plant_name }}</p>
|
| 110 |
+
</div>
|
| 111 |
+
</div>
|
| 112 |
+
|
| 113 |
+
<div class="container mb-5">
|
| 114 |
+
<div class="row">
|
| 115 |
+
<div class="col-md-4">
|
| 116 |
+
<div class="image-container">
|
| 117 |
+
<img src="{{ url_for('static', filename=image_path) }}" alt="{{ plant_name }} Image" class="img-fluid">
|
| 118 |
+
<div class="mt-3">
|
| 119 |
+
<h5>{{ plant_name }}</h5>
|
| 120 |
+
{% if results.is_healthy %}
|
| 121 |
+
<span class="badge bg-success">Healthy</span>
|
| 122 |
+
{% else %}
|
| 123 |
+
<span class="badge bg-warning">Issues Detected</span>
|
| 124 |
+
{% endif %}
|
| 125 |
+
</div>
|
| 126 |
+
</div>
|
| 127 |
+
|
| 128 |
+
<div class="result-container">
|
| 129 |
+
<h4>Analysis Summary</h4>
|
| 130 |
+
<div class="info-row">
|
| 131 |
+
<div class="info-label">Plant:</div>
|
| 132 |
+
<div class="info-content">{{ plant_name }}</div>
|
| 133 |
+
</div>
|
| 134 |
+
<div class="info-row">
|
| 135 |
+
<div class="info-label">Status:</div>
|
| 136 |
+
<div class="info-content">
|
| 137 |
+
{% if results.is_healthy %}
|
| 138 |
+
<span class="text-success">Healthy</span>
|
| 139 |
+
{% else %}
|
| 140 |
+
<span class="text-warning">Issues Detected</span>
|
| 141 |
+
{% endif %}
|
| 142 |
+
</div>
|
| 143 |
+
</div>
|
| 144 |
+
{% if results.confidence %}
|
| 145 |
+
<div class="info-row">
|
| 146 |
+
<div class="info-label">Confidence:</div>
|
| 147 |
+
<div class="info-content">{{ results.confidence }}</div>
|
| 148 |
+
</div>
|
| 149 |
+
{% endif %}
|
| 150 |
+
|
| 151 |
+
<div class="d-grid gap-2 mt-4">
|
| 152 |
+
<a href="{{ url_for('index') }}" class="btn btn-primary">Analyze Another Plant</a>
|
| 153 |
+
</div>
|
| 154 |
+
</div>
|
| 155 |
+
|
| 156 |
+
{% if results.audio_file %}
|
| 157 |
+
<div class="result-container mt-3">
|
| 158 |
+
<h5>Audio Summary:</h5>
|
| 159 |
+
<audio controls>
|
| 160 |
+
<source src="static/audio/audio_result.mp3" type="audio/mp3">
|
| 161 |
+
Your browser does not support the audio element.
|
| 162 |
+
</audio>
|
| 163 |
+
</div>
|
| 164 |
+
{% endif %}
|
| 165 |
+
</div>
|
| 166 |
+
|
| 167 |
+
<div class="col-md-8">
|
| 168 |
+
{% if results.is_healthy %}
|
| 169 |
+
<div class="result-container healthy">
|
| 170 |
+
<h3 class="text-success">Good News!</h3>
|
| 171 |
+
<p class="lead">Your {{ plant_name }} plant appears to be healthy. Continue with your current care practices.</p>
|
| 172 |
+
|
| 173 |
+
<h5 class="mt-4">Recommendations:</h5>
|
| 174 |
+
<ul>
|
| 175 |
+
<li>Maintain regular watering schedule</li>
|
| 176 |
+
<li>Continue with balanced fertilization</li>
|
| 177 |
+
<li>Monitor for any changes in appearance</li>
|
| 178 |
+
<li>Ensure proper sunlight exposure</li>
|
| 179 |
+
<li>Practice preventive measures against common pests and diseases</li>
|
| 180 |
+
</ul>
|
| 181 |
+
</div>
|
| 182 |
+
{% elif results.results %}
|
| 183 |
+
<div class="result-container">
|
| 184 |
+
<h3>Detected Issues</h3>
|
| 185 |
+
<p>Here are the potential issues detected in your {{ plant_name }} plant:</p>
|
| 186 |
+
|
| 187 |
+
{% for result in results.results %}
|
| 188 |
+
<div class="result-card severity-{{ result.severity|lower }}">
|
| 189 |
+
<div class="d-flex justify-content-between align-items-center mb-2">
|
| 190 |
+
<h4>{{ loop.index }}. {{ result.name }}</h4>
|
| 191 |
+
<div>
|
| 192 |
+
<span class="badge bg-info me-2">{{ result.type }}</span>
|
| 193 |
+
<span class="badge {% if result.severity|lower == 'low' %}bg-success{% elif result.severity|lower == 'medium' %}bg-warning{% else %}bg-danger{% endif %}">
|
| 194 |
+
{{ result.severity }} Severity
|
| 195 |
+
</span>
|
| 196 |
+
</div>
|
| 197 |
+
</div>
|
| 198 |
+
|
| 199 |
+
<div class="info-row">
|
| 200 |
+
<div class="info-label">Probability:</div>
|
| 201 |
+
<div class="info-content">
|
| 202 |
+
{{ result.probability }}
|
| 203 |
+
<div class="probability-bar">
|
| 204 |
+
{% set prob_value = result.probability|replace('%', '')|float %}
|
| 205 |
+
<div class="probability-fill" style="width: {{ prob_value }}%;"></div>
|
| 206 |
+
</div>
|
| 207 |
+
</div>
|
| 208 |
+
</div>
|
| 209 |
+
|
| 210 |
+
<div class="info-row">
|
| 211 |
+
<div class="info-label">Symptoms:</div>
|
| 212 |
+
<div class="info-content">{{ result.symptoms }}</div>
|
| 213 |
+
</div>
|
| 214 |
+
|
| 215 |
+
<div class="info-row">
|
| 216 |
+
<div class="info-label">Causes:</div>
|
| 217 |
+
<div class="info-content">{{ result.causes }}</div>
|
| 218 |
+
</div>
|
| 219 |
+
|
| 220 |
+
<div class="info-row">
|
| 221 |
+
<div class="info-label">Spreading:</div>
|
| 222 |
+
<div class="info-content">{{ result.spreading }}</div>
|
| 223 |
+
</div>
|
| 224 |
+
|
| 225 |
+
<div class="mt-3">
|
| 226 |
+
<h5>Treatment:</h5>
|
| 227 |
+
<p>{{ result.treatment }}</p>
|
| 228 |
+
</div>
|
| 229 |
+
|
| 230 |
+
<div class="mt-3">
|
| 231 |
+
<h5>Prevention:</h5>
|
| 232 |
+
<p>{{ result.prevention }}</p>
|
| 233 |
+
</div>
|
| 234 |
+
|
| 235 |
+
{% if web_info and result.name in web_info and web_info[result.name] %}
|
| 236 |
+
<div class="mt-4">
|
| 237 |
+
<h5>Additional Information:</h5>
|
| 238 |
+
<div class="card">
|
| 239 |
+
<div class="card-body">
|
| 240 |
+
<h6 class="card-title">{{ web_info[result.name].title }}</h6>
|
| 241 |
+
<p class="card-text">{{ web_info[result.name].summary }}</p>
|
| 242 |
+
<div class="d-flex justify-content-between">
|
| 243 |
+
<a href="{{ web_info[result.name].link }}" class="btn btn-sm btn-outline-success" target="_blank">Read More</a>
|
| 244 |
+
<span class="info-source">Source: Agrowon</span>
|
| 245 |
+
</div>
|
| 246 |
+
</div>
|
| 247 |
+
</div>
|
| 248 |
+
</div>
|
| 249 |
+
{% endif %}
|
| 250 |
+
|
| 251 |
+
{% if product_info and result.name in product_info and product_info[result.name] %}
|
| 252 |
+
<div class="mt-4">
|
| 253 |
+
<h5>Recommended Products:</h5>
|
| 254 |
+
<div class="row">
|
| 255 |
+
{% for product in product_info[result.name][:2] %}
|
| 256 |
+
<div class="col-md-6 mb-2">
|
| 257 |
+
<div class="card product-card">
|
| 258 |
+
<div class="card-body">
|
| 259 |
+
<span class="badge bg-secondary resource-badge">
|
| 260 |
+
{% if 'indiamart' in product.link %}IndiaMart{% else %}Krishi Seva{% endif %}
|
| 261 |
+
</span>
|
| 262 |
+
<h6 class="card-title" style="font-size: 0.9rem;">{{ product.title }}</h6>
|
| 263 |
+
<p class="card-text small">{{ product.snippet[:100] }}{% if product.snippet|length > 100 %}...{% endif %}</p>
|
| 264 |
+
<a href="{{ product.link }}" class="btn btn-sm btn-outline-primary" target="_blank">View Product</a>
|
| 265 |
+
</div>
|
| 266 |
+
</div>
|
| 267 |
+
</div>
|
| 268 |
+
{% endfor %}
|
| 269 |
+
</div>
|
| 270 |
+
{% if product_info[result.name]|length > 2 %}
|
| 271 |
+
<div class="text-center mt-2">
|
| 272 |
+
<button class="btn btn-sm btn-link" type="button" data-bs-toggle="collapse" data-bs-target="#moreProducts{{ loop.index }}" aria-expanded="false">
|
| 273 |
+
Show more products <i class="bi bi-chevron-down"></i>
|
| 274 |
+
</button>
|
| 275 |
+
<div class="collapse" id="moreProducts{{ loop.index }}">
|
| 276 |
+
<div class="row mt-2">
|
| 277 |
+
{% for product in product_info[result.name][2:] %}
|
| 278 |
+
<div class="col-md-6 mb-2">
|
| 279 |
+
<div class="card product-card">
|
| 280 |
+
<div class="card-body">
|
| 281 |
+
<span class="badge bg-secondary resource-badge">
|
| 282 |
+
{% if 'indiamart' in product.link %}IndiaMart{% else %}Krishi Seva{% endif %}
|
| 283 |
+
</span>
|
| 284 |
+
<h6 class="card-title" style="font-size: 0.9rem;">{{ product.title }}</h6>
|
| 285 |
+
<p class="card-text small">{{ product.snippet[:100] }}{% if product.snippet|length > 100 %}...{% endif %}</p>
|
| 286 |
+
<a href="{{ product.link }}" class="btn btn-sm btn-outline-primary" target="_blank">View Product</a>
|
| 287 |
+
</div>
|
| 288 |
+
</div>
|
| 289 |
+
</div>
|
| 290 |
+
{% endfor %}
|
| 291 |
+
</div>
|
| 292 |
+
</div>
|
| 293 |
+
</div>
|
| 294 |
+
{% endif %}
|
| 295 |
+
</div>
|
| 296 |
+
{% endif %}
|
| 297 |
+
</div>
|
| 298 |
+
{% endfor %}
|
| 299 |
+
<div class="mt-4 alert alert-info">
|
| 300 |
+
<h5 class="alert-heading">Disclaimer</h5>
|
| 301 |
+
<p>The product recommendations are provided for informational purposes only. Always consult with a local agricultural expert for specific recommendations suited to your region and conditions.</p>
|
| 302 |
+
</div>
|
| 303 |
+
<div class="container mb-5">
|
| 304 |
+
<div class="result-container">
|
| 305 |
+
<h4>Send us your Feedback</h4>
|
| 306 |
+
<p>We would love to hear your thoughts on the analysis.</p>
|
| 307 |
+
<form action="/feedback" method="post">
|
| 308 |
+
<input type="hidden" name="plant_name" value="{{ plant_name }}">
|
| 309 |
+
<div class="mb-3">
|
| 310 |
+
<textarea class="form-control" name="feedback" rows="4" placeholder="Your feedback here..." required></textarea>
|
| 311 |
+
</div>
|
| 312 |
+
<button type="submit" class="btn btn-primary">Submit Feedback</button>
|
| 313 |
+
</form>
|
| 314 |
+
</div>
|
| 315 |
+
</div>
|
| 316 |
+
</div>
|
| 317 |
+
{% else %}
|
| 318 |
+
<div class="result-container">
|
| 319 |
+
<div class="alert alert-warning">
|
| 320 |
+
<h4 class="alert-heading">Analysis Inconclusive</h4>
|
| 321 |
+
<p>We couldn't determine with certainty whether your plant has issues. This could be due to:</p>
|
| 322 |
+
<ul>
|
| 323 |
+
<li>Image quality or lighting issues</li>
|
| 324 |
+
<li>Early stage symptoms that aren't clearly visible</li>
|
| 325 |
+
<li>A rare condition not in our database</li>
|
| 326 |
+
</ul>
|
| 327 |
+
<hr>
|
| 328 |
+
<p class="mb-0">Try uploading a clearer image or one that shows the affected areas more directly.</p>
|
| 329 |
+
</div>
|
| 330 |
+
</div>
|
| 331 |
+
{% endif %}
|
| 332 |
+
</div>
|
| 333 |
+
</div>
|
| 334 |
+
</div>
|
| 335 |
+
|
| 336 |
+
<footer class="bg-dark text-white text-center py-3">
|
| 337 |
+
<div class="container">
|
| 338 |
+
<p class="mb-0">Plant Disease Detector © 2025 | Powered by Gemini AI</p>
|
| 339 |
+
</div>
|
| 340 |
+
</footer>
|
| 341 |
+
|
| 342 |
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
| 343 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
| 344 |
+
</body>
|
| 345 |
</html>
|