no funcional

This commit is contained in:
Abraham 2021-04-10 14:36:59 +02:00
parent f3df2441aa
commit d574a048e3
14 changed files with 602 additions and 58 deletions

View file

@ -3,12 +3,18 @@ package org.springframework.cheapy.model;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "authorities")
public class Authorities{
public class Authorities extends BaseEntity{
@Id
/**
*
*/
private static final long serialVersionUID = 1L;
@NotNull
String username;
String authority;

View file

@ -0,0 +1,5 @@
package org.springframework.cheapy.model;
public enum Municipio {
sevilla,dosHermanas,carmona,bollullos,pilas,montellano,mairenaAljarafe,mairenaAlcor
}

View file

@ -5,20 +5,36 @@ import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import org.springframework.boot.context.properties.bind.DefaultValue;
import net.bytebuddy.implementation.bind.annotation.Default;
@Entity
@Table(name = "users")
public class User{
public class User extends BaseEntity{
@Id
/**
*
*/
private static final long serialVersionUID = 1L;
@NotBlank
private String username;
@NotBlank
private String password;
boolean enabled;
private static final long serialVersionUID = 1L;
private Boolean enabled;
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public String getUsername() {
return username;

View file

@ -2,11 +2,14 @@ package org.springframework.cheapy.model;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "usuarios")
@ -23,16 +26,12 @@ public class Usuario extends BaseEntity{
@NotBlank
private String apellidos;
@NotBlank
private String dni;
@NotBlank
private String direccion;
@NotBlank
//@Pattern(regexp = "([+][^0][\\d]{0,2})?[ ]?([(][\\d]{0,4}[)])?[ ]?([\\d]{6,10})$")
private String telefono;
@Enumerated(value = EnumType.STRING)
private Municipio municipio;
@Email
@NotBlank
private String email;
@ -57,13 +56,6 @@ public class Usuario extends BaseEntity{
this.apellidos = apellidos;
}
public String getDni() {
return dni;
}
public void setDni(String dni) {
this.dni = dni;
}
public String getDireccion() {
return direccion;
@ -73,12 +65,20 @@ public class Usuario extends BaseEntity{
this.direccion = direccion;
}
public String getTelefono() {
return telefono;
public Municipio getMunicipio() {
return municipio;
}
public void setTelefono(String telefono) {
this.telefono = telefono;
public void setMunicipio(Municipio municipio) {
this.municipio = municipio;
}
public User getUsuar() {
return usuar;
}
public void setUsuar(User usuar) {
this.usuar = usuar;
}
public String getEmail() {
@ -89,13 +89,6 @@ public class Usuario extends BaseEntity{
this.email = email;
}
public User getUser() {
return usuar;
}
public void setUser(User username) {
this.usuar = username;
}
}

View file

@ -1,8 +1,11 @@
package org.springframework.cheapy.repository;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.Repository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cheapy.model.Authorities;
public interface AuthoritiesRepository extends CrudRepository<Authorities, Integer>{
public interface AuthoritiesRepository extends Repository<Authorities, Integer>{
@Autowired
void save(Authorities authorities);
}

View file

@ -3,13 +3,18 @@ package org.springframework.cheapy.repository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.Repository;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cheapy.model.User;
import org.springframework.cheapy.model.Usuario;
public interface UserRepository extends CrudRepository<Usuario, String> {
public interface UserRepository extends Repository<User, Integer> {
@Query("SELECT u FROM User u WHERE username =:username")
@Transactional(readOnly = true)
User findByUsername(String username);
void save(User user);
}

View file

@ -0,0 +1,20 @@
package org.springframework.cheapy.repository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.Repository;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cheapy.model.User;
import org.springframework.cheapy.model.Usuario;
public interface UsuarioRepository extends Repository<Usuario, Integer> {
@Query("SELECT u FROM User u WHERE username =:username")
@Transactional(readOnly = true)
User findByUsername(String username);
void save(Usuario usuario);
}

View file

@ -28,10 +28,10 @@ import org.springframework.transaction.annotation.Transactional;
@Service
public class AuthoritiesService {
/*
private AuthoritiesRepository authoritiesRepository;
private UserService userService;
private AuthoritiesRepository authoritiesRepository;
// private UserService userService;
/*
@Autowired
public AuthoritiesService(AuthoritiesRepository authoritiesRepository,UserService userService) {
this.authoritiesRepository = authoritiesRepository;
@ -42,12 +42,12 @@ public class AuthoritiesService {
public Authorities findAuthoritiyByUser(User user) {
return this.authoritiesRepository.findByUser(user.getUsername());
}
*/
@Transactional
public void saveAuthorities(Authorities authorities) throws DataAccessException {
authoritiesRepository.save(authorities);
}
/*
@Transactional
public void saveAuthorities(String username, String role) throws DataAccessException {
Authorities authority = new Authorities();

View file

@ -1,6 +1,7 @@
package org.springframework.cheapy.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cheapy.model.FoodOffer;
import org.springframework.cheapy.model.User;
import org.springframework.cheapy.repository.UserRepository;
import org.springframework.dao.DataAccessException;
@ -25,5 +26,8 @@ public class UserService {
String username = authentication.getName();
return this.userRepository.findByUsername(username);
}
public void saveUser(final User user) throws DataAccessException {
this.userRepository.save(user);
}
}

View file

@ -0,0 +1,34 @@
package org.springframework.cheapy.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cheapy.model.FoodOffer;
import org.springframework.cheapy.model.User;
import org.springframework.cheapy.model.Usuario;
import org.springframework.cheapy.repository.UserRepository;
import org.springframework.cheapy.repository.UsuarioRepository;
import org.springframework.dao.DataAccessException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class UsuarioService {
private UsuarioRepository usuarioRepository;
@Autowired
public UsuarioService(final UsuarioRepository usuarioRepository) {
this.usuarioRepository = usuarioRepository;
}
// @Transactional
// public User getCurrentUser() throws DataAccessException {
// Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
// String username = authentication.getName();
// return this.userRepository.findByUsername(username);
// }
public void saveUsuario(final Usuario usuario) throws DataAccessException {
this.usuarioRepository.save(usuario);
}
}

View file

@ -0,0 +1,147 @@
package org.springframework.cheapy.system;
import java.util.Collection;
import java.util.Map;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cheapy.model.Authorities;
import org.springframework.cheapy.model.Municipio;
import org.springframework.cheapy.model.Owner;
import org.springframework.cheapy.model.User;
import org.springframework.cheapy.model.Usuario;
import org.springframework.cheapy.service.AuthoritiesService;
import org.springframework.cheapy.service.ClientService;
import org.springframework.cheapy.service.OwnerService;
import org.springframework.cheapy.service.UserService;
import org.springframework.cheapy.service.UsuarioService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class SingUpController {
//private static final String VIEWS_OWNER_CREATE_OR_UPDATE_FORM = "owners/createOrUpdateOwnerForm";
private final ClientService clientService;
private final UserService userService;
private final UsuarioService usuarioService;
private final AuthoritiesService authoritiesService;
public SingUpController(final ClientService clientService, UserService userService, AuthoritiesService authoritiesService,
UsuarioService usuarioService) {
this.clientService = clientService;
this.userService = userService;
this.authoritiesService = authoritiesService;
this.usuarioService = usuarioService;
}
@InitBinder
public void setAllowedFields(WebDataBinder dataBinder) {
dataBinder.setDisallowedFields("id");
}
@GetMapping("/users/new")
public String initCreationForm(Map<String, Object> model) {
Usuario usuario = new Usuario();
User user=new User();
usuario.setUsuar(user);
model.put("municipio", Municipio.values());
model.put("usuario", usuario);
//model.put("user", user);
return "singup/singUpUser";
}
@PostMapping("/users/new")
public String processCreationForm(/*@Valid User user,*/ @Valid Usuario usuario, BindingResult result) {
Authorities auth=new Authorities();
User user= usuario.getUsuar();
user.setEnabled(true);
usuario.setUsuar(user);
auth.setUsername(user.getUsername());
auth.setAuthority("usuario");
if (result.hasErrors()) {
return "singup/singUpUser";
}
else {
this.userService.saveUser(user);
this.usuarioService.saveUsuario(usuario);
this.authoritiesService.saveAuthorities(auth);
return "redirect:/";
}
}
// @GetMapping("/owners/find")
// public String initFindForm(Map<String, Object> model) {
// model.put("owner", new Owner());
// return "owners/findOwners";
// }
//
// @GetMapping("/owners")
// public String processFindForm(Owner owner, BindingResult result, Map<String, Object> model) {
//
// // allow parameterless GET request for /owners to return all records
// if (owner.getLastName() == null) {
// owner.setLastName(""); // empty string signifies broadest possible search
// }
//
// // find owners by last name
// Collection<Owner> results = this.ownerService.findByLastName(owner.getLastName());
// if (results.isEmpty()) {
// // no owners found
// result.rejectValue("lastName", "notFound", "not found");
// return "owners/findOwners";
// }
// else if (results.size() == 1) {
// // 1 owner found
// owner = results.iterator().next();
// return "redirect:/owners/" + owner.getId();
// }
// else {
// // multiple owners found
// model.put("selections", results);
// return "owners/ownersList";
// }
// }
//
// @GetMapping("/owners/{ownerId}/edit")
// public String initUpdateOwnerForm(@PathVariable("ownerId") int ownerId, Model model) {
// Owner owner = this.ownerService.findOwnerById(ownerId);
// model.addAttribute(owner);
// return VIEWS_OWNER_CREATE_OR_UPDATE_FORM;
// }
//
// @PostMapping("/owners/{ownerId}/edit")
// public String processUpdateOwnerForm(@Valid Owner owner, BindingResult result,
// @PathVariable("ownerId") int ownerId) {
// if (result.hasErrors()) {
// return VIEWS_OWNER_CREATE_OR_UPDATE_FORM;
// }
// else {
// owner.setId(ownerId);
// this.ownerService.saveOwner(owner);
// return "redirect:/owners/{ownerId}";
// }
// }
// @GetMapping("/owners/{ownerId}")
// public ModelAndView showOwner(@PathVariable("ownerId") int ownerId) {
// ModelAndView mav = new ModelAndView("owners/ownerDetails");
// Owner owner = this.ownerService.findOwnerById(ownerId);
//
// mav.addObject(owner);
// return mav;
// }
//
}

View file

@ -9,25 +9,25 @@ INSERT INTO owners VALUES (8, 'Maria', 'Escobito', '345 Maple St.', 'Madison', '
INSERT INTO owners VALUES (9, 'David', 'Schroeder', '2749 Blackhawk Trail', 'Madison', '6085559435');
INSERT INTO owners VALUES (10, 'Carlos', 'Estaban', '2335 Independence La.', 'Waunakee', '6085555487');
INSERT INTO users (dtype,username,password,enabled) VALUES ('User','admin','admin', TRUE );
INSERT INTO authorities VALUES ('admin','admin');
INSERT INTO users (dtype,id,username,password,enabled) VALUES ('User',1,'admin','admin', TRUE );
INSERT INTO authorities (id,username,authority) VALUES (1,'admin','admin');
INSERT INTO users (dtype,username,password,enabled) VALUES ('User','manoli','manoli', TRUE );
INSERT INTO authorities VALUES ('manoli','client');
INSERT INTO users (dtype,username,password,enabled) VALUES ('User','david','david', TRUE );
INSERT INTO authorities VALUES ('david','client');
INSERT INTO users (dtype,id,username,password,enabled) VALUES ('User',2,'manoli','manoli', TRUE );
INSERT INTO authorities (id,username,authority) VALUES (2,'manoli','client');
INSERT INTO users (dtype,id,username,password,enabled) VALUES ('User',3,'david','david', TRUE );
INSERT INTO authorities (id,username,authority) VALUES (3,'david','client');
INSERT INTO users (dtype,username,password,enabled) VALUES ('User','paco','paco', TRUE );
INSERT INTO authorities VALUES ('paco','usuario');
INSERT INTO users (dtype,username,password,enabled) VALUES ('User','lolo','lolo', TRUE );
INSERT INTO authorities VALUES ('lolo','usuario');
INSERT INTO users (dtype,username,password,enabled) VALUES ('User','pepe','pepe', TRUE );
INSERT INTO authorities VALUES ('pepe','usuario');
INSERT INTO users (dtype,id,username,password,enabled) VALUES ('User',4,'paco','paco', TRUE );
INSERT INTO authorities (id,username,authority) VALUES (4,'paco','usuario');
INSERT INTO users (dtype,id,username,password,enabled) VALUES ('User',5,'lolo','lolo', TRUE );
INSERT INTO authorities (id,username,authority) VALUES (5,'lolo','usuario');
INSERT INTO users (dtype,id,username,password,enabled) VALUES ('User',6,'pepe','pepe', TRUE );
INSERT INTO authorities (id,username,authority) VALUES (6,'pepe','usuario');
INSERT INTO usuarios VALUES (1, 'admin', 'admin', 'admin', 'C/admin', '000000000', 'admin@gmail.com','admin');
INSERT INTO usuarios VALUES (2, 'Paco', 'Naranjo', '21154416G', 'C/Esperanza', '666973647', 'Paco@gmail.com','paco');
INSERT INTO usuarios VALUES (3, 'Lolo', 'Lopez', '25486596L', 'C/Macarena', '690670547' ,'Lolo@gmail.com','lolo');
INSERT INTO usuarios VALUES (4, 'Pepe', 'Lopez', '12456776V', 'C/Macarena', '690670547', 'Pepe@gmail.com','pepe');
INSERT INTO usuarios (id, nombre, apellidos, direccion, municipio, email, username) VALUES (1, 'admin', 'admin', 'C/admin', 'carmona', 'admin@gmail.com','admin');
INSERT INTO usuarios (id, nombre, apellidos, direccion, municipio, email, username) VALUES (2, 'Paco', 'Naranjo', 'C/Esperanza', 'sevilla', 'Paco@gmail.com','paco');
INSERT INTO usuarios (id, nombre, apellidos, direccion, municipio, email, username) VALUES (3, 'Lolo', 'Lopez', 'C/Macarena', 'dosHermanas', 'Lolo@gmail.com','lolo');
INSERT INTO usuarios (id, nombre, apellidos, direccion, municipio, email, username) VALUES (4, 'Pepe', 'Lopez', 'C/Macarena', 'carmona', 'Pepe@gmail.com','pepe');
INSERT INTO clients (id, name, email, address, init, finish, telephone, description, code, food, username) VALUES (1,'bar manoli','manoli@gmail.com','C/Betis','10:00','22:00','608726190', 'description 1', 'code1', 'ESPAÑOLA','manoli');
INSERT INTO clients (id, name, email, address, init, finish, telephone, description, code, food, username) VALUES (2,'bar david','david@gmail.com','C/Sevilla','09:30','22:00','608726190', 'description 2', 'code2', 'americana','david');

View file

@ -0,0 +1,307 @@
<%@ page session="false" trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!-- %@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %-->
<style>
body {
font-family: "montserratregular", sans-serif;
height: 100%;
}
a {
color: #92badd;
display:inline-block;
text-decoration: none;
font-weight: 400;
}
h2 {
text-align: center;
font-size: 16px;
font-weight: 600;
text-transform: uppercase;
display:inline-block;
margin: 40px 8px 10px 8px;
color: #cccccc;
}
/* STRUCTURE */
.wrapper {
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
width: 100%;
min-height: 100%;
padding: 20px;
}
#formContent {
-webkit-border-radius: 10px 10px 10px 10px;
border-radius: 10px 10px 10px 10px;
background: #fff;
padding: 30px;
width: 90%;
max-width: 450px;
position: relative;
padding: 0px;
-webkit-box-shadow: 0 30px 60px 0 rgba(0,0,0,0.3);
box-shadow: 0 30px 60px 0 rgba(0,0,0,0.3);
text-align: center;
}
#formFooter {
background-color: #f6f6f6;
border-top: 1px solid #dce8f1;
padding: 25px;
text-align: center;
-webkit-border-radius: 0 0 10px 10px;
border-radius: 0 0 10px 10px;
}
/* TABS */
h2.inactive {
color: #cccccc;
}
h2.active {
color: #0d0d0d;
border-bottom: 2px solid #5fbae9;
}
/* FORM TYPOGRAPHY*/
input[type=button], input[type=submit], input[type=reset] {
background-color: #56baed;
border: none;
color: white;
padding: 15px 80px;
text-align: center;
text-decoration: none;
display: inline-block;
text-transform: uppercase;
font-size: 13px;
-webkit-box-shadow: 0 10px 30px 0 rgba(95,186,233,0.4);
box-shadow: 0 10px 30px 0 rgba(95,186,233,0.4);
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
margin: 5px 20px 40px 20px;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
input[type=button]:hover, input[type=submit]:hover, input[type=reset]:hover {
background-color: #39ace7;
}
input[type=button]:active, input[type=submit]:active, input[type=reset]:active {
-moz-transform: scale(0.95);
-webkit-transform: scale(0.95);
-o-transform: scale(0.95);
-ms-transform: scale(0.95);
transform: scale(0.95);
}
input[type=text], input[type=password] {
background-color: #f6f6f6;
border: none;
color: #0d0d0d;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 5px;
width: 85%;
border: 2px solid #f6f6f6;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
input[type=text]:focus {
background-color: #fff;
border-bottom: 2px solid #5fbae9;
}
input[type=text]:placeholder {
color: #cccccc;
}
/* ANIMATIONS */
/* Simple CSS3 Fade-in-down Animation */
.fadeInDown {
-webkit-animation-name: fadeInDown;
animation-name: fadeInDown;
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
@-webkit-keyframes fadeInDown {
0% {
opacity: 0;
-webkit-transform: translate3d(0, -100%, 0);
transform: translate3d(0, -100%, 0);
}
100% {
opacity: 1;
-webkit-transform: none;
transform: none;
}
}
@keyframes fadeInDown {
0% {
opacity: 0;
-webkit-transform: translate3d(0, -100%, 0);
transform: translate3d(0, -100%, 0);
}
100% {
opacity: 1;
-webkit-transform: none;
transform: none;
}
}
/* Simple CSS3 Fade-in Animation */
@-webkit-keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@-moz-keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.fadeIn {
opacity:0;
-webkit-animation:fadeIn ease-in 1;
-moz-animation:fadeIn ease-in 1;
animation:fadeIn ease-in 1;
-webkit-animation-fill-mode:forwards;
-moz-animation-fill-mode:forwards;
animation-fill-mode:forwards;
-webkit-animation-duration:1s;
-moz-animation-duration:1s;
animation-duration:1s;
}
.fadeIn.first {
-webkit-animation-delay: 0.4s;
-moz-animation-delay: 0.4s;
animation-delay: 0.4s;
}
.fadeIn.second {
-webkit-animation-delay: 0.6s;
-moz-animation-delay: 0.6s;
animation-delay: 0.6s;
}
.fadeIn.third {
-webkit-animation-delay: 0.8s;
-moz-animation-delay: 0.8s;
animation-delay: 0.8s;
}
.fadeIn.fourth {
-webkit-animation-delay: 1s;
-moz-animation-delay: 1s;
animation-delay: 1s;
}
/* Simple CSS3 Fade-in Animation */
.underlineHover:after {
display: block;
left: 0;
bottom: -10px;
width: 0;
height: 2px;
background-color: #56baed;
content: "";
transition: width 0.2s;
}
.underlineHover:hover {
color: #0d0d0d;
}
.underlineHover:hover:after{
width: 100%;
}
/* OTHERS */
*:focus {
outline: none;
}
#icon {
width:60%;
}
</style>
<cheapy:layout pageName="singUp">
<h2 style="text-align:center;padding:5px">
<fmt:message key="new"/><fmt:message key="user"/>
</h2>
<form:form modelAttribute="usuario" class="form-horizontal"
id="add-foodOffer-form">
<div class="form-group has-feedback">
<cheapy:inputField label="Nombre" placeholder="Ponga aqui su nombre"
name="nombre" />
<cheapy:inputField label="Apellidos" placeholder="Ponga aqui sus apellidos"
name="apellidos" />
<cheapy:inputField label="Direccion" placeholder="Ponga aqui su dirección"
name="direccion" />
<div class="form-group">
<label>Municipio: </label>
<select name="municipio">
<c:forEach items="${municipio}" var="entry">
<option value="${entry}">${entry}</option>
</c:forEach>
</select>
</div>
<cheapy:inputField label="Email" placeholder="Ponga aqui su email"
name="email" />
<cheapy:inputField label="Nombre de usuario" placeholder="Ponga aqui su nombre de usuario"
name="usuar.username" />
<cheapy:inputField label="Contraseña" placeholder="Ponga aqui su contraseña"
name="usuar.password" />
<input type="submit" class="fadeIn fourth" value="Registrarse">
</div>
</form:form>
</cheapy:layout>

View file

@ -63,6 +63,10 @@
<li><a href="<c:url value="/login" />">Iniciar sesión</a></li>
<!--<li><a href="<c:url value="/users/new" />">Register</a></li>-->
</sec:authorize>
<sec:authorize access="!isAuthenticated()">
<li><a href="<c:url value="/users/new" />">Registrarse</a></li>
<!--<li><a href="<c:url value="/users/new" />">Register</a></li>-->
</sec:authorize>
<sec:authorize access="isAuthenticated()">
<li class="dropdown"><a href="#" class="dropdown-toggle"
data-toggle="dropdown"> <span class="glyphicon glyphicon-user"></span>