Mas retoques a busquedas, añadiendo mas buscquedas basicas, creando un boton de login y ajustando el h1 para que se ve mejor la pagina que se usa. Creando css para no repitir el mismo codigo en las listas y otros apartados. Incio de preparaciones de operaciones crud. Crando un nuevo controlador que dependiendo de que boton pulsas guarda texto y usa en el futuro para determinar con que modelo/tabla vas a trabajar
parent
d638d2321e
commit
626a595c23
@ -1,7 +0,0 @@
|
||||
package com.example.proyectofinal.controllers;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
//@RestController
|
||||
public class LogInController {
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.example.proyectofinal.controllers.editController;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/editMain")
|
||||
public class EditController {
|
||||
|
||||
@GetMapping
|
||||
public String editMain(){
|
||||
return "admin/editMain";
|
||||
}
|
||||
|
||||
@GetMapping("/FamiliaEdit")
|
||||
public String editFamilia(@RequestParam String text, Model model){
|
||||
model.addAttribute("text", text);
|
||||
return "admin/editMenu/edit_menu";
|
||||
}
|
||||
|
||||
@GetMapping("/{action}/{text}")
|
||||
public String editFamilia(@PathVariable String action, @PathVariable String text, Model model){
|
||||
System.out.println(text);
|
||||
model.addAttribute("text", text);
|
||||
switch(action) {
|
||||
case "crear":
|
||||
System.out.println("crear "+text);
|
||||
break;
|
||||
case "editar":
|
||||
System.out.println("editar "+text);
|
||||
break;
|
||||
case "borrar":
|
||||
System.out.println("borrar "+ text);
|
||||
break;
|
||||
}
|
||||
return "admin/editMenu/edit_menu";
|
||||
}
|
||||
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
package com.example.proyectofinal.controllers;
|
||||
package com.example.proyectofinal.controllers.searchController;
|
||||
|
||||
import com.example.proyectofinal.models.empresas.Contacto;
|
||||
import com.example.proyectofinal.models.empresas.Empresa;
|
||||
import com.example.proyectofinal.repositories.empresas.ContactoRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
@ -0,0 +1,27 @@
|
||||
package com.example.proyectofinal.controllers.searchController;
|
||||
|
||||
import com.example.proyectofinal.models.empresas.Ciclo;
|
||||
import com.example.proyectofinal.repositories.empresas.CicloRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/familia")
|
||||
public class FamiliaController {
|
||||
@Autowired
|
||||
private CicloRepository cicloRepository;
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public String getFamiliaById(@PathVariable Long id, Model model) {
|
||||
Set<Ciclo> cicloSet = new HashSet<>(cicloRepository.findCicloByFamiliaId(id));
|
||||
model.addAttribute("ciclos", cicloSet);
|
||||
return "/list/specific/list_familia_ciclo";
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package com.example.proyectofinal.controllers.searchController;
|
||||
|
||||
//@RestController
|
||||
public class LogInController {
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
.logout-button {
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
background-color: red;
|
||||
color: white;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
font-size: 20px;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
border-radius: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.back-button {
|
||||
width: 200px !important;
|
||||
height: 50px !important;
|
||||
font-size: 25px !important;
|
||||
margin-top: 100px;
|
||||
background-color: #007BFF;
|
||||
color: white;
|
||||
font-weight: bolder;
|
||||
border-radius: 5px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-family: Verdana, Geneva, Tahoma, sans-serif;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
text-decoration: underline;
|
||||
background-color: #007BFF;
|
||||
font-family: Verdana, Geneva, Tahoma, sans-serif;
|
||||
font-size: 50px;
|
||||
color: white;
|
||||
margin-top: 0;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
padding-top: 0;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
}
|
||||
.cell{
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.table {
|
||||
border: 1px solid black;
|
||||
height: 75vh;
|
||||
max-height: 100vh;
|
||||
overflow-y: auto;
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
.logout-button {
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
background-color: red;
|
||||
color: white;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
font-size: 20px;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
border-radius: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
text-decoration: underline;
|
||||
background-color: #007BFF;
|
||||
font-family: Verdana, Geneva, Tahoma, sans-serif;
|
||||
font-size: 50px;
|
||||
color: white;
|
||||
margin-top: 0;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
padding-top: 0;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
}
|
||||
.back-button {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 200px !important;
|
||||
height: 50px !important;
|
||||
font-size: 25px !important;
|
||||
margin-top: 100px;
|
||||
background-color: #007BFF;
|
||||
color: white;
|
||||
font-weight: bolder;
|
||||
border-radius: 5px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-family: Verdana, Geneva, Tahoma, sans-serif;
|
||||
}
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.opt_butn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link rel="stylesheet" type="text/css" th:href="@{/top_and_back.css}">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 th:text="${text}"><a href="/logout" class="logout-button"><i class="fas fa-door-open"></i></a></h1>
|
||||
<div>
|
||||
<a th:href="@{'/editMain/crear/' + ${text}}" class="opt_butn">Crear</a>
|
||||
<a th:href="@{'/editMain/editar/' + ${text}}" class="opt_butn">Editar</a>
|
||||
<a th:href="@{'/editMain/borrar/' + ${text}}" class="opt_butn">Borrar</a>
|
||||
</div>
|
||||
<a href="/buscador" class="back-button">Atras</a>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>CREAR FAMILIA</h1>
|
||||
<form action="/yourActionURL" method="post">
|
||||
<label for="name">Name:</label><br>
|
||||
<input type="text" id="name" name="name"><br>
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
<a href="/edit/editMain" class="back-button">Atras a Menu Administrador</a>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css">
|
||||
<link rel="stylesheet" type="text/css" th:href="@{/style.css}">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
|
||||
<h1>Listado de Ciclos<a href="/logout" class="logout-button"><i class="fas fa-door-open"></i></a></h1>
|
||||
<div class="table">
|
||||
<table class ="table table-hover table-responsive-xl">
|
||||
<thead class="thread-light">
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Nombre</th>
|
||||
<th>Familia</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="cell" th:each="ciclo :${ciclos}">
|
||||
<td>[[${ciclo.id}]]</td>
|
||||
<td>[[${ciclo.nombre}]]</td>
|
||||
<td>[[${ciclo.familia.nombre}]]</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<a href="/buscador" class="back-button"}} class="back-button">Atras</a>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css">
|
||||
<link rel="stylesheet" type="text/css" th:href="@{/style.css}">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
|
||||
<h1>Familias<a href="/logout" class="logout-button"><i class="fas fa-door-open"></i></a></h1>
|
||||
<div class="table">
|
||||
<table class ="table table-hover table-responsive-xl">
|
||||
<thead class="thread-light">
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Nombre</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="cell" th:each="familia :${familias}">
|
||||
<td>[[${familia.id}]]</td>
|
||||
<td><a th:href="@{/familia/{id}(id=${familia.id})}">[[${familia.nombre}]]</a></td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<a href="/buscador" class="back-button">Atras</a>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css">
|
||||
<link rel="stylesheet" type="text/css" th:href="@{/style.css}">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
|
||||
<h1>Listado de Ciclos<a href="/logout" class="logout-button"><i class="fas fa-door-open"></i></a></h1>
|
||||
<div class="table">
|
||||
<table class ="table table-hover table-responsive-xl">
|
||||
<thead class="thread-light">
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Nombre</th>
|
||||
<th>Familia</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="cell" th:each="ciclo :${ciclos}">
|
||||
<td>[[${ciclo.id}]]</td>
|
||||
<td>[[${ciclo.nombre}]]</td>
|
||||
<td>[[${ciclo.familia.nombre}]]</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<a th:href="@{/buscador/search(query=${session.query}, searchOption=${session.searchOption})}" class="back-button">Atras</a>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in new issue