Spaces:
Runtime error
Runtime error
Update templates/customer_details.html
#9
by
geethareddy
- opened
- templates/customer_details.html +48 -10
templates/customer_details.html
CHANGED
|
@@ -7,8 +7,9 @@
|
|
| 7 |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
|
| 8 |
<style>
|
| 9 |
body {
|
| 10 |
-
|
| 11 |
-
|
|
|
|
| 12 |
.back-to-menu {
|
| 13 |
display: block;
|
| 14 |
margin: 30px auto 10px auto;
|
|
@@ -25,33 +26,39 @@
|
|
| 25 |
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
| 26 |
transition: background-color 0.3s ease;
|
| 27 |
}
|
|
|
|
| 28 |
.back-to-menu:hover {
|
| 29 |
background-color: #e64a19;
|
| 30 |
text-decoration: none;
|
| 31 |
}
|
|
|
|
| 32 |
.editable {
|
| 33 |
background-color: #f0f8ff; /* Light blue when edited */
|
| 34 |
}
|
|
|
|
| 35 |
.input-group {
|
| 36 |
position: relative;
|
| 37 |
}
|
|
|
|
| 38 |
.btn-change {
|
| 39 |
position: absolute;
|
| 40 |
right: 10px;
|
| 41 |
top: 50%;
|
| 42 |
transform: translateY(-50%);
|
| 43 |
background-color: #ffffff;
|
| 44 |
-
color: #0FAA39;
|
| 45 |
-
border: none;
|
| 46 |
border-radius: 5px;
|
| 47 |
padding: 5px 10px;
|
| 48 |
cursor: pointer;
|
| 49 |
font-size: 0.9rem;
|
| 50 |
}
|
|
|
|
| 51 |
.btn-change:hover {
|
| 52 |
background-color: #ffffff;
|
| 53 |
color: #0FAA39;
|
| 54 |
}
|
|
|
|
| 55 |
.copy-btn {
|
| 56 |
position: absolute;
|
| 57 |
right: 10px;
|
|
@@ -63,6 +70,7 @@
|
|
| 63 |
font-size: 1.2rem;
|
| 64 |
cursor: pointer;
|
| 65 |
}
|
|
|
|
| 66 |
.update-btn {
|
| 67 |
background-color: #0FAA39;
|
| 68 |
color: white;
|
|
@@ -72,9 +80,11 @@
|
|
| 72 |
font-size: 1rem;
|
| 73 |
cursor: pointer;
|
| 74 |
}
|
|
|
|
| 75 |
.update-btn:hover {
|
| 76 |
background-color: #0f8e29;
|
| 77 |
}
|
|
|
|
| 78 |
.edit-btn {
|
| 79 |
background-color: #0FAA39;
|
| 80 |
color: white;
|
|
@@ -83,13 +93,40 @@
|
|
| 83 |
padding: 10px 20px;
|
| 84 |
font-size: 1rem;
|
| 85 |
cursor: pointer;
|
|
|
|
| 86 |
}
|
|
|
|
| 87 |
.edit-btn:hover {
|
| 88 |
background-color: #0f8e29;
|
| 89 |
}
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
}
|
| 94 |
</style>
|
| 95 |
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
@@ -124,7 +161,6 @@
|
|
| 124 |
}
|
| 125 |
|
| 126 |
function editProfileFields() {
|
| 127 |
-
// Making only editable fields editable (Excluding referralCode and rewardPoints)
|
| 128 |
document.getElementById('customerName').removeAttribute('readonly');
|
| 129 |
document.getElementById('email').removeAttribute('readonly');
|
| 130 |
document.getElementById('phone').removeAttribute('readonly');
|
|
@@ -190,8 +226,10 @@
|
|
| 190 |
<input type="text" id="rewardPoints" name="rewardPoints" class="form-control" value="{{ customer['reward_points'] }}" readonly>
|
| 191 |
</div>
|
| 192 |
|
| 193 |
-
<
|
| 194 |
-
|
|
|
|
|
|
|
| 195 |
</form>
|
| 196 |
</div>
|
| 197 |
</div>
|
|
|
|
| 7 |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
|
| 8 |
<style>
|
| 9 |
body {
|
| 10 |
+
background-color: #FDF4E3;
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
.back-to-menu {
|
| 14 |
display: block;
|
| 15 |
margin: 30px auto 10px auto;
|
|
|
|
| 26 |
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
| 27 |
transition: background-color 0.3s ease;
|
| 28 |
}
|
| 29 |
+
|
| 30 |
.back-to-menu:hover {
|
| 31 |
background-color: #e64a19;
|
| 32 |
text-decoration: none;
|
| 33 |
}
|
| 34 |
+
|
| 35 |
.editable {
|
| 36 |
background-color: #f0f8ff; /* Light blue when edited */
|
| 37 |
}
|
| 38 |
+
|
| 39 |
.input-group {
|
| 40 |
position: relative;
|
| 41 |
}
|
| 42 |
+
|
| 43 |
.btn-change {
|
| 44 |
position: absolute;
|
| 45 |
right: 10px;
|
| 46 |
top: 50%;
|
| 47 |
transform: translateY(-50%);
|
| 48 |
background-color: #ffffff;
|
| 49 |
+
color: #0FAA39;
|
| 50 |
+
border: none;
|
| 51 |
border-radius: 5px;
|
| 52 |
padding: 5px 10px;
|
| 53 |
cursor: pointer;
|
| 54 |
font-size: 0.9rem;
|
| 55 |
}
|
| 56 |
+
|
| 57 |
.btn-change:hover {
|
| 58 |
background-color: #ffffff;
|
| 59 |
color: #0FAA39;
|
| 60 |
}
|
| 61 |
+
|
| 62 |
.copy-btn {
|
| 63 |
position: absolute;
|
| 64 |
right: 10px;
|
|
|
|
| 70 |
font-size: 1.2rem;
|
| 71 |
cursor: pointer;
|
| 72 |
}
|
| 73 |
+
|
| 74 |
.update-btn {
|
| 75 |
background-color: #0FAA39;
|
| 76 |
color: white;
|
|
|
|
| 80 |
font-size: 1rem;
|
| 81 |
cursor: pointer;
|
| 82 |
}
|
| 83 |
+
|
| 84 |
.update-btn:hover {
|
| 85 |
background-color: #0f8e29;
|
| 86 |
}
|
| 87 |
+
|
| 88 |
.edit-btn {
|
| 89 |
background-color: #0FAA39;
|
| 90 |
color: white;
|
|
|
|
| 93 |
padding: 10px 20px;
|
| 94 |
font-size: 1rem;
|
| 95 |
cursor: pointer;
|
| 96 |
+
width: 100%;
|
| 97 |
}
|
| 98 |
+
|
| 99 |
.edit-btn:hover {
|
| 100 |
background-color: #0f8e29;
|
| 101 |
}
|
| 102 |
+
|
| 103 |
+
/* Flexbox for equally spaced buttons */
|
| 104 |
+
.button-container {
|
| 105 |
+
display: flex;
|
| 106 |
+
justify-content: space-between;
|
| 107 |
+
margin-top: 20px;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
/* Ensure both buttons have equal height and width */
|
| 111 |
+
.edit-btn, .update-btn {
|
| 112 |
+
flex: 1;
|
| 113 |
+
margin: 0 5px;
|
| 114 |
+
padding: 10px 20px;
|
| 115 |
+
font-size: 1rem;
|
| 116 |
+
cursor: pointer;
|
| 117 |
+
border-radius: 5px;
|
| 118 |
+
height: 50px; /* Equal height for both buttons */
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
/* Change font size for User Profile heading */
|
| 122 |
+
h1 {
|
| 123 |
+
font-size: 2rem; /* Set font size to 2rem (32px) */
|
| 124 |
+
color:#6c757d; /* Set color for heading */
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
/* Gray color for fields and labels */
|
| 128 |
+
h1, .form-label, .form-control {
|
| 129 |
+
color: #6c757d; /* Set text color to gray */
|
| 130 |
}
|
| 131 |
</style>
|
| 132 |
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
|
|
| 161 |
}
|
| 162 |
|
| 163 |
function editProfileFields() {
|
|
|
|
| 164 |
document.getElementById('customerName').removeAttribute('readonly');
|
| 165 |
document.getElementById('email').removeAttribute('readonly');
|
| 166 |
document.getElementById('phone').removeAttribute('readonly');
|
|
|
|
| 226 |
<input type="text" id="rewardPoints" name="rewardPoints" class="form-control" value="{{ customer['reward_points'] }}" readonly>
|
| 227 |
</div>
|
| 228 |
|
| 229 |
+
<div class="button-container">
|
| 230 |
+
<button type="button" class="edit-btn" onclick="editProfileFields()">Edit Profile</button>
|
| 231 |
+
<button type="submit" class="update-btn">Update Profile</button>
|
| 232 |
+
</div>
|
| 233 |
</form>
|
| 234 |
</div>
|
| 235 |
</div>
|