Ignore:
Timestamp:
03/05/23 17:35:54 (16 months ago)
Author:
SazdovaEkaterina <sazdovaekaterina@…>
Branches:
main
Children:
8b7dd7f
Parents:
9358bff
Message:

use model instead of session

Location:
Prototype Application/Paw5/src/main/resources/templates
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Prototype Application/Paw5/src/main/resources/templates/list-posts-adoption.html

    r9358bff r5f53114  
    11<!DOCTYPE html>
    22<html xmlns="http://www.w3.org/1999/xhtml"
    3       xmlns:th="http://www.thymeleaf.org"
     3      xmlns:th="http://thymeleaf.org"
    44      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
    55      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
     
    4545        <th>Species</th>
    4646    </tr>
    47     <tr th:each = "post : ${session.posts}">
     47    <tr th:each = "post : ${posts}">
    4848        <td th:text = "${post.getId()}"></td>
    49         <td th:each = "pet : ${session.pets}" th:if="${post.getPetId()==pet.getId()}" th:text = "${pet.getName()}"></td>
    50         <td th:each = "pet : ${session.pets}" th:if="${post.getPetId()==pet.getId()}" th:text = "${pet.getSpecies()}"></td>
     49        <td th:each = "pet : ${pets}" th:if="${post.getPetId()==pet.getId()}" th:text = "${pet.getName()}"></td>
     50        <td th:each = "pet : ${pets}" th:if="${post.getPetId()==pet.getId()}" th:text = "${pet.getSpecies()}"></td>
    5151        <td>
    5252            <form th:action="@{'/pet-details-{id}' (id=${post.getId()})}"
  • Prototype Application/Paw5/src/main/resources/templates/pet-details.html

    r9358bff r5f53114  
    11<!DOCTYPE html>
    22<html xmlns="http://www.w3.org/1999/xhtml"
    3       xmlns:th="http://www.thymeleaf.org"
     3      xmlns:th="http://thymeleaf.org"
    44      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
    55      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
     
    4141    <tr>
    4242        <th>Post ID</th>
    43         <td th:text = "${session.post.getId()}"></td>
     43        <td th:text = "${post.getId()}"></td>
    4444    <tr>
    4545        <th>Pet Name</th>
    46         <td th:text = "${session.pet.getName()}"></td>
     46        <td th:text = "${pet.getName()}"></td>
    4747    </tr>
    4848    <tr>
    4949        <th>Species</th>
    50         <td th:text = "${session.pet.getSpecies()}"></td>
     50        <td th:text = "${pet.getSpecies()}"></td>
    5151    </tr>
    5252    <tr>
    5353        <th>Breed</th>
    54         <td th:text = "${session.pet.getBreed()}"></td>
     54        <td th:text = "${pet.getBreed()}"></td>
    5555    </tr>
    5656    <tr>
    5757        <th>Gender</th>
    58         <td th:text = "${session.pet.getGender()}"></td>
     58        <td th:text = "${pet.getGender()}"></td>
    5959    </tr>
    6060    <tr>
    6161        <th>Age Group</th>
    62         <td th:text = "${session.pet.getAgeGroup}"></td>
     62        <td th:text = "${pet.getAgeGroup}"></td>
    6363    </tr>
    6464    <tr>
    6565        <th>Size</th>
    66         <td th:text = "${session.pet.getSize()}"></td>
     66        <td th:text = "${pet.getSize()}"></td>
    6767    </tr>
    6868</table>
    6969<form method="POST"
    70       th:action="@{'/submit-adopton-{id}' (id=${session.pet.getId()})}"
    71       th:if="${session.pet.getAdoptionId()==null}">
    72     <button id="submit" type="submit">Adopt</button>
     70      th:action="@{'/submit-adopton-{id}' (id=${pet.getId()})}"
     71      th:if="${pet.getAdoptionId()==null}">
     72    <button id="submit"
     73            type="submit"
     74            class="btn">Adopt</button>
    7375</form>
    7476
Note: See TracChangeset for help on using the changeset viewer.