Changeset 950fa0d for src/main/resources
- Timestamp:
- 05/24/23 23:18:47 (18 months ago)
- Branches:
- master
- Children:
- 77205be
- Parents:
- 8bcd64c
- Location:
- src/main/resources
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/resources/static/css/fullcalendar.css
r8bcd64c r950fa0d 135 135 136 136 .fc-state-highlight > div > div.fc-day-number{ 137 background-color: # ff3b30;137 background-color: #3b71ca; 138 138 color: #FFFFFF; 139 139 border-radius: 50%; … … 212 212 213 213 .fc-state-default { 214 border-color: # ff3b30;215 color: # ff3b30;214 border-color: #3b71ca; 215 color: #3b71ca; 216 216 } 217 217 .fc-button-month.fc-state-default, .fc-button-agendaWeek.fc-state-default, .fc-button-agendaDay.fc-state-default{ … … 226 226 .fc-state-disabled { 227 227 color: #333333; 228 background-color: # FFE3E3;228 background-color: #fff; 229 229 } 230 230 231 231 .fc-state-hover { 232 color: # ff3b30;232 color: #3b71ca; 233 233 text-decoration: none; 234 234 background-position: 0 -15px; … … 241 241 .fc-state-down, 242 242 .fc-state-active { 243 background-color: # ff3b30;243 background-color: #3b71ca; 244 244 background-image: none; 245 245 outline: 0; … … 250 250 cursor: default; 251 251 background-image: none; 252 background-color: # FFE3E3;252 background-color: #fff; 253 253 filter: alpha(opacity=65); 254 254 box-shadow: none; 255 border:1px solid # FFE3E3;256 color: # ff3b30;255 border:1px solid #fff; 256 color: #3b71ca; 257 257 } 258 258 … … 648 648 } 649 649 .fc-week .fc-day.fc-state-highlight:hover .fc-day-number{ 650 background-color: # ff3b30;650 background-color: #3b71ca; 651 651 } 652 652 .fc-button-today{ -
src/main/resources/static/css/homepage.css
r8bcd64c r950fa0d 1 1 #wrap { 2 margin-left: 50px;3 2 float:left; 3 width: 1000px; 4 4 } 5 5 … … 13 13 header { 14 14 background-color: white; 15 height: 67px; 15 16 } 16 17 … … 65 66 -webkit-overflow-scrolling: touch; 66 67 } 68 69 .hidden-button { 70 display: none; 71 width: 0px; 72 } 73 74 .card { 75 padding: 10px; 76 77 } -
src/main/resources/static/js/business_admin.js
r8bcd64c r950fa0d 7 7 }).then(function (data) { 8 8 business = data; 9 console.log(business);10 9 var $header = $("#header"); 11 10 … … 74 73 event.preventDefault(); 75 74 }); 75 76 $("#update_services_button").click(function () { 77 businesses = []; 78 console.log("Gjoko"); 79 servicesObj = []; 80 $.each($('#predefined_services_admin_panel input:checked').siblings(), function (index, label) { 81 82 let service = {}; 83 var id = $(label).prop('for'); 84 var text = $(label).text(); 85 var time = $($($(label).parent()).siblings()[0]).children()[0].value; 86 var price = $($($(label).parent()).siblings()[1]).children()[0].value; 87 88 var serviceType = {} 89 if (parseInt(id) != -1) { 90 service['id'] = parseInt(id); 91 serviceType['id'] = business['services'].find(obj => obj.id === parseInt(id))['serviceType']['id']; 92 } else { 93 94 } 95 serviceType['name'] = text.trim(); 96 service['serviceType'] = serviceType; 97 service['duration'] = parseInt(time); 98 service['price'] = parseInt(price); 99 servicesObj.push(service); 100 }); 101 business['services'] = servicesObj; 102 103 businesses.push(business); 104 console.log(JSON.stringify(businesses)); 105 106 $.ajax({ 107 url: "http://localhost:8080/api/business", 108 type:"PATCH", 109 data: JSON.stringify(businesses), 110 contentType:"application/json; charset=utf-8", 111 dataType: 'text', 112 success: function(succ){ 113 alert( "Updates applied successfully" ); 114 }, 115 error: function(err) { 116 alert(err); 117 } 118 }); 119 event.preventDefault(); 120 }); 121 122 $("#update_owner_button").click(function() { 123 businesses = []; 124 console.log("Gjoko"); 125 business['owner']['firstName'] = $('#firstName').val(); 126 business['owner']['lastName'] = $('#lastName').val(); 127 business['owner']['email'] = $('#email').val(); 128 business['owner']['username'] = $('#username').val(); 129 130 businesses.push(business); 131 console.log(JSON.stringify(businesses)); 132 133 $.ajax({ 134 url: "http://localhost:8080/api/business", 135 type:"PATCH", 136 data: JSON.stringify(businesses), 137 contentType:"application/json; charset=utf-8", 138 dataType: 'text', 139 success: function(succ){ 140 alert( "Updates applied successfully" ); 141 }, 142 error: function(err) { 143 alert(err); 144 } 145 }); 146 }); 147 event.preventDefault(); 76 148 }); -
src/main/resources/static/js/fullcalendar.js
r8bcd64c r950fa0d 2755 2755 allDaySlot: true, 2756 2756 allDayText: 'all-day', 2757 firstHour: 6, 2757 firstHour: 8, 2758 lastHour: 10, 2758 2759 slotMinutes: 30, 2759 2760 defaultEventMinutes: 120, … … 2767 2768 minTime: 0, 2768 2769 maxTime: 24, 2769 slotEventOverlap: true2770 slotEventOverlap: false 2770 2771 }); 2771 2772 -
src/main/resources/static/js/homepage.js
r8bcd64c r950fa0d 1 1 $(document).ready(function() { 2 var businessTypes = {}; 3 var businesses = {}; 2 4 var date = new Date(); 3 5 var d = date.getDate(); … … 11 13 */ 12 14 13 15 $.ajax({ 16 type: 'GET', 17 url: "http://localhost:8080/api/user/me", 18 success: function(data, textStatus, request) { 19 if (data) { 20 $('#create').parent().removeClass('hidden-button'); 21 $('#profile').parent().removeClass('hidden-button'); 22 $('#logout').parent().removeClass('hidden-button'); 23 $('#login').parent().addClass('hidden-button'); 24 } else { 25 $('#create').parent().addClass('hidden-button'); 26 $('#profile').parent().addClass('hidden-button'); 27 $('#logout').parent().addClass('hidden-button'); 28 $('#login').parent().removeClass('hidden-button'); 29 } 30 }, 31 error: function (request, textStatus, errorThrown) { 32 console.log(errorThrown); 33 } 34 }); 14 35 /* initialize the external events 15 36 -----------------------------------------------------------------*/ … … 35 56 }); 36 57 58 $.ajax({ 59 url: "http://localhost:8080/api/nomenclatures/businessTypes" 60 }).then(function (data) { 61 businessTypes = data; 62 var $el = $("#companyType"); 63 emptyDropdown($el); 64 65 $.each(data, function (index, obj) { 66 $el.append("<option value=" + obj.value + ">" + obj.text + "</option>"); 67 }); 68 }); 69 70 $("#companyType").change(function () { 71 var selectedVal = $(this).find(':selected').val(); 72 var selectedObj = businessTypes[selectedVal - 1]; 73 $.ajax({ 74 url: "http://localhost:8080/api/business/" + selectedObj.value 75 }).then(function (data) { 76 businesses = data; 77 console.log(data); 78 var $el = $("#company"); 79 var $servicesEl = $("#service"); 80 emptyDropdown($el); 81 emptyDropdown($servicesEl); 82 83 $.each(data, function (index, obj) { 84 $el.append("<option value=" + obj.id + ">" + obj.companyName + "</option>"); 85 }); 86 }); 87 }); 88 89 $("#company").change(function () { 90 var selectedVal = $(this).find(':selected').val(); 91 $.ajax({ 92 url: "http://localhost:8080/api/appointment/business/" + selectedVal 93 }).then(function (data) { 94 console.log(data); 95 var $el = $("#service"); 96 emptyDropdown($el); 97 98 var services = businesses.find(item => item.id == selectedVal)['services']; 99 console.log(services); 100 101 $.each(services, function (index, obj) { 102 $el.append("<option value=" + obj.id + ">" + obj.serviceType.name + "</option>"); 103 }); 104 }); 105 }); 106 37 107 38 108 /* initialize the calendar … … 47 117 editable: false, 48 118 edit: function (start, end, allDay) { 49 119 console.log(start); 120 console.log(end); 50 121 }, 51 122 firstDay: 1, // 1(Monday) this can be changed to 0(Sunday) for the USA system … … 131 202 start: new Date(y, m, d, 10, 30), 132 203 allDay: false, 133 className: 'i mportant'204 className: 'info' 134 205 }, 135 206 { … … 138 209 end: new Date(y, m, d, 14, 0), 139 210 allDay: false, 140 className: 'i mportant'211 className: 'info' 141 212 }, 142 213 { … … 155 226 ], 156 227 }); 157 $("#search").click(function () { 158 alert("qweqew"); 228 229 $("#createAppointment").click(function() { 230 var appointment = {}; 231 appointment['business'] = {'id': parseInt($("#company").val())}; 232 appointment['service'] = {'id': parseInt($("#service").val())}; 233 appointment['startTime'] = $("#startdatetime").val(); 159 234 160 235 $.ajax({ 161 url: "http://localhost:8080/events" 162 }).then(function(data) { 163 console.log(data); 164 }); 165 }); 236 url: "http://localhost:8080/api/appointment", 237 type:"POST", 238 data: JSON.stringify(appointment), 239 contentType:"application/json; charset=utf-8", 240 dataType: 'text', 241 success: function(succ){ 242 console.log('success'); 243 }, 244 error: function(err) { 245 console.log(JSON.stringify(err)); 246 } 247 }); 248 }) 166 249 167 250 }); 168 251 169 function search() { 170 252 document.getElementById("login").addEventListener("click", function(event){ 253 window.location = "/login"; 254 }); 255 256 function emptyDropdown(element) { 257 var defaultOption = element.children().get(0); 258 element.children().remove().end().append(defaultOption); 171 259 } -
src/main/resources/static/js/login.js
r8bcd64c r950fa0d 1 1 document.getElementById("login").addEventListener("click", function(event){ 2 event.preventDefault() 2 event.preventDefault(); 3 3 }); -
src/main/resources/static/js/register_business.js
r8bcd64c r950fa0d 49 49 '<div class="form-outline mb-4">' + 50 50 ' <div class="row">' + 51 ' <div class="col-md- 8">\n' +51 ' <div class="col-md-6">\n' + 52 52 ' <input class="form-check-input" type="checkbox" checked value="' + -1 + '" id="' + -1 + '">\n' + 53 53 ' <label class="form-check-label" for="' + -1 + '">\n' + … … 102 102 }); 103 103 businessObj['services'] = servicesObj; 104 console.log(JSON.stringify(businessObj));105 104 $.ajax({ 106 105 url: "http://localhost:8080/api/business", -
src/main/resources/templates/admin.html
r8bcd64c r950fa0d 14 14 <!-- Navbar start --> 15 15 <header class="p-3 mb-3 border-bottom"> 16 <div class=" container">17 <div class=" d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">16 <div class="row"> 17 <div class="col-md-10 mb-10"> 18 18 Welcome to the admin page 19 </div> 20 <div class="col-md-2 mb-2"> 21 <button id="logout" class="btn btn-primary btn-block"> 22 Logout 23 </button> 19 24 </div> 20 25 </div> … … 39 44 40 45 <!-- Submit button --> 41 <button type="butto m" class="btn btn-primary btn-block mb-4" id="save_button">46 <button type="button" class="btn btn-primary btn-block mb-4" id="save_button"> 42 47 Save changes 43 48 </button> … … 52 57 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script> 53 58 <script src="js/admin.js" type="text/javascript"></script> 59 <script src="js/logout.js" type="text/javascript"></script> 54 60 </body> 55 61 </html> -
src/main/resources/templates/business_admin.html
r8bcd64c r950fa0d 14 14 <!-- Navbar start --> 15 15 <header class="p-3 mb-3 border-bottom"> 16 <div class=" container">17 <div class=" d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start" >16 <div class="row"> 17 <div class="col-md-10 mb-10" > 18 18 <span id="header"> 19 19 Welcome back 20 20 </span> 21 </div> 22 <div class="col-md-2 mb-2"> 23 <button id="logout" class="btn btn-primary btn-block"> 24 Logout 25 </button> 21 26 </div> 22 27 </div> … … 77 82 aria-label="username"/> 78 83 </div> 79 <button type="butto m" class="btn btn-primary btn-block mb-4" id="update_owner_button">84 <button type="button" class="btn btn-primary btn-block mb-4" id="update_owner_button"> 80 85 Update profile 81 86 </button> … … 101 106 </div> 102 107 <div id="predefined_services_admin_panel" class="form-outline mb-4"></div> 103 <button type="butto m" class="btn btn-primary btn-block mb-4" id="update_services_button">108 <button type="button" class="btn btn-primary btn-block mb-4" id="update_services_button"> 104 109 Update services 105 110 </button> … … 112 117 <script src="js/business_admin.js" type="text/javascript"></script> 113 118 <script src="js/bootstrap.bundle.min.js"></script> 119 <script src="js/logout.js" type="text/javascript"></script> 114 120 </body> 115 121 </html> -
src/main/resources/templates/homepage.html
r8bcd64c r950fa0d 22 22 <!-- Navbar start --> 23 23 <header class="p-3 mb-3 border-bottom"> 24 <div class="container"> 25 <div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start"> 26 <a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-dark text-decoration-none"> 27 <svg class="bi me-2" width="40" height="32" role="img" aria-label="Bootstrap"> 28 <use xlink:href="#bootstrap"/> 29 </svg> 30 </a> 31 32 <ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0"> 33 <li><a href="#" class="nav-link px-2 link-secondary">Overview</a></li> 34 <li><a href="#" class="nav-link px-2 link-dark">Inventory</a></li> 35 <li><a href="#" class="nav-link px-2 link-dark">Customers</a></li> 36 <li><a href="#" class="nav-link px-2 link-dark">Products</a></li> 37 </ul> 38 39 <form class="col-12 col-lg-auto mb-3 mb-lg-0 me-lg-3" role="search"> 40 <input type="search" class="form-control" placeholder="Search..." aria-label="Search"> 41 </form> 42 43 <div class="dropdown text-end"> 44 <a href="#" class="d-block link-dark text-decoration-none dropdown-toggle" data-bs-toggle="dropdown" 45 aria-expanded="false"> 46 <img src="https://github.com/mdo.png" alt="mdo" width="32" height="32" class="rounded-circle"> 47 </a> 48 <ul class="dropdown-menu text-small"> 49 <li><a class="dropdown-item" href="#">New project...</a></li> 50 <li><a class="dropdown-item" href="#">Settings</a></li> 51 <li><a class="dropdown-item" href="#">Profile</a></li> 52 <li> 53 <hr class="dropdown-divider"> 54 </li> 55 <li><a class="dropdown-item" href="#">Sign out</a></li> 56 </ul> 57 </div> 24 <div class="row" style="justify-content: space-between;"> 25 <div class="col-md-8 mb-8"> 26 Welcome to the Schedlr 27 </div> 28 <div class="col-md-2 mb-2"> 29 <button id="profile" class="btn btn-primary btn-block"> 30 Profile 31 </button> 32 </div> 33 <div class="col-md-2 mb-2"> 34 <button id="logout" class="btn btn-primary btn-block"> 35 Logout 36 </button> 37 </div> 38 <div class="col-md-2 mb-2"> 39 <button id="login" class="btn btn-primary btn-block"> 40 Login 41 </button> 58 42 </div> 59 43 </div> 60 44 </header> 61 45 <!-- Navbar end --> 46 <div class="container"> 47 <div id='wrap'> 48 <div id='calendar'></div> 49 <div style='clear:both'></div> 50 </div> 62 51 63 <div id='wrap'>64 <div id='calendar'></div>65 <div style='clear:both'></div>66 </div>67 52 68 <div class="">69 53 <div class="card"> 70 <div class="card-body py-5 px-md-5"> 71 <div> 72 <label for="student-birth-date">Date of search:</label> 73 <input type="date" id="student-birth-date"/> 74 </div> 75 <div> 76 <button type="submit" class="button" id="search">Search</button> 77 </div> 54 <div class="form-outline mb-4"> 55 <select class="form-select" id="companyType" aria-label="Select company type"> 56 <option disabled selected hidden>Company Type</option> 57 </select> 58 </div> 59 60 <div class="form-outline mb-4"> 61 <select class="form-select" id="company" aria-label="Select company"> 62 <option disabled selected hidden>Company</option> 63 </select> 64 </div> 65 <div class="form-outline mb-4"> 66 <select class="form-select" id="service" aria-label="Select service"> 67 <option disabled selected hidden>Service</option> 68 </select> 69 </div> 70 <div class="form-outline mb-4"> 71 <label for="startdatetime">Start:</label> 72 <input type="datetime-local" id="startdatetime" name="startdatetime"> 73 </div> 74 <div class="form-outline mb-4"> 75 <button id="createAppointment" class="btn btn-primary btn-block"> 76 Create Appointment 77 </button> 78 78 </div> 79 79 </div> 80 80 81 </div> 81 82 <script src='js/jquery-1.10.2.js' type="text/javascript"></script> … … 84 85 <script src="js/homepage.js" type="text/javascript"></script> 85 86 <script src="js/bootstrap.bundle.min.js"></script> 87 <script src="js/logout.js" type="text/javascript"></script> 86 88 </body> 87 89 </html> -
src/main/resources/templates/login.html
r8bcd64c r950fa0d 58 58 </button> 59 59 <div th:if="${param.error}"> 60 <div th:if="${param.error.contains('notApproved')}" class="alert alert-danger ">60 <div th:if="${param.error.contains('notApproved')}" class="alert alert-danger alert-dismissible fade show"> 61 61 Account not approved yet. 62 62 </div> 63 63 64 <div th:if="${param.error.contains('badCredentials')}" class="alert alert-danger ">64 <div th:if="${param.error.contains('badCredentials')}" class="alert alert-danger alert-dismissible fade show"> 65 65 Invalid username or password. 66 66 </div> 67 </div> 68 <div th:if="${#request.getParameter('logoutSuccessful') != null}" 69 class="alert alert-success alert-dismissible fade show" role="alert"> 70 Successful logout 67 71 </div> 68 72 </form> -
src/main/resources/templates/register_business.html
r8bcd64c r950fa0d 104 104 105 105 <!-- Submit button --> 106 <button type="butto m" class="btn btn-primary btn-block mb-4" id="signup_business_button">106 <button type="button" class="btn btn-primary btn-block mb-4" id="signup_business_button"> 107 107 Sign up 108 108 </button>
Note:
See TracChangeset
for help on using the changeset viewer.