Changeset 3c7bf5b


Ignore:
Timestamp:
02/16/23 15:21:12 (21 months ago)
Author:
SazdovaEkaterina <sazdovaekaterina@…>
Branches:
main
Children:
eac569a
Parents:
9a180fd
Message:

link to home and add headers

Location:
Prototype Application/Paw5/src/main
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PostController.java

    r9a180fd r3c7bf5b  
    8888        request.getSession().setAttribute("pet", pet);//temp
    8989
     90        if(pet.getAdoptionId() != null){
     91            request.getSession().setAttribute("disableAdoption", true);
     92        } else{
     93            request.getSession().setAttribute("disableAdoption", false);
     94        }
     95
    9096        return "pet-details";
    9197    }
  • Prototype Application/Paw5/src/main/resources/templates/aboutUs.html

    r9a180fd r3c7bf5b  
    4040    <h5 class="text-center text-danger">
    4141        You successfully logged in
    42         <th:block  th:text="${session.user.getId()}"></th:block>
     42        <th:block  th:text="${session.user?.getId()}"></th:block>
    4343    </h5>
    4444</div>
  • Prototype Application/Paw5/src/main/resources/templates/home.html

    r9a180fd r3c7bf5b  
    3939  <h1>Welcome to Paw 5</h1>
    4040  <h3>Let's get started
    41     <th:block  th:text="${session.user.getName()}"></th:block>
     41    <th:block  th:text="${session.user?.getName()}"></th:block>
    4242  </h3>
    4343</div>
    44 
     44<div>
     45  <form method="get" th:action="@{'/adoption-posts'}">
     46    <button id="submit" type="submit">View Adoption posts</button>
     47  </form>
     48</div>
    4549</body>
    4650</html>
  • Prototype Application/Paw5/src/main/resources/templates/list-posts-adoption.html

    r9a180fd r3c7bf5b  
    77    <meta charset="UTF-8">
    88    <title>Adoption Posts</title>
     9    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     10    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
     11    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     12    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
     13
    914</head>
    1015<body>
     16<header>
     17    <nav class="navbar navbar-expand-md navbar-dark bg-dark">
     18        <div class="container">
     19            <a class="navbar-brand" href="/home">Paw 5</a>
     20            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault"
     21                    aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
     22                <span class="navbar-toggler-icon"></span>
     23            </button>
     24
     25            <div class="collapse navbar-collapse justify-content-end" id="navbarsExampleDefault">
     26                <ul class="navbar-nav m-auto">
     27                    <li class="nav-item m-auto">
     28                        <a class="nav-link active" href="/home/aboutUs">About us</a>
     29                    </li>
     30                    <li class="nav-item m-auto">
     31                        <a class="nav-link active" href="/login">Login</a>
     32                    </li>
     33                    <li class="nav-item m-auto">
     34                        <a class="nav-link active" href="/register">Register</a>
     35                    </li>
     36                </ul>
     37            </div>
     38        </div>
     39    </nav>
     40</header>
    1141<table>
    1242    <tr>
  • Prototype Application/Paw5/src/main/resources/templates/pet-details.html

    r9a180fd r3c7bf5b  
    77    <meta charset="UTF-8">
    88    <title>Title</title>
     9    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     10    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
     11    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     12    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
    913</head>
    1014<body>
     15<header>
     16    <nav class="navbar navbar-expand-md navbar-dark bg-dark">
     17        <div class="container">
     18            <a class="navbar-brand" href="/home">Paw 5</a>
     19            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault"
     20                    aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
     21                <span class="navbar-toggler-icon"></span>
     22            </button>
     23
     24            <div class="collapse navbar-collapse justify-content-end" id="navbarsExampleDefault">
     25                <ul class="navbar-nav m-auto">
     26                    <li class="nav-item m-auto">
     27                        <a class="nav-link active" href="/home/aboutUs">About us</a>
     28                    </li>
     29                    <li class="nav-item m-auto">
     30                        <a class="nav-link active" href="/login">Login</a>
     31                    </li>
     32                    <li class="nav-item m-auto">
     33                        <a class="nav-link active" href="/register">Register</a>
     34                    </li>
     35                </ul>
     36            </div>
     37        </div>
     38    </nav>
     39</header>
    1140<table>
    1241    <tr>
     
    3867    </tr>
    3968</table>
    40 <form method="POST" th:action="@{'/submit-adopton-{id}' (id=${session.pet.getId()})}" th:disabled="${session.pet.getAdoptionId()==null}">
     69<form method="POST" th:action="@{'/submit-adopton-{id}' (id=${session.pet.getId()})}" th:disabled="${session.disableAdoption}">
    4170    <button id="submit" type="submit">Adopt</button>
    4271</form>
Note: See TracChangeset for help on using the changeset viewer.