Skip to content

Commit

Permalink
#EHA-33 Veterinarian list for admin dashboard is fetched.
Browse files Browse the repository at this point in the history
  • Loading branch information
beyzaaydeniz committed Jan 2, 2024
1 parent 013bdbc commit cb0f7f8
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 19 deletions.
6 changes: 5 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.production.ehayvanbackendapi.Controllers;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import com.production.ehayvanbackendapi.DTO.VeterinarianDTO;
import com.production.ehayvanbackendapi.DTO.request.CreateOrUpdateVeterinarianDTO;
import com.production.ehayvanbackendapi.Services.VeterinarianService;
Expand All @@ -8,7 +10,7 @@
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@Controller
@RequestMapping("/api/veterinarians")
public class VeterinarianController {
private final VeterinarianService veterinarianService;
Expand Down Expand Up @@ -84,6 +86,13 @@ public ResponseEntity<List<VeterinarianDTO>> getAllVeterinarians() {
}
}

@GetMapping("/desktop")
public String desktop(Model model) {
List<VeterinarianDTO> veterinarians = veterinarianService.getAllVeterinarians();
model.addAttribute("veterinarians", veterinarians);
return "desktop";
}

// Other controller methods for updating, deleting veterinarians, etc.
}

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en" style="height: 100%;">
<html lang="en" style="height: 100%;" xmlns:th="http://www.thymeleaf.org">

<head>
<meta charset="utf-8" />
Expand Down Expand Up @@ -30,11 +30,11 @@
<div class="Text" style="text-align: center; color: white; font-size: 40px; font-family: RocknRoll One; font-weight: 400">
E-H
<div class="Icon" style="display: inline-block; width: 12%; height: 12%">
<img class="Vector" src="Images/Union.png" alt="Logo" style="width: 100%; height: 100%; object-fit: contain; vertical-align: center; padding-bottom: 10px;">
<img class="Vector" src="../static/images/Union.png" alt="Logo" style="width: 100%; height: 100%; object-fit: contain; vertical-align: center; padding-bottom: 10px;">
</div>
YV
<div class="Icon" style="display: inline-block; width: 12%; height: 12%">
<img class="Vector" src="Images/Union.png" alt="Logo" style="width: 100%; height: 100%; object-fit: contain; vertical-align: center; padding-bottom: 10px;">
<img class="Vector" src="../static/images/Union.png" alt="Logo" style="width: 100%; height: 100%; object-fit: contain; vertical-align: center; padding-bottom: 10px;">
</div>
N
</div>
Expand All @@ -52,7 +52,7 @@
<div class="Esther" style="align-self: stretch; color: white; font-size: 18px; font-weight: 600; line-height: 26px; word-wrap: break-word">Esther</div>
</div>
<div class="Icon" style="width: 20px; height: 20px; position: relative; overflow: hidden;">
<img class="Vector" src="Images/logout.png" alt="Logout Icon" style="width: 100%; height: 100%; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);">
<img th:src="@{/images/logout.png}" alt="Logout Icon" style="width: 100%; height: 100%; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);">
</div>
</div>
</div>
Expand All @@ -69,14 +69,23 @@
<button type="button" class="btn btn-warning" data-toggle="modal" data-target="#filter-vet-modal" style="position: fixed; bottom: 2.5em; right: 2.5em; background-color: #1B85F3; border: none; color: white;">
Filter Veterinarian
</button>
<table class="table table-hover table-sm" style="width: 100%;">
<tr class = "table-active" style="text-align: center;">
<th>Name</th>
<th>Clinic Name</th>
<th colspan="2">Delete</th>
</tr>
</table>
<!-- FILTER -->
<table class="table table-hover table-sm" style="width: 100%; text-align: center;">
<thead>
<tr class="table-active">
<th>Name</th>
<th>Clinic Name</th>
<th colspan="2">Delete</th>
</tr>
</thead>
<tbody style="text-align: center;">
<tr th:each="vet : ${veterinarians}">
<td th:text="${vet.user.name}"></td>
<td th:text="${vet.clinic}"></td>
</tr>
</tbody>
</table>

<!-- FILTER -->
<div class="modal fade" id="filter-vet-modal" tabindex="-1" aria-labelledby="filter-vet-modal-label" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@
<div class="Text" style="text-align: left; margin-top: 30px; margin-left: 100px; color: black; font-size: 80px; font-family: RocknRoll One; font-weight: 400">
E-H
<div class="Icon" style="display: inline-block; width: 8%; height: 8%">
<img class="Vector" src="Images/Union.png" alt="Logo" style="width: 100%; height: 100%; object-fit: contain; vertical-align: center; padding-bottom: 10px;">
<img class="Vector" src="../static/images/Union.png" alt="Logo" style="width: 100%; height: 100%; object-fit: contain; vertical-align: center; padding-bottom: 10px;">
</div>
YV
<div class="Icon" style="display: inline-block; width: 8%; height: 8%">
<img class="Vector" src="Images/Union.png" alt="Logo" style="width: 100%; height: 100%; object-fit: contain; vertical-align: center; padding-bottom: 10px;">
<img class="Vector" src="../static/images/Union.png" alt="Logo" style="width: 100%; height: 100%; object-fit: contain; vertical-align: center; padding-bottom: 10px;">
</div>
N
</div>
<img src="Images/newdog.png" alt="New Dog Image" style="width: 52%; height: auto;">
<img src="../static/images/newdog.png" alt="New Dog Image" style="width: 52%; height: auto;">
</div>

<div class="OtherSideMenu" style="width: 50%; height: 100%; flex-direction: column; justify-content: flex-start; margin-left: 0;">
<div class="ActionSheet" style="width: 500px; height: 450px; margin-top: 170px; margin-left: 130px; flex-direction: column; align-items: center; display: inline-flex; background-color: white; border-radius: 20px;">
<div class="BulletContainer" style="padding: 16px; justify-content: center; align-items: center; gap: 10px; display: inline-flex">
<div class="IconFrame" style="padding: 24px; border-radius: 56px; border: 3px #D1E6FF solid; justify-content: center; align-items: center; gap: 10px; display: flex">
<div class="Icon" style="width: 48px; height: 48px; position: relative">
<img class="Vector" src="Images/Icon.png" alt="Logo" style="width: 100%; height: 100%; object-fit: contain; vertical-align: center; padding-bottom: 10px;">
<img class="Vector" src="../static/images/Icon.png" alt="Logo" style="width: 100%; height: 100%; object-fit: contain; vertical-align: center; padding-bottom: 10px;">
</div>
</div>
</div>
Expand Down

0 comments on commit cb0f7f8

Please sign in to comment.