nagasurendra commited on
Commit
a749683
·
verified ·
1 Parent(s): 8edf75f

Update templates/reward_status.html

Browse files
Files changed (1) hide show
  1. templates/reward_status.html +38 -94
templates/reward_status.html CHANGED
@@ -12,7 +12,7 @@
12
  padding: 0;
13
  }
14
  .container {
15
- width: 80%;
16
  margin: auto;
17
  padding-top: 20px;
18
  }
@@ -27,88 +27,54 @@
27
  font-size: 2em;
28
  color: #ff6f00;
29
  }
30
- .order-confirmed .delivery-time {
31
- margin-top: 10px;
32
- font-size: 1.2em;
33
- color: #666;
34
- }
35
  .reward-status {
36
  margin-top: 30px;
37
  background-color: #fff;
38
  padding: 20px;
39
  border-radius: 10px;
40
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
41
- }
42
- .badge {
43
- font-size: 1.2em;
44
- font-weight: bold;
45
- color: #ff6f00;
46
- background-color: #fff3e0;
47
- padding: 8px 15px;
48
- border-radius: 5px;
49
- margin: 10px 0;
50
- display: inline-block;
51
- }
52
- .valid-through {
53
- font-size: 1em;
54
- color: #888;
55
- margin-bottom: 20px;
56
- }
57
- /* Reward progress bar styling */
58
- .points-bar {
59
- width: 100%;
60
- height: 20px;
61
- background-color: #e0e0e0;
62
- border-radius: 10px;
63
- margin: 20px 0;
64
- }
65
- .progress {
66
- height: 100%;
67
- background-color: #ffd700;
68
- width: {{ progress_percentage }}%;
69
- border-radius: 10px;
70
- }
71
- .points-info {
72
  display: flex;
73
  justify-content: space-between;
74
- font-size: 0.9em;
75
- color: #333;
76
  }
77
-
78
- /* Card layout for item and ingredients */
79
- .reward-item-card {
80
  display: flex;
81
- align-items: center;
82
  justify-content: space-between;
83
- margin-top: 20px;
84
  }
85
-
86
  .item-image {
87
- width: 150px;
88
- height: 150px;
89
  object-fit: cover;
90
  border-radius: 8px;
91
  }
92
-
 
 
 
 
 
 
93
  .ingredient-card {
94
  display: flex;
95
  justify-content: space-between;
96
- margin-top: 10px;
97
  }
98
-
99
  .ingredient {
 
100
  text-align: center;
101
  cursor: pointer;
102
  }
103
-
104
  .ingredient img {
105
- width: 100px;
106
  height: 100px;
107
  object-fit: cover;
108
  border-radius: 8px;
109
  }
110
-
111
- /* Modal styling for ingredient details */
112
  .modal {
113
  display: none;
114
  position: fixed;
@@ -131,19 +97,10 @@
131
  border-radius: 8px;
132
  }
133
 
134
- .modal-header {
135
- font-size: 1.5em;
136
- margin-bottom: 15px;
137
- }
138
-
139
- .modal-body p {
140
- font-size: 1em;
141
- margin: 10px 0;
142
- }
143
-
144
  .close {
145
  color: #aaa;
146
- font-size: 1.5em;
 
147
  position: absolute;
148
  right: 10px;
149
  top: 10px;
@@ -160,35 +117,24 @@
160
  </div>
161
 
162
  <div class="reward-status">
163
- <div class="badge">{{ current_tier }} Status</div>
164
- <div class="valid-through">Valid through December 2024</div>
165
-
166
- <div class="points-info">
167
- <div class="points">You have <strong>{{ user_points }}</strong> points</div>
 
168
  </div>
169
 
170
- <!-- Reward Item Display -->
171
- <div class="reward-item-card">
172
- {% for item in order_items %}
173
- <div>
174
- <img class="item-image" src="{{ item.image_url }}" alt="{{ item.name }}" onerror="this.src='/static/placeholder.jpg';">
175
- <h3>{{ item.name }}</h3>
176
- <p>Price: ${{ "%.2f"|format(item.price) }}</p>
177
- </div>
178
-
179
- <div class="ingredient-card">
180
- {% for ingredient in item.ingredients %}
181
- {% if ingredient.name %}
182
- <div class="ingredient" onclick="showIngredientDetails('{{ ingredient.name }}', '{{ ingredient.image }}', '{{ ingredient.health_benefits }}', '{{ ingredient.fun_facts }}')">
183
- <img src="{{ ingredient.image }}" alt="{{ ingredient.name }}" onerror="this.src='/static/placeholder.jpg';">
184
- <p>{{ ingredient.name }}</p>
185
- </div>
186
- {% endif %}
187
- {% endfor %}
188
- </div>
189
- {% endfor %}
190
  </div>
191
-
192
  </div>
193
  </div>
194
 
@@ -210,7 +156,6 @@
210
  </div>
211
 
212
  <script>
213
- // Show Ingredient Details in the Modal
214
  function showIngredientDetails(name, image, healthBenefits, funFacts) {
215
  // Split the health benefits and fun facts by commas
216
  const healthBenefitsList = healthBenefits.split(',');
@@ -242,11 +187,10 @@
242
  document.getElementById("ingredientModal").style.display = "block";
243
  }
244
 
245
- // Close the modal
246
  function closeModal() {
247
  document.getElementById("ingredientModal").style.display = "none";
248
  }
249
  </script>
250
 
251
  </body>
252
- </html>
 
12
  padding: 0;
13
  }
14
  .container {
15
+ width: 90%;
16
  margin: auto;
17
  padding-top: 20px;
18
  }
 
27
  font-size: 2em;
28
  color: #ff6f00;
29
  }
 
 
 
 
 
30
  .reward-status {
31
  margin-top: 30px;
32
  background-color: #fff;
33
  padding: 20px;
34
  border-radius: 10px;
35
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  display: flex;
37
  justify-content: space-between;
38
+ height: 800px;
 
39
  }
40
+ .item-section {
41
+ width: 50%;
42
+ height: 100%;
43
  display: flex;
44
+ flex-direction: column;
45
  justify-content: space-between;
46
+ padding: 10px;
47
  }
 
48
  .item-image {
49
+ width: 100%;
50
+ height: 200px;
51
  object-fit: cover;
52
  border-radius: 8px;
53
  }
54
+ .item-info {
55
+ text-align: center;
56
+ }
57
+ .item-info h3 {
58
+ font-size: 1.5em;
59
+ margin-top: 10px;
60
+ }
61
  .ingredient-card {
62
  display: flex;
63
  justify-content: space-between;
64
+ padding-top: 10px;
65
  }
 
66
  .ingredient {
67
+ width: 48%;
68
  text-align: center;
69
  cursor: pointer;
70
  }
 
71
  .ingredient img {
72
+ width: 100%;
73
  height: 100px;
74
  object-fit: cover;
75
  border-radius: 8px;
76
  }
77
+ /* Modal Styling */
 
78
  .modal {
79
  display: none;
80
  position: fixed;
 
97
  border-radius: 8px;
98
  }
99
 
 
 
 
 
 
 
 
 
 
 
100
  .close {
101
  color: #aaa;
102
+ font-size: 2em;
103
+ font-weight: bold;
104
  position: absolute;
105
  right: 10px;
106
  top: 10px;
 
117
  </div>
118
 
119
  <div class="reward-status">
120
+ <div class="item-section">
121
+ <img class="item-image" src="{{ item.image_url }}" alt="{{ item.name }}" onerror="this.src='/static/placeholder.jpg';">
122
+ <div class="item-info">
123
+ <h3>{{ item.name }}</h3>
124
+ <p>Price: ${{ "%.2f"|format(item.price) }}</p>
125
+ </div>
126
  </div>
127
 
128
+ <div class="item-section">
129
+ <div class="ingredient-card">
130
+ {% for ingredient in item.ingredients %}
131
+ <div class="ingredient" onclick="showIngredientDetails('{{ ingredient.name }}', '{{ ingredient.image }}', '{{ ingredient.health_benefits }}', '{{ ingredient.fun_facts }}')">
132
+ <img src="{{ ingredient.image }}" alt="{{ ingredient.name }}" onerror="this.src='/static/placeholder.jpg';">
133
+ <p>{{ ingredient.name }}</p>
134
+ </div>
135
+ {% endfor %}
136
+ </div>
 
 
 
 
 
 
 
 
 
 
 
137
  </div>
 
138
  </div>
139
  </div>
140
 
 
156
  </div>
157
 
158
  <script>
 
159
  function showIngredientDetails(name, image, healthBenefits, funFacts) {
160
  // Split the health benefits and fun facts by commas
161
  const healthBenefitsList = healthBenefits.split(',');
 
187
  document.getElementById("ingredientModal").style.display = "block";
188
  }
189
 
 
190
  function closeModal() {
191
  document.getElementById("ingredientModal").style.display = "none";
192
  }
193
  </script>
194
 
195
  </body>
196
+ </html>