Changeset 950fa0d
- Timestamp:
- 05/24/23 23:18:47 (18 months ago)
- Branches:
- master
- Children:
- 77205be
- Parents:
- 8bcd64c
- Location:
- src/main
- Files:
-
- 7 added
- 24 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/edu/gjoko/schedlr/config/AppFilter.java
r8bcd64c r950fa0d 10 10 import org.springframework.web.filter.GenericFilterBean; 11 11 12 import javax.servlet.FilterChain; 13 import javax.servlet.ServletException; 14 import javax.servlet.ServletRequest; 15 import javax.servlet.ServletResponse; 12 import javax.servlet.*; 16 13 import javax.servlet.http.HttpServletRequest; 17 14 import javax.servlet.http.HttpServletResponse; … … 75 72 break; 76 73 } 77 if(page != null && !page.trim().isEmpty() ) {74 if(page != null && !page.trim().isEmpty() && !DispatcherType.ERROR.equals(servletRequest.getDispatcherType())) { 78 75 servletRequest.getRequestDispatcher(page).forward(servletRequest, servletResponse); 79 76 return; -
src/main/java/edu/gjoko/schedlr/config/AppSecurityConfig.java
r8bcd64c r950fa0d 10 10 import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 11 11 import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 12 import org.springframework.security.config.core.GrantedAuthorityDefaults;13 12 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 14 import org.springframework.security.web.access.AccessDeniedHandler;15 13 import org.springframework.security.web.authentication.AuthenticationFailureHandler; 16 14 import org.springframework.security.web.authentication.AuthenticationSuccessHandler; 15 import org.springframework.security.web.authentication.logout.HeaderWriterLogoutHandler; 16 import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler; 17 17 import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; 18 import org.springframework.security.web.header.writers.ClearSiteDataHeaderWriter; 19 20 import static org.springframework.security.web.header.writers.ClearSiteDataHeaderWriter.Directive.*; 18 21 19 22 @Configuration … … 21 24 @AllArgsConstructor 22 25 public class AppSecurityConfig extends WebSecurityConfigurerAdapter { 26 27 private static final ClearSiteDataHeaderWriter.Directive[] SOURCE = 28 {CACHE, COOKIES, STORAGE, EXECUTION_CONTEXTS}; 23 29 24 30 private final PostgresUserDetailsService userDetailsService; … … 55 61 .defaultSuccessUrl("/homepage") 56 62 .and() 63 .logout(logout -> logout 64 .logoutUrl("/logout") 65 .logoutSuccessUrl("/login") 66 .addLogoutHandler(new SecurityContextLogoutHandler()) 67 .addLogoutHandler(new HeaderWriterLogoutHandler(new ClearSiteDataHeaderWriter(SOURCE)))) 57 68 .authorizeRequests() 58 69 .antMatchers("/login").permitAll() 70 .antMatchers("/logout").permitAll() 59 71 .antMatchers("/register_customer").permitAll() 60 72 .antMatchers("/register_business").permitAll() 61 73 .antMatchers("/api/nomenclatures/*").permitAll() 74 .antMatchers("/api/user/me").permitAll() 62 75 .antMatchers("/api/business").permitAll() 76 .antMatchers("/api/appointment").permitAll() 63 77 .antMatchers("/homepage").permitAll() 64 78 .antMatchers("/css/**").permitAll() -
src/main/java/edu/gjoko/schedlr/controllers/rest/BusinessController.java
r8bcd64c r950fa0d 2 2 3 3 import edu.gjoko.schedlr.entity.Business; 4 import edu.gjoko.schedlr.entity.BusinessType; 4 5 import edu.gjoko.schedlr.services.BusinessService; 5 6 import lombok.AllArgsConstructor; 6 import org.springframework.security.core.Authentication;7 import org.springframework.security.core.context.SecurityContextHolder;8 7 import org.springframework.web.bind.annotation.*; 9 8 … … 38 37 return businessService.findByOwner(businessOwnerId); 39 38 } 39 40 @GetMapping(path = "/{businessTypeId}") 41 public List<Business> getBusinessesByBusinessType(@PathVariable("businessTypeId") Long id) { 42 BusinessType businessType = new BusinessType(); 43 businessType.setId(id); 44 return businessService.findByBusinessTypeAndActiveStatus(businessType); 45 } 40 46 } -
src/main/java/edu/gjoko/schedlr/controllers/rest/NomenclatureController.java
r8bcd64c r950fa0d 2 2 3 3 import edu.gjoko.schedlr.entity.BusinessType; 4 import edu.gjoko.schedlr.repositories.BusinessTypeRepository;5 4 import edu.gjoko.schedlr.services.NomenclaturesService; 6 5 import lombok.AllArgsConstructor; … … 14 13 @RequestMapping("api/nomenclatures") 15 14 @AllArgsConstructor 16 public class Nomenclature sController {15 public class NomenclatureController { 17 16 18 17 private final NomenclaturesService nomenclaturesService; -
src/main/java/edu/gjoko/schedlr/entity/Appointment.java
r8bcd64c r950fa0d 24 24 private Long id; 25 25 26 @Column(name = "start_t ype")26 @Column(name = "start_time") 27 27 private LocalDateTime startTime; 28 28 … … 30 30 private LocalDateTime endTime; 31 31 32 @Column(name = "price") 33 private Float price; 32 @OneToOne 33 @JoinColumn(name = "customer_id", referencedColumnName = "id") 34 private Stakeholder customer; 35 36 @ManyToOne 37 @JoinColumn(name = "business_id") 38 private Business business; 39 40 @ManyToOne 41 @JoinColumn(name = "service_id") 42 private Service service; 34 43 35 44 @Column(name = "created") -
src/main/java/edu/gjoko/schedlr/entity/Business.java
r8bcd64c r950fa0d 37 37 private BusinessType businessType; 38 38 39 @ManyToOne( cascade = CascadeType.PERSIST)39 @ManyToOne() 40 40 @JoinColumn(name = "owner_id", referencedColumnName = "id", nullable = false) 41 41 @JsonProperty("owner") -
src/main/java/edu/gjoko/schedlr/entity/Service.java
r8bcd64c r950fa0d 33 33 private Integer price; 34 34 35 @OneToOne(cascade = CascadeType. MERGE)35 @OneToOne(cascade = CascadeType.PERSIST) 36 36 @JoinColumn(name = "service_type_id", referencedColumnName = "id") 37 37 private ServiceType serviceType; 38 38 39 39 @ManyToOne 40 @JoinColumn(name = "business_ fk")40 @JoinColumn(name = "business_id") 41 41 @JsonBackReference 42 42 private Business business; -
src/main/java/edu/gjoko/schedlr/entity/ServiceType.java
r8bcd64c r950fa0d 30 30 private String name; 31 31 32 33 32 @ManyToOne 34 33 @JoinColumn(name = "business_type_id") -
src/main/java/edu/gjoko/schedlr/entity/Stakeholder.java
r8bcd64c r950fa0d 43 43 44 44 @Column(name = "password") 45 @JsonIgnore46 45 private String password; 47 46 -
src/main/java/edu/gjoko/schedlr/repositories/BusinessRepository.java
r8bcd64c r950fa0d 3 3 import edu.gjoko.schedlr.entity.Business; 4 4 import edu.gjoko.schedlr.entity.BusinessStatus; 5 import edu.gjoko.schedlr.entity.BusinessType; 5 6 import edu.gjoko.schedlr.entity.Stakeholder; 7 import org.hibernate.Session; 6 8 import org.springframework.data.jpa.repository.JpaRepository; 7 9 import org.springframework.stereotype.Repository; … … 12 14 public interface BusinessRepository extends JpaRepository<Business, Long> { 13 15 14 List<Business> findBusinessesByBusinessStatus(BusinessStatus status);16 Business findBusinessByOwner(Stakeholder owner); 15 17 16 Business findBusinessByOwner(Stakeholder owner);18 List<Business> findBusinessesByBusinessTypeAndBusinessStatus(BusinessType businessType, BusinessStatus businessStatus); 17 19 } -
src/main/java/edu/gjoko/schedlr/services/BusinessService.java
r8bcd64c r950fa0d 1 1 package edu.gjoko.schedlr.services; 2 2 3 import edu.gjoko.schedlr.entity.Business; 4 import edu.gjoko.schedlr.entity.ServiceType; 5 import edu.gjoko.schedlr.entity.Stakeholder; 6 import edu.gjoko.schedlr.entity.StakeholderType; 3 import edu.gjoko.schedlr.entity.*; 7 4 import edu.gjoko.schedlr.repositories.BusinessRepository; 5 import edu.gjoko.schedlr.repositories.ServiceRepository; 8 6 import edu.gjoko.schedlr.repositories.ServiceTypeRepository; 7 import edu.gjoko.schedlr.repositories.StakeholderRepository; 9 8 import lombok.AllArgsConstructor; 10 9 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; … … 13 12 import java.util.List; 14 13 14 import static edu.gjoko.schedlr.entity.BusinessStatus.ACTIVE; 15 15 import static edu.gjoko.schedlr.entity.BusinessStatus.NEW; 16 16 … … 21 21 private final BusinessRepository businessRepository; 22 22 private final ServiceTypeRepository serviceTypeRepository; 23 private final ServiceRepository serviceRepository; 24 25 private final StakeholderRepository stakeholderRepository; 23 26 private BCryptPasswordEncoder bCryptPasswordEncoder; 24 27 … … 51 54 .stream() 52 55 .forEach(business -> { 56 stakeholderRepository.save(business.getOwner()); 57 serviceRepository.saveAll(business.getServices()); 53 58 businessRepository.save(business); 54 59 }); … … 60 65 return businessRepository.findBusinessByOwner(owner); 61 66 } 67 68 public List<Business> findByBusinessTypeAndActiveStatus(BusinessType businessType) { 69 return businessRepository.findBusinessesByBusinessTypeAndBusinessStatus(businessType, ACTIVE); 70 } 62 71 } -
src/main/java/edu/gjoko/schedlr/services/PostgresUserDetailsService.java
r8bcd64c r950fa0d 8 8 import edu.gjoko.schedlr.repositories.StakeholderRepository; 9 9 import lombok.RequiredArgsConstructor; 10 import org.springframework.security.access.AccessDeniedException;11 10 import org.springframework.security.core.GrantedAuthority; 12 11 import org.springframework.security.core.authority.SimpleGrantedAuthority; … … 15 14 import org.springframework.security.core.userdetails.UserDetailsService; 16 15 import org.springframework.security.core.userdetails.UsernameNotFoundException; 17 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;18 16 import org.springframework.stereotype.Service; 19 17 … … 26 24 27 25 private final StakeholderRepository stakeholderRepository; 28 private final BCryptPasswordEncoder bCryptPasswordEncoder;29 30 26 private final BusinessRepository businessRepository; 31 27 … … 33 29 public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { 34 30 Stakeholder user = stakeholderRepository.findStakeholderByUsername(username); 35 if (user == null) {31 if (user == null) { 36 32 throw new UsernameNotFoundException("Non existing user"); 37 33 } 38 34 39 if (user.getStakeholderType() == StakeholderType.BUSINESS_OWNER) {35 if (user.getStakeholderType() == StakeholderType.BUSINESS_OWNER) { 40 36 Business business = businessRepository.findBusinessByOwner(user); 41 37 if (business.getBusinessStatus() != BusinessStatus.ACTIVE) { -
src/main/java/edu/gjoko/schedlr/services/StakeholderService.java
r8bcd64c r950fa0d 24 24 return stakeholderRepository.save(stakeholder); 25 25 } 26 27 public Stakeholder findById(Long id) { 28 return stakeholderRepository.findById(id).get(); 29 } 26 30 } -
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.