Ignore:
Timestamp:
03/04/23 19:55:18 (16 months ago)
Author:
SazdovaEkaterina <sazdovaekaterina@…>
Branches:
main
Children:
33b9f30
Parents:
3c7bf5b (diff), f194b4e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge main into adopting-a-pet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Prototype Application/Paw5/src/main/resources/templates/create-post.html

    r3c7bf5b reac569a  
    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">
     
    77    <meta charset="UTF-8">
    88    <title>Create a post</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    <script>
     14        function addNewPet(addNewPetCheckBox){
     15
     16            if(addNewPetCheckBox.checked){
     17
     18                document.getElementById("name").disabled = false;
     19                document.getElementById("gender").disabled = false;
     20                document.getElementById("ageGroup").disabled = false;
     21                document.getElementById("size").disabled = false;
     22                document.getElementById("species").disabled = false;
     23                document.getElementById("breed").disabled = false;
     24                document.getElementById("imageUrl").disabled = false;
     25                document.getElementById("canBeFostered").disabled = false;
     26
     27                document.getElementById("petId").disabled = true;
     28            } else{
     29
     30                document.getElementById("name").disabled = true;
     31                document.getElementById("gender").disabled = true;
     32                document.getElementById("ageGroup").disabled = true;
     33                document.getElementById("size").disabled = true;
     34                document.getElementById("species").disabled = true;
     35                document.getElementById("breed").disabled = true;
     36                document.getElementById("imageUrl").disabled = true;
     37                document.getElementById("canBeFostered").disabled = true;
     38
     39                document.getElementById("petId").disabled = false;
     40
     41            }
     42        }
     43    </script>
    944</head>
    1045<body>
     46<header>
     47    <nav class="navbar navbar-expand-md navbar-dark bg-dark">
     48        <div class="container">
     49            <a class="navbar-brand" href="/home">Paw 5</a>
     50            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault"
     51                    aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
     52                <span class="navbar-toggler-icon"></span>
     53            </button>
     54
     55            <div class="collapse navbar-collapse justify-content-end" id="navbarsExampleDefault">
     56                <ul class="navbar-nav m-auto">
     57                    <li class="nav-item m-auto">
     58                        <a class="nav-link active" href="/home/aboutUs">About us</a>
     59                    </li>
     60                    <li class="nav-item m-auto">
     61                        <a class="nav-link active" href="/login">Login</a>
     62                    </li>
     63                    <li class="nav-item m-auto">
     64                        <a class="nav-link active" href="/register">Register</a>
     65                    </li>
     66                </ul>
     67            </div>
     68        </div>
     69    </nav>
     70</header>
    1171    <h1>Create post</h1>
    1272<form th:action="@{/submit-post}" method="post">
    1373
    1474    <div>
    15         <label for="pet">Selet pet:</label>
    16         <select id="pet">
     75        <label for="petId">Select pet:</label>
     76        <select id="petId" name="petId">
     77            <option
     78            th:each="pet :${pets}"
     79            th:text="${pet.getName()}"
     80            th:value="${pet.getId()}">
     81            </option>
    1782        </select>
    1883    </div>
    1984
    2085    <div>
    21         <label for="newpet">Add new pet:</label>
    22             <input id="newpet" name="newpet" placeholder="newpet" type="checkbox">
     86        <label for="newPetCheckbox">Add new pet:</label>
     87            <input id="newPetCheckbox" name="newPetCheckbox" type="checkbox" onclick="addNewPet(this)">
    2388    </div>
    2489
     
    2994               name="name"
    3095               class="form-control"
    31                placeholder="Enter name">
     96               placeholder="Enter name"
     97               disabled>
    3298    </div>
    3399
     
    36102        <select id="gender"
    37103                name="gender"
    38                 class="form-control">
     104                class="form-control"
     105                disabled>
    39106            <option value = "MALE">male</option>
    40107            <option value = "FEMALE">female</option>
     
    46113        <select id="ageGroup"
    47114                name="ageGroup"
    48                 class="form-control">
     115                class="form-control"
     116                disabled>
    49117            <option value = "YOUNG">young</option>
    50118            <option value = "ADULT">adult</option>
     
    57125        <select id="size"
    58126                name="size"
    59                 class="form-control">
     127                class="form-control"
     128                disabled>
    60129            <option value = "XSMALL">extra small</option>
    61130            <option value = "SMALL">small</option>
     
    70139        <select id="species"
    71140                name="species"
    72                 class="form-control">
     141                class="form-control"
     142                disabled>
    73143            <option value = "CAT">cat</option>
    74144            <option value = "DOG">dog</option>
     
    83153               name="breed"
    84154               class="form-control"
    85                placeholder="Enter breed" >
     155               placeholder="Enter breed"
     156               disabled>
    86157    </div>
    87158
     
    92163               name="imageUrl"
    93164               class="form-control"
    94                placeholder="Enter image URL">
     165               placeholder="Enter image URL"
     166               disabled>
    95167        <!-- <label for="upload">Image:</label>
    96168        <input id="upload" type="file" accept="image/*">
     
    104176               name="canBeFostered"
    105177               class="form-control"
    106                value=false>
     178               value=false
     179               disabled>
    107180    </div>
    108181
Note: See TracChangeset for help on using the changeset viewer.