Changeset cc52b09


Ignore:
Timestamp:
02/02/23 23:05:16 (21 months ago)
Author:
Gjoko Kostadinov <gjoko.kostadinov@…>
Branches:
master
Children:
a436340
Parents:
9280859
Message:

Add search button functionality

Location:
src/main
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/edu/gjoko/schedlr/controllers/HomePageController.java

    r9280859 rcc52b09  
    2222        return "homepage";
    2323    }
    24 
    25     @GetMapping("/search")
    26     public String getAppointments(Model model, @ModelAttribute("search")Search search) {
    27         model.addAttribute("search", search);
    28         return "homepage";
    29     }
    3024}
  • src/main/resources/application.properties

    r9280859 rcc52b09  
    1 spring.datasource.url=jdbc:postgresql://localhost:5432/schedlr
     1spring.datasource.url=jdbc:postgresql://localhost:5433/schedlr
    22spring.datasource.username=postgres
    3 spring.datasource.password=postgres
     3spring.datasource.password=silic0n
    44
    55spring.sql.init.mode=never
  • src/main/resources/static/js/homepage.js

    r9280859 rcc52b09  
    155155        ],
    156156    });
     157    $("#search").click(function () {
     158        alert("qweqew");
    157159
     160        $.ajax({
     161            url: "http://localhost:8080/events"
     162        }).then(function(data) {
     163            console.log(data);
     164        });
     165    });
    158166
    159167});
     168
     169function search() {
     170
     171}
  • src/main/resources/templates/homepage.html

    r9280859 rcc52b09  
    2626    <div class="card">
    2727        <div class="card-body py-5 px-md-5">
    28             <form th:action="@{/search}" method="get" th:object="${search}">
    2928                <div>
    3029                    <label for="student-birth-date">Date of search:</label>
    31                     <input type="date" th:field="${search.date}" id="student-birth-date"/>
     30                    <input type="date" id="student-birth-date"/>
    3231                </div>
    3332                <div>
    34                     <button type="submit" class="button">Search</button>
     33                    <button type="submit" class="button" id="search">Search</button>
    3534                </div>
    36             </form>
    3735        </div>
    3836    </div>
Note: See TracChangeset for help on using the changeset viewer.