diff --git a/.gitignore b/.gitignore index 2a4a9396ea1eb8adee3bb0b7f3ad788284a91820..13fefa98613de92425c6138e56563174a04a81ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1 @@ -# NetBeans specific # -/l2g4/nbproject/private/ -/l2g4/build/ -/l2g4/nbbuild/ -/l2g4/dist/ -/l2g4/nbdist/ -/l2g4/nbactions.xml -/l2g4/nb-configuration.xml -/l2g4/.jacocoverage - -# Class Files # -*.class - -# Package Files # -*.jar -*.war -*.ear \ No newline at end of file +/l2g4/dist/ \ No newline at end of file diff --git a/l2g4/build/web/WEB-INF/classes/controladores/addPropuesta.class b/l2g4/build/web/WEB-INF/classes/controladores/addPropuesta.class index f2861e8b94549f90929c475c89d8b001abea6ae9..c611019eccdc7b1c5d9374c2a5864d7177a4b167 100644 Binary files a/l2g4/build/web/WEB-INF/classes/controladores/addPropuesta.class and b/l2g4/build/web/WEB-INF/classes/controladores/addPropuesta.class differ diff --git a/l2g4/build/web/WEB-INF/classes/controladores/conexionServidor.class b/l2g4/build/web/WEB-INF/classes/controladores/conexionServidor.class index bae007292858dfa40b2c214499f62566d2c57186..99d9869286d1437f90fedf311b68d2980caa5d27 100644 Binary files a/l2g4/build/web/WEB-INF/classes/controladores/conexionServidor.class and b/l2g4/build/web/WEB-INF/classes/controladores/conexionServidor.class differ diff --git a/l2g4/build/web/WEB-INF/classes/controladores/index.class b/l2g4/build/web/WEB-INF/classes/controladores/index.class new file mode 100644 index 0000000000000000000000000000000000000000..7ecce1dc54b602dbabb0a5bb46f634de6bc493c6 Binary files /dev/null and b/l2g4/build/web/WEB-INF/classes/controladores/index.class differ diff --git a/l2g4/build/web/WEB-INF/classes/controladores/login.class b/l2g4/build/web/WEB-INF/classes/controladores/login.class index ec44619991cdfd50ef2c2f6666486826b58884e5..8f3ba0d1613cde22fda53bed80925d65266da049 100644 Binary files a/l2g4/build/web/WEB-INF/classes/controladores/login.class and b/l2g4/build/web/WEB-INF/classes/controladores/login.class differ diff --git a/l2g4/build/web/WEB-INF/classes/controladores/propuesta.class b/l2g4/build/web/WEB-INF/classes/controladores/propuesta.class index 97fd7ed8d1b96ee12495e8dd772f4c9c0f6134ed..a88d550e7505dda75c79406f336e6f0a3d4b799c 100644 Binary files a/l2g4/build/web/WEB-INF/classes/controladores/propuesta.class and b/l2g4/build/web/WEB-INF/classes/controladores/propuesta.class differ diff --git a/l2g4/build/web/WEB-INF/classes/controladores/user.class b/l2g4/build/web/WEB-INF/classes/controladores/user.class index a2e3aee5ef9b12a067ed9de06ddc7b5173e11149..fbaa980c77a17acf60e13af96cf4d623c4d45c1e 100644 Binary files a/l2g4/build/web/WEB-INF/classes/controladores/user.class and b/l2g4/build/web/WEB-INF/classes/controladores/user.class differ diff --git a/l2g4/build/web/WEB-INF/lib/AbsoluteLayout.jar b/l2g4/build/web/WEB-INF/lib/AbsoluteLayout.jar new file mode 100644 index 0000000000000000000000000000000000000000..ee023b600c027c1ff7917e3df7a2edad2fec36aa Binary files /dev/null and b/l2g4/build/web/WEB-INF/lib/AbsoluteLayout.jar differ diff --git a/l2g4/build/web/WEB-INF/lib/eclipselink.jar b/l2g4/build/web/WEB-INF/lib/eclipselink.jar new file mode 100644 index 0000000000000000000000000000000000000000..2b0a8104d5b584d63ab7880475671abfc13a7898 Binary files /dev/null and b/l2g4/build/web/WEB-INF/lib/eclipselink.jar differ diff --git a/l2g4/build/web/WEB-INF/lib/g4-prog-app-lab1.jar b/l2g4/build/web/WEB-INF/lib/g4-prog-app-lab1.jar new file mode 100644 index 0000000000000000000000000000000000000000..e83a27b7059ff21f274af069412dd6bacaf0e75c Binary files /dev/null and b/l2g4/build/web/WEB-INF/lib/g4-prog-app-lab1.jar differ diff --git a/l2g4/build/web/WEB-INF/lib/hibernate-jpa-2.1-api-1.0.0.Final.jar b/l2g4/build/web/WEB-INF/lib/hibernate-jpa-2.1-api-1.0.0.Final.jar new file mode 100644 index 0000000000000000000000000000000000000000..1bbbbb98061a577a2e64f39e06c26688c2220027 Binary files /dev/null and b/l2g4/build/web/WEB-INF/lib/hibernate-jpa-2.1-api-1.0.0.Final.jar differ diff --git a/l2g4/build/web/WEB-INF/lib/javaee-endorsed-api-7.0.jar b/l2g4/build/web/WEB-INF/lib/javaee-endorsed-api-7.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..7f2e96d0514d651bd3bf24dc9b86218600e77f0b Binary files /dev/null and b/l2g4/build/web/WEB-INF/lib/javaee-endorsed-api-7.0.jar differ diff --git a/l2g4/build/web/WEB-INF/lib/javax.persistence_2.1.0.v201304241213.jar b/l2g4/build/web/WEB-INF/lib/javax.persistence_2.1.0.v201304241213.jar new file mode 100644 index 0000000000000000000000000000000000000000..841d2e19b03423ad822c0a19b8838338559105bf Binary files /dev/null and b/l2g4/build/web/WEB-INF/lib/javax.persistence_2.1.0.v201304241213.jar differ diff --git a/l2g4/build/web/WEB-INF/lib/junit-4.12.jar b/l2g4/build/web/WEB-INF/lib/junit-4.12.jar new file mode 100644 index 0000000000000000000000000000000000000000..e703cdea282c704bf2aa42dc2da5d832f4be9918 Binary files /dev/null and b/l2g4/build/web/WEB-INF/lib/junit-4.12.jar differ diff --git a/l2g4/build/web/WEB-INF/lib/mysql-connector-java-5.1.23-bin.jar b/l2g4/build/web/WEB-INF/lib/mysql-connector-java-5.1.23-bin.jar new file mode 100644 index 0000000000000000000000000000000000000000..1f904143d35616209c204eda3f305f8115570ed4 Binary files /dev/null and b/l2g4/build/web/WEB-INF/lib/mysql-connector-java-5.1.23-bin.jar differ diff --git a/l2g4/build/web/WEB-INF/lib/org.eclipse.persistence.jpa.jpql_2.5.2.v20140319-9ad6abd.jar b/l2g4/build/web/WEB-INF/lib/org.eclipse.persistence.jpa.jpql_2.5.2.v20140319-9ad6abd.jar new file mode 100644 index 0000000000000000000000000000000000000000..001316b6b781d246fee4fbc48cfd70c62483d661 Binary files /dev/null and b/l2g4/build/web/WEB-INF/lib/org.eclipse.persistence.jpa.jpql_2.5.2.v20140319-9ad6abd.jar differ diff --git a/l2g4/build/web/css/header.css b/l2g4/build/web/css/header.css index fd779ab83d51e9c3088cb5054f08304dbaeb9cb5..43c99eea1c7debdc5ec597abad54691aa0df24d9 100644 --- a/l2g4/build/web/css/header.css +++ b/l2g4/build/web/css/header.css @@ -5,7 +5,7 @@ nav { box-shadow: 0 3px 2px 0 rgba(0,0,0,0.1), 0 1px 1px 0 rgba(0,0,0,0.11); - padding: 5px; + padding: 0px; background: #fff; border-bottom: solid 3px #333; display: flex; @@ -23,13 +23,19 @@ nav { margin: 5px; } /* Tools */ +.tools{ + justify-content: center; + align-items: center; + display: flex; + +} .tools > div { display: none; } .tools.search .search, .tools.logeado .logeado, .tools.Visitante .Visitante{ - display: block; + display: block; } /* Search */ .input-search { @@ -61,9 +67,10 @@ nav { white-space: nowrap; width: 100px; margin: 5px; + padding-right: 10px; } /* Visitante */ -.Visitante a{ +.tools a{ color: #999; font-weight: 300; margin: 5px; @@ -71,8 +78,9 @@ nav { outline: none; transition: all .2s; } -.Visitante a:hover{ +.tools a:hover{ text-decoration: none; color: #222; outline: none; + background: rgba(0,0,0,.02); } diff --git a/l2g4/build/web/css/style.css b/l2g4/build/web/css/style.css index fafc02a7367243cd6e254e62fb1f0ce7ca2be992..d39e76999ce828a2cae28ea3f3ce384ccfc7c579 100644 --- a/l2g4/build/web/css/style.css +++ b/l2g4/build/web/css/style.css @@ -34,4 +34,9 @@ body { position: fixed; bottom: 0; right: 10px; +} + +.msjNone{ + margin: 40px; + color: #999; } \ No newline at end of file diff --git a/l2g4/build/web/img/404.png b/l2g4/build/web/img/404.png new file mode 100644 index 0000000000000000000000000000000000000000..8cf5c77d29fb3f3ab3c858642bc6a0a609a71621 Binary files /dev/null and b/l2g4/build/web/img/404.png differ diff --git a/l2g4/build/web/img/bg.jpg b/l2g4/build/web/img/bg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e63595bd9d81c222b585985008a32c39974ebb69 Binary files /dev/null and b/l2g4/build/web/img/bg.jpg differ diff --git a/l2g4/build/web/img/upload.svg b/l2g4/build/web/img/upload.svg new file mode 100644 index 0000000000000000000000000000000000000000..fca84bc2be8febfb55b4ea7c998a66996a3ef260 --- /dev/null +++ b/l2g4/build/web/img/upload.svg @@ -0,0 +1 @@ +<svg aria-hidden="true" data-prefix="fas" data-icon="file-upload" class="svg-inline--fa fa-file-upload fa-w-12" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="currentColor" d="M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm65.18 216.01H224v80c0 8.84-7.16 16-16 16h-32c-8.84 0-16-7.16-16-16v-80H94.82c-14.28 0-21.41-17.29-11.27-27.36l96.42-95.7c6.65-6.61 17.39-6.61 24.04 0l96.42 95.7c10.15 10.07 3.03 27.36-11.25 27.36zM377 105L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128v-6.1c0-6.3-2.5-12.4-7-16.9z"></path></svg> \ No newline at end of file diff --git a/l2g4/build/web/js/app-ajax.js b/l2g4/build/web/js/app-ajax.js index 8157c907c1b2f3f4feae330326ff23ac7fd51d36..ebd7f62a58902505aa82220d199936617d3d66a6 100644 --- a/l2g4/build/web/js/app-ajax.js +++ b/l2g4/build/web/js/app-ajax.js @@ -31,17 +31,15 @@ $(document).ready(function () { }); - /* $('#btn-new-user').click(function () { - funcionNuevoUsaurio(); - });*/ - $("form").submit(function (event) { - - }); - + funcionAltaPerfil(); + }); + + $('#btn-new-propuesta').click(function () { + funcionAltaPropuesta(); + }); $("#img").change(function () { - if (this.files && this.files[0]) { var reader = new FileReader(); reader.onload = function (e) { @@ -76,7 +74,7 @@ function funcionAltaPerfil() { event.preventDefault(); var type = "POST"; var url = 'user'; - var cadena = $(this).serialize(); + var cadena = $(".form-usuario").serialize(); funcionMandaFormulario(type, url, cadena); } /* Cierre de Sesión ----------------------------------------------------------*/ @@ -140,7 +138,7 @@ function funcionAltaPropuesta() { event.preventDefault(); var type = "POST"; var url = 'propuesta'; - var cadena = $(this).serialize(); + var cadena = $(".form-usuario").serialize(); funcionMandaFormulario(type, url, cadena); } /* Registrar Colaboración a Propuesta ----------------------------------------*/ diff --git a/l2g4/build/web/page/index/index.jsp b/l2g4/build/web/page/index/index.jsp new file mode 100644 index 0000000000000000000000000000000000000000..9116e00157c6bb8bd3c582f5187c93b7c1135c58 --- /dev/null +++ b/l2g4/build/web/page/index/index.jsp @@ -0,0 +1,122 @@ +<%-- + Document : index + Created on : 12-oct-2018, 19:12:22 + Author : pecaa +--%> + +<%@page import="datatype.DtPropuesta"%> +<%@page import="java.util.ArrayList"%> +<%@page import="java.util.List"%> +<%@page import="datatype.DtProponente"%> +<%@page import="datatype.DtUsuario"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<% + String categorias = ""; + if (request.getAttribute("categorias") != null) { + categorias = (String) request.getAttribute("categorias"); + } +%> +<!DOCTYPE html> +<html lang="en" dir="ltr"> + <head> + <!-- Latest compiled and minified CSS --> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> + <!-- jQuery library --> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> + <!-- Popper JS --> + <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> + <!-- Bootstrap --> + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> + <!-- Fontawesome --> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> + <!-- Estilos --> + <link rel="stylesheet" href="./css/cards-propuesta.css"> + <link rel="stylesheet" href="./css/cards-usuario.css"> + <link rel="stylesheet" href="./css/footer.css"> + <link rel="stylesheet" href="./css/header.css"> + <link rel="stylesheet" href="./css/msg.css"> + <link rel="stylesheet" href="./css/pagination.css"> + <link rel="stylesheet" href="./css/style.css"> + <link rel="stylesheet" href="./css/title.css"> + <link rel="stylesheet" href="./css/form-propuesta.css"> + <link rel="stylesheet" href="./css/cards-seguir.css"> + + <!-- Script --> + <script src="./js/loder.js"></script> + <script src="./js/app-ajax.js"></script> + + <!-- MetaData --> + <title>Culturarte-G4</title> + <meta name="description" content="Web para el obligatorio 2"> + <meta name="keywords" content="HTML,CSS,JavaScript,jQuery,Popper,Bootstrap"> + <meta name="author" content="G-4"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta charset="utf-8"> + <style> + + header{ + background: url(./img/bg.jpg); + background-position: center; + padding: 40px; + } + .flex-column { + padding: 0px; + } + .tab-content { + padding: 20px; + } + .tab-content h1{ + margin-bottom: 10px; + color: #333; + text-align: center; + font-size: 24px; + } + .tab-content b{ + width: 100px; + display: inline-block; + } + + </style> + </head> + <body> + <%@include file="../nav.jspf" %> + <%@include file="../msg.jspf" %> + <header> + <h1 class="title">Encuntra tu pasion</h1> + <div class="d-flex justify-content-center"> + <form class="col-sm-12 col-md-4"> + <input class="form-control mr-sm-2 search" type="search" placeholder="Search" aria-label="Search"> + </form> + </div> + </header> + + <main role="main"> + <div class="album py-5 "> + <div class="container"> + <div class="row"> + <% if (categorias != null && categorias != "") {%> + <div class="col-md-8 col-sm-12 "> + <div class="row"> + <%@include file="main.jspf" %> + </div> + </div> + <div class="col-md-4 col-sm-12 "> + <h2 class="text-center">Categorioas</h2> + <div class="cat-box"> + <% out.print(categorias);%> + </div> + </div> + <% } else {%> + <div class="col-md-12 col-sm-12 "> + <div class="row"> + <%@include file="main.jspf" %> + </div> + </div> + <% }%> + </div> + </div> + </div> + </main> + + </body> +</html> diff --git a/l2g4/build/web/page/index/main.jspf b/l2g4/build/web/page/index/main.jspf new file mode 100644 index 0000000000000000000000000000000000000000..5c4600eea991ff8db357aa59725e2403d47c4fd5 --- /dev/null +++ b/l2g4/build/web/page/index/main.jspf @@ -0,0 +1,17 @@ +<%-- any content can be specified here e.g.: --%> +<%@page import="java.util.ArrayList"%> +<%@page import="java.util.List"%> +<%@page import="datatype.DtPropuesta"%> +<%@ page pageEncoding="UTF-8" %> +<% + String pruepuestas = null; + if (request.getAttribute("pruepuestas") != null) { + pruepuestas = (String) request.getAttribute("pruepuestas"); + } +%> + +<% if (pruepuestas != null && pruepuestas != "") {%> + <% out.print(pruepuestas); %> +<% } else {%> + <h1 class="text-center">No se encontraron propuestas</h1> +<% }%> \ No newline at end of file diff --git a/l2g4/build/web/page/login/login.jsp b/l2g4/build/web/page/login/login.jsp index 3732709d8893f5f8a15c380f72ec7eb31e71ed65..18013e56cc963beab21543d71e6434adab6afe60 100644 --- a/l2g4/build/web/page/login/login.jsp +++ b/l2g4/build/web/page/login/login.jsp @@ -49,7 +49,10 @@ <input type="text" id="loginNick" class="form-control" placeholder="Nick" required="" autofocus=""> <input type="password" id="loginPass" class="form-control" placeholder="Contraseña" required=""> <hr> - <input type="button" class="btn btn-primary" id="btn-login" value="Iniciar sesión"> + <div class="row"> + <input type="button" class="col btn btn-primary" id="btn-login" value="Iniciar sesión"> + <a class="col btn btn-primary" id="btn-login" href="/g4/addUser">Registrarse</a> + </div> </form> diff --git a/l2g4/build/web/page/nav.jspf b/l2g4/build/web/page/nav.jspf index a1b34995eb514f586275b9dc4a28c23910d7636b..38d02fd51d65c30dc095028dd4888af60213e30f 100644 --- a/l2g4/build/web/page/nav.jspf +++ b/l2g4/build/web/page/nav.jspf @@ -2,16 +2,12 @@ <%@ page pageEncoding="UTF-8" %> <!-- Nav --> <% - /* - String nameUser = (String)session.getAttribute("nameUser"); - String idUser = (String)session.getAttribute("userId"); - String imgUser = (String)session.getAttribute("imgUser"); - */ - String nameUser = "sdad"; - String idUser = "sdad"; - String imgUser = "sdad"; + + String nameUser = (String)session.getAttribute("userName"); + String imgUser = "data:image/jpeg;base64,"+(String)session.getAttribute("imgUser"); + String estado = "logeado"; - if (idUser == null){ + if (nameUser == null){ estado = "Visitante"; } %> @@ -21,12 +17,12 @@ </div> <div class="tools <% out.print( estado ); %>"> - <% if (idUser != null ) { %> + <% if (nameUser != null ) { %> <!-- User logeado--> + <a href="/g4/addPropuesta">Nueva Propuesta</a> <div class="logeado dropdown" data-toggle="dropdown" style="width: 150px; text-align: right;"> <ul class="dropdown-menu" role="menu"> - <a class="dropdown-item" href="#">Perfil</a> - <a class="dropdown-item" href="#">Favoritos</a> + <a class="dropdown-item" onclick="window.location='/g4/user?user=<% out.print( nameUser ); %>';" >Perfil</a> <a class="dropdown-item" id="btn-logout">Salir</a> </ul> <div class="dropdown-toggle" data-toggle="dropdown"> @@ -37,8 +33,8 @@ <% } else { %> <!-- Visitante --> <div class="Visitante"> - <a href="registro-usuario.html">Registrarse</a> - <a href="login.html">Loguearse</a> + <a href="addUser">Registrarse</a> + <a href="login">Loguearse</a> </div> <% } %> diff --git a/l2g4/build/web/page/propuesta/registro-propuesta.jsp b/l2g4/build/web/page/propuesta/registro-propuesta.jsp index 22f3dba20921c7bc1427d60bd310db58c2c11f11..7d1058e40cdf133d927fa69b0828295bd6efd204 100644 --- a/l2g4/build/web/page/propuesta/registro-propuesta.jsp +++ b/l2g4/build/web/page/propuesta/registro-propuesta.jsp @@ -4,189 +4,247 @@ Author : pecaa --%> +<%@page import="java.util.Date"%> +<%@page import="java.text.SimpleDateFormat"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> +<% + /* Para limitar la fecha minima de fechaPrevista */ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-M-dd"); + String date = sdf.format(new Date()); + + String categorias = ""; + if (request.getAttribute("categorias") != null) { + categorias = (String) request.getAttribute("categorias"); + } +%> <!DOCTYPE html> <html lang="en" dir="ltr"> - <head> - <!-- Latest compiled and minified CSS --> - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> - <!-- jQuery library --> - <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> - <!-- Popper JS --> - <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> - <!-- Latest compiled JavaScript --> - <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> - <!-- Estilos --> - <link rel="stylesheet" href="./css/cards-propuesta.css"> - <link rel="stylesheet" href="./css/cards-seguir.css"> - <link rel="stylesheet" href="./css/cards-usuario.css"> - <link rel="stylesheet" href="./css/footer.css"> - <link rel="stylesheet" href="./css/header.css"> - <link rel="stylesheet" href="./css/msg.css"> - <link rel="stylesheet" href="./css/pagination.css"> - <link rel="stylesheet" href="./css/style.css"> - <link rel="stylesheet" href="./css/title.css"> - <link rel="stylesheet" href="./css/form-propuesta.css"> - - - <!-- MetaData --> - <title>Culturarte-G4</title> - <meta name="description" content="Web para el obligatorio 2"> - <meta name="keywords" content="HTML,CSS,JavaScript,jQuery,Popper,Bootstrap"> - <meta name="author" content="G-4"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta charset="utf-8"> - <style> - - header{ - background: url(./img/gb-user.jpg); - } - .list-group-item { - user-select: none; - } - - .list-group input[type="checkbox"] { - display: none; - } - - .list-group input[type="checkbox"] + .list-group-item { - cursor: pointer; - } - - .list-group input[type="checkbox"] + .list-group-item:before { - content: "\2713"; - color: transparent; - font-weight: bold; - margin-right: 1em; - } - - .list-group input[type="checkbox"]:checked + .list-group-item { - background-color: #0275D8; - color: #FFF; - } - - .list-group input[type="checkbox"]:checked + .list-group-item:before { - color: inherit; - } - - .list-group input[type="radio"] { - display: none; - } - - - .list-group input[type="radio"]:checked + .list-group-item { - background-color: #0275D8; - color: #FFF; - } - - .list-group input[type="radio"]:checked + .list-group-item:before { - color: inherit; - } - </style> - </head> - <body> - - <%@include file="../nav.jspf" %> - <%@include file="../msg.jspf" %> - <%@include file="../loder.jspf" %> - <header> - <h1 class="title">Registro de usuario</h1> - </header> - <form class="form-usuario main retorno"> - <div class="progreso"> - <span></span> - <span></span> - <span></span> - </div> - <div class="page categoria"> - <h1>categoria</h1> - <select multiple class="form-control" id="exampleFormControlSelect1"> - <option>1</option> - <option>2</option> - <option>3</option> - <option>4</option> - <option>5</option> - </select> - <button class="btn btn-primary">Siginte</button> - </div> - <div class="page info"> - <h1>Información</h1> - - <div class="row"> - <div class="col-md-6 mb-3"> - <label for="titulo">Titulo</label> - <input type="text" class="form-control" id="titulo" placeholder="Titulo" value="" required=""> - <div class="invalid-feedback"> - El titulo no es válido. + <head> + <!-- Latest compiled and minified CSS --> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> + <!-- jQuery library --> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> + <!-- Popper JS --> + <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> + <!-- Latest compiled JavaScript --> + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> + <!-- Estilos --> + <link rel="stylesheet" href="./css/cards-propuesta.css"> + <link rel="stylesheet" href="./css/cards-seguir.css"> + <link rel="stylesheet" href="./css/cards-usuario.css"> + <link rel="stylesheet" href="./css/footer.css"> + <link rel="stylesheet" href="./css/header.css"> + <link rel="stylesheet" href="./css/msg.css"> + <link rel="stylesheet" href="./css/pagination.css"> + <link rel="stylesheet" href="./css/style.css"> + <link rel="stylesheet" href="./css/title.css"> + <link rel="stylesheet" href="./css/form-propuesta.css"> + + + <!-- MetaData --> + <title>Culturarte-G4</title> + <meta name="description" content="Web para el obligatorio 2"> + <meta name="keywords" content="HTML,CSS,JavaScript,jQuery,Popper,Bootstrap"> + <meta name="author" content="G-4"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta charset="utf-8"> + <style> + + header{ + background: url(./img/gb-user.jpg); + } + .list-group-item { + user-select: none; + } + + .list-group input[type="checkbox"] { + display: none; + } + + .list-group input[type="checkbox"] + .list-group-item { + cursor: pointer; + } + + .list-group input[type="checkbox"] + .list-group-item:before { + content: "\2713"; + color: transparent; + font-weight: bold; + margin-right: 1em; + } + + .list-group input[type="checkbox"]:checked + .list-group-item { + background-color: #0275D8; + color: #FFF; + } + + .list-group input[type="checkbox"]:checked + .list-group-item:before { + color: inherit; + } + + .list-group input[type="radio"] { + display: none; + } + + + .list-group input[type="radio"]:checked + .list-group-item { + background-color: #0275D8; + color: #FFF; + } + + .list-group input[type="radio"]:checked + .list-group-item:before { + color: inherit; + } + </style> + </head> + <body> + <script type="text/javascript"> + /* Formularios */ + function pasarPagina(newPage) { + switch (newPage) { + + case "categoria": + $('.form-usuario.main').prop("class", "form-usuario main " + newPage); + break; + case "info": + if ($("#categoria").val() == "") + alert("Selecciona la categoria."); + else + $('.form-usuario.main').prop("class", "form-usuario main " + newPage); + break; + case "retorno": + if ($("#descripcion").val() == "") { + alert("Es nesesario una descripcion."); + } else if ($("#titulo").val() == "") { + alert("Falta un titulo"); + } else if ($("#lugar").val() == "") { + alert("Falta un lugar"); + } else if ($("#precioEntrada").val() == "") { + alert("Cual es el precio de entrada"); + } else if ($("#fechaPrevista").val() == "") { + alert("Falta un fecha prevista"); + } else if ($("#montoNecesario").val() == "") { + alert("Cuanto quieres recolectar."); + } else { + $('.form-usuario.main').prop("class", "form-usuario main " + newPage); + } + break; + } + + } + </script> + <%@include file="../nav.jspf" %> + <%@include file="../msg.jspf" %> + <%@include file="../loder.jspf" %> + <form class="form-usuario main categoria"> + <input type="hidden" name="metodo" value="nuevo"> + <div class="progreso"> + <span></span> + <span></span> + <span></span> </div> - </div> - <div class="col-md-6 mb-3"> - <label for="lugar">Lugar</label> - <input type="text" class="form-control" id="lugar" placeholder="Lugar" value="" required=""> - <div class="invalid-feedback"> - El lugar no es válido. + <div class="page categoria"> + <h1>Categoria</h1> + <p>La categorai seleccionada sera de utilidad luego si algun colaborador lista por categorias</p> + <select multiple class="form-control" name="categoria" id="categoria"> + <% out.print(categorias);%> + </select> + <div style="display: flex;"> + <input type="button" class="btn btn-primary" onclick="pasarPagina('info')" value="Siguinte"> + </div> </div> - </div> - </div> - <div class="row"> - <div class="col-md-6 mb-3"> - <label for="precioEntrada">Precio entrada</label> - <input type="precioEntrada" class="form-control" id="precioEntrada" placeholder="10"> - <div class="invalid-feedback"> - El precio de entrada no es válido. - </div> + <div class="page info"> + <h1>Información</h1> + + <div class="row"> + <div class="col-md-6 mb-3"> + <label for="titulo">Titulo</label> + <input type="text" class="form-control" name="titulo" id="titulo" placeholder="Titulo" value="" required=""> + <div class="invalid-feedback"> + El titulo no es válido. + </div> + </div> + <div class="col-md-6 mb-3"> + <label for="lugar">Lugar</label> + <input type="text" class="form-control" name="lugar" id="lugar" placeholder="Lugar" value="" required=""> + <div class="invalid-feedback"> + El lugar no es válido. + </div> + </div> + </div> + <div class="row"> + <div class="col-md-6 mb-3"> + <label for="precioEntrada">Precio entrada</label> + <input min="0" type="number" name="precioEntrada" class="form-control" id="precioEntrada" placeholder="10"> + <div class="invalid-feedback"> + El precio de entrada no es válido. + </div> + </div> + <div class="col-md-6 mb-3"> + <label for="fechaPrevista">Fecha prevista</label> + <input min="<% out.print(date);%>" type="date" class="form-control" name="fechaPrevista" id="fechaPrevista" placeholder="Fecha prevista"> + <div class="invalid-feedback"> + La fecha prevista no es válida. + </div> + </div> + </div> + <div class="mb-3"> + <label for="montoNecesario">Monto necesario</label> + <div class="input-group"> + <input min="0" type="number" class="form-control" name="montoNecesario" id="montoNecesario" placeholder="1000000" required=""> + <div class="invalid-feedback" style="width: 100%;"> + El monto no es válido. + </div> + </div> + </div> + + <div class="mb-3"> + <label for="descripcion">Descripción</label> + <textarea + class="form-control" name="descripcion" id="descripcion" placeholder="Descripcion"></textarea> + <div class="invalid-feedback"> + La descripción no es válida. + </div> + </div> + + <div style="display: flex;"> + <input type="button" class="btn btn-primary" onclick="pasarPagina('categoria')" value="Atras"> + <input type="button" class="btn btn-primary" onclick="pasarPagina('retorno')" value="Siguinte"> + </div> </div> - <div class="col-md-6 mb-3"> - <label for="fechaPrevista">Fecha prevista</label> - <input type="datetime-datetime-local" class="form-control" id="fechaPrevista" placeholder="Fecha prevista"> - <div class="invalid-feedback"> - La fecha prevista no es válida. - </div> + <div class="page retorno"> + <h1>Retorno</h1> + <div class="form-check form-check-inline"> + <input class="form-check-input" type="radio" name="retorno" id="retornoEntrada" value="entrada"checked=""> + <label class="form-check-label" for="retornoEntrada">Entrada Gratis</label> + </div> + <p> + Se le entregara una entrada gratis a cada colaborador en tu proyecto. + </p> + <div class="form-check form-check-inline"> + <input class="form-check-input" type="radio" name="retorno" id="retornoPorsentaje" value="porsentaje" > + <label class="form-check-label" for="retornoPorsentaje">Porsentaje</label> + </div> + <p> + Darle un porsentaje de las ganancias. + </p> + + <div style="display: flex;"> + <input type="button" class="btn btn-primary" onclick="pasarPagina('info')" value="Atras"> + <input type="submit" class="btn btn-primary" id="btn-new-propuesta" value="Mandar"> + </div> </div> - </div> - <div class="mb-3"> - <label for="montoNecesario">Monto necesario</label> - <div class="input-group"> - <input type="text" class="form-control" id="montoNecesario" placeholder="1000000" required=""> - <div class="invalid-feedback" style="width: 100%;"> - El monto no es válido. - </div> - </div> - </div> - - <div class="mb-3"> - <label for="descripcion">Descripción</label> - <input type="datetime-datetime-local" class="form-control" id="descripcion" placeholder="Descripcion"> - <div class="invalid-feedback"> - La descripción no es válida. - </div> - </div> - - <button class="btn btn-primary">Siginte</button> - </div> - <div class="page retorno"> - <h1>Retorno</h1> - <div class="form-group"> - <label for="formControlRange">Porcentaje 10</label> - <input step="1" min="0" max="100" type="range" class="form-control-range" id="formControlRange"> - </div> - <div class="d-flex justify-content-center"> - <hr class="col-4"> - <span class="col-1"> O </span> - <hr class="col-4"> - </div> - <label for="exampleFormControlSelect1">Numero de entradas</label> - <select class="form-control" id="exampleFormControlSelect1"> - <option>1</option> - <option>2</option> - <option>3</option> - <option>4</option> - <option>5</option> - </select> - - <button class="btn btn-primary">Listo</button> - </div> - </form> - - </body> + </form> + + <!-- jQuery library --> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> + <!-- Popper JS --> + <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> + <!-- Latest compiled JavaScript --> + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> + <script src="./js/lib/moment.js"></script> + <script src="./js/lib/bootstrap-datetimepicker.js"></script> + <!-- Script --> + <script src="./js/loder.js"></script> + <script src="./js/app-ajax.js"></script> + </body> </html> diff --git a/l2g4/build/web/page/user/perfil-usuario.jsp b/l2g4/build/web/page/user/perfil-usuario.jsp index eb703e708bd77f29506533cfdce6127294966789..9021fb7bbc6c36ac4bc6f2cae3a7606ffef17f40 100644 --- a/l2g4/build/web/page/user/perfil-usuario.jsp +++ b/l2g4/build/web/page/user/perfil-usuario.jsp @@ -4,6 +4,7 @@ Author : pecaa --%> +<%@page import="java.util.Base64"%> <%@page import="datatype.DtPropuesta"%> <%@page import="java.util.ArrayList"%> <%@page import="java.util.List"%> @@ -11,188 +12,205 @@ <%@page import="datatype.DtUsuario"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <% - List<DtUsuario> seguidores = (ArrayList<DtUsuario>)request.getAttribute("seguidores"); - List<DtUsuario> sigo = (ArrayList<DtUsuario>)request.getAttribute("seguidores"); - List<DtPropuesta> pruepuestas = (ArrayList<DtPropuesta>)request.getAttribute("pruepuestas"); - DtProponente user = (DtProponente)request.getAttribute("perfiluser"); + List<DtUsuario> seguidores = (ArrayList<DtUsuario>) request.getAttribute("seguidores"); + List<DtUsuario> sigo = (ArrayList<DtUsuario>) request.getAttribute("sigo"); + List<DtPropuesta> Favoritos = (ArrayList<DtPropuesta>) request.getAttribute("Creo"); + List<DtPropuesta> Creo = (ArrayList<DtPropuesta>) request.getAttribute("Favoritos"); + Logica.datatype.DtUsuario user = (Logica.datatype.DtUsuario) request.getAttribute("perfiluser"); + String yo = (String) request.getAttribute("yo"); %> <!DOCTYPE html> <html lang="en" dir="ltr"> - <head> - <!-- Latest compiled and minified CSS --> - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> - <!-- jQuery library --> - <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> - <!-- Popper JS --> - <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> - <!-- Bootstrap --> - <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> - <!-- Fontawesome --> - <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> - <!-- Estilos --> - <link rel="stylesheet" href="./css/cards-propuesta.css"> - <link rel="stylesheet" href="./css/cards-usuario.css"> - <link rel="stylesheet" href="./css/footer.css"> - <link rel="stylesheet" href="./css/header.css"> - <link rel="stylesheet" href="./css/msg.css"> - <link rel="stylesheet" href="./css/pagination.css"> - <link rel="stylesheet" href="./css/style.css"> - <link rel="stylesheet" href="./css/title.css"> - <link rel="stylesheet" href="./css/form-propuesta.css"> - <link rel="stylesheet" href="./css/cards-seguir.css"> + <head> + <!-- Latest compiled and minified CSS --> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> + <!-- jQuery library --> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> + <!-- Popper JS --> + <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> + <!-- Bootstrap --> + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> + <!-- Fontawesome --> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> + <!-- Estilos --> + <link rel="stylesheet" href="./css/cards-propuesta.css"> + <link rel="stylesheet" href="./css/cards-usuario.css"> + <link rel="stylesheet" href="./css/footer.css"> + <link rel="stylesheet" href="./css/header.css"> + <link rel="stylesheet" href="./css/msg.css"> + <link rel="stylesheet" href="./css/pagination.css"> + <link rel="stylesheet" href="./css/style.css"> + <link rel="stylesheet" href="./css/title.css"> + <link rel="stylesheet" href="./css/form-propuesta.css"> + <link rel="stylesheet" href="./css/cards-seguir.css"> - <!-- Script --> - <script src="./js/loder.js"></script> - <script src="./js/app-ajax.js"></script> + <!-- Script --> + <script src="./js/loder.js"></script> + <script src="./js/app-ajax.js"></script> - <!-- MetaData --> - <title>Culturarte-G4</title> - <meta name="description" content="Web para el obligatorio 2"> - <meta name="keywords" content="HTML,CSS,JavaScript,jQuery,Popper,Bootstrap"> - <meta name="author" content="G-4"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta charset="utf-8"> - <style> + <!-- MetaData --> + <title>Culturarte-G4</title> + <meta name="description" content="Web para el obligatorio 2"> + <meta name="keywords" content="HTML,CSS,JavaScript,jQuery,Popper,Bootstrap"> + <meta name="author" content="G-4"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta charset="utf-8"> + <style> - header{ - background: url(./img/gb-user.jpg); - } - .flex-column { - padding: 0px; - } - .tab-content { - padding: 20px; - } - .tab-content h1{ - margin-bottom: 10px; - color: #333; - text-align: center; - font-size: 24px; - } - .tab-content b{ - width: 100px; - display: inline-block; - } - </style> - </head> - <body> - <%@include file="../nav.jspf" %> - <%@include file="../msg.jspf" %> - <header> - <h1 class="title">Registro de usuario</h1> - </header> - <form class="form-usuario container"> - <div class="row"> - <div class="col-8 main card "> - <div class="tab-content" id="v-pills-tabContent"> - <div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab"> - <h1>Información </h1> - <label><b>Nombre </b> <% out.print(user.getNombre()); %></label><br> - <label><b>Apellido </b> <% out.print(user.getApellido()); %></label><br> - <label><b>Web </b> <a href="#"><% out.print(user.getUrl()); %></a></label><br> - <label><b>Email </b> <% out.print(user.getEmail()); %></label><br> - <label><b>Descripción </b></label><br> - <p><% out.print(user.getBiografia()); %></p> - </div> - <div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab"> - <h1>Usuarios que sigo </h1> - <div class="box-cards-center"> - <% for (DtUsuario e : seguidores) {%> - <div class="cards-seguidor"> - <img class="user-creador" src="avatar.png"> - <div class="body"> - <h6><% out.print( e.getNombre() ); %></h6> - <button class="btn btn-desSeguir" data-user="<% out.print( e.getNick()); %>"> <i class="fas fa-times"></i> </button> - </div> + header{ + background: url(./img/gb-user.jpg); + } + .flex-column { + padding: 0px; + } + .tab-content { + padding: 20px; + } + .tab-content h1{ + margin-bottom: 10px; + color: #333; + text-align: center; + font-size: 24px; + } + .tab-content b{ + width: 100px; + display: inline-block; + } + </style> + </head> + <body> + <%@include file="../nav.jspf" %> + <%@include file="../msg.jspf" %> + <form class="form-usuario container"> + <div class="row"> + <div class="col-8 main card "> + <div class="tab-content" id="v-pills-tabContent"> + <%if (user != null) {%> + <div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab"> + <h1>Información </h1> + <label><b>Nombre </b> <% out.print(user.getNombre()); %></label><br> + <label><b>Apellido </b> <% out.print(user.getApellido()); %></label><br> + <label><b>Web </b> <a href="#"><% out.print(user.getUrl()); %></a></label><br> + <label><b>Email </b> <% out.print(user.getEmail()); %></label><br> + <label><b>Descripción </b></label><br> </div> - <% } %> - </div> - </div> - <div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab"> - <h1>Usuarios me siguen </h1> - <div class="box-cards-center"> - <% for (DtUsuario e : sigo) {%> - <div class="cards-seguidor"> - <img class="user-creador" src="avatar.png"> - <div class="body"> - <h1><% out.print( e.getNombre() ); %></h1> - </div> - </div> - <% } %> - </div> - - </div> - <div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab"> - - <div class="box-cards-center"> - - <% for (DtPropuesta e : pruepuestas) {%> - <!-- Cards propuestas para colaborador --> - <div class="cards-propuestas"> - <div class="body"> - <h1><% out.print( e.getTitulo() ); %></h1> - <p><% out.print( e.getDescripcion() ); %></p> - <span class="colaboracion"> - <b>Colaborasion: </b>$100 el 07/10/2018 - </span> - <div class="estado" data-estado="3"> - <div> - <span></span><span></span><span></span><span></span><span></span> - </div> + <% } %> + <div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab"> + <h1>Ususario seguidos</h1> + <div class="box-cards-center"> + <%if (seguidores != null && seguidores.size() > 0) {%> + <% for (DtUsuario e : seguidores) {%> + <div class="cards-seguidor"> + <img class="user-creador" src="avatar.png"> + <div class="body"> + <h6><% out.print(e.getNombre()); %></h6> + <button class="btn btn-desSeguir" data-user="<% out.print(e.getNick()); %>"> <i class="fas fa-times"></i> </button> + </div> + </div> + <% } %> + <% } else { %> + <h1>No se encontraron Segiuidores</h1> + <% } %> </div> - </div> - <div class="footer"> - <img class="user-creador" src="avatar.png"> - Usuario creador - </div> </div> - <% } %> - <% for (DtPropuesta e : pruepuestas) {%> - <!-- Cards propuestas para creador --> - <div class="cards-propuestas"> - <div class="body"> - <span class="total">54</span> - <h1><% out.print( e.getTitulo() ); %></h1> - <p><% out.print( e.getDescripcion() ); %></p> - <div class="estado" data-estado="2"> - <div> - <span></span><span></span><span></span><span></span><span></span> - </div> + <div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab"> + <h1>Usuarios me siguen </h1> + <div class="box-cards-center"> + <%if (sigo != null && sigo.size() > 0) {%> + <% for (DtUsuario e : sigo) {%> + <div class="cards-seguidor"> + <img class="user-creador" src="avatar.png"> + <div class="body"> + <h1><% out.print(e.getNombre()); %></h1> + </div> + </div> + <% } %> + <% } else { %> + <h1>No se encontraron Segiuidores</h1> + <% } %> </div> - </div> - <div class="footer"> - <button class="btn btn-primary btn-extender" data-user="<% out.print( e.getTitulo()); %>"> Extender </button> - <button class="btn btn-danger btn-cancelar" data-user="<% out.print( e.getTitulo()); %>"> Cancelar </button> - </div> </div> - <% } %> - + <div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab"> + <div class="box-cards-center"> + <%if (Favoritos != null) {%> + <% for (DtPropuesta e : Favoritos) {%> + <!-- Cards propuestas para colaborador --> + <div class="cards-propuestas"> + <div class="body"> + <h1><% out.print(e.getTitulo()); %></h1> + <p><% out.print(e.getDescripcion()); %></p> + <span class="colaboracion"> + <b>Colaborasion: </b>$100 el 07/10/2018 + </span> + <div class="estado" data-estado="3"> + <div> + <span></span><span></span><span></span><span></span><span></span> + </div> + </div> + </div> + <div class="footer"> + <img class="user-creador" src="avatar.png"> + Usuario creador + </div> + </div> + <% } %> + <% } else { %> + <h1>No se encontraron Segiuidores</h1> + <% } %> + <%if (Creo != null) {%> + <% for (DtPropuesta e : Creo) {%> + <!-- Cards propuestas para creador --> + <div class="cards-propuestas"> + <div class="body"> + <span class="total">54</span> + <h1><% out.print(e.getTitulo()); %></h1> + <p><% out.print(e.getDescripcion()); %></p> + <div class="estado" data-estado="2"> + <div> + <span></span><span></span><span></span><span></span><span></span> + </div> + </div> + </div> + <div class="footer"> + <button class="btn btn-primary btn-extender" data-user="<% out.print(e.getTitulo()); %>"> Extender </button> + <button class="btn btn-danger btn-cancelar" data-user="<% out.print(e.getTitulo()); %>"> Cancelar </button> + </div> + </div> + <% } %> + <% } else { %> + <h1>No se encontraron Segiuidores</h1> + <% } %> + </div> + </div> + </div> + </div> + <div class="col-4"> + <div class="card cards-usuario"> + <%if (user != null) {%> + <img class="user-creador" src="<% out.print("data:image/jpeg;base64,"+ Base64.getEncoder().encodeToString(user.getImg())); %>"> + <h6 class="user-type"><% out.print(user.getType()); %></h6> + <h1 class="user-name"><% out.print(user.getNick());%></h1> + <% }%> + <% if (yo != null && yo != user.getNick()) { %> + <button class="btn btn-primary btn-Seguir" data-user="<% out.print(user.getNick());%>">Seguir</button> + <% }%> + + </div> + <div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical"> + <a class="nav-link active" id="v-pills-home-tab" data-toggle="pill" href="#v-pills-home" role="tab" aria-controls="v-pills-home" aria-selected="true">Información</a> + <a class="nav-link" id="v-pills-profile-tab" data-toggle="pill" href="#v-pills-profile" role="tab" aria-controls="v-pills-profile" aria-selected="false">Segidores</a> + <a class="nav-link" id="v-pills-messages-tab" data-toggle="pill" href="#v-pills-messages" role="tab" aria-controls="v-pills-messages" aria-selected="false">Seguidos</a> + <a class="nav-link" id="v-pills-settings-tab" data-toggle="pill" href="#v-pills-settings" role="tab" aria-controls="v-pills-settings" aria-selected="false">Favoritos</a> + <a class="nav-link" id="v-pills-settings-tab" data-toggle="pill" href="#v-pills-settings" role="tab" aria-controls="v-pills-settings" aria-selected="false">Creación</a> + </div> </div> - - </div> </div> - </div> - <div class="col-4"> - <div class="card cards-usuario"> - <img class="user-creador" src="<% out.print(user.getImg()); %>"> - <h6 class="user-type"><% out.print(user.getType()); %></h6> - <h1 class="user-name"><% out.print(user.getNick()); %></h1> - </div> - <div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical"> - <a class="nav-link active" id="v-pills-home-tab" data-toggle="pill" href="#v-pills-home" role="tab" aria-controls="v-pills-home" aria-selected="true">Información</a> - <a class="nav-link" id="v-pills-profile-tab" data-toggle="pill" href="#v-pills-profile" role="tab" aria-controls="v-pills-profile" aria-selected="false">Segidores</a> - <a class="nav-link" id="v-pills-messages-tab" data-toggle="pill" href="#v-pills-messages" role="tab" aria-controls="v-pills-messages" aria-selected="false">Seguidos</a> - <a class="nav-link" id="v-pills-settings-tab" data-toggle="pill" href="#v-pills-settings" role="tab" aria-controls="v-pills-settings" aria-selected="false">Favoritos</a> - <a class="nav-link" id="v-pills-settings-tab" data-toggle="pill" href="#v-pills-settings" role="tab" aria-controls="v-pills-settings" aria-selected="false">Creación</a> - </div> - </div> - </div> - </form> + </form> - </body> + </body> </html> diff --git a/l2g4/build/web/page/user/perfil-usuario_no_encontrado.jsp b/l2g4/build/web/page/user/perfil-usuario_no_encontrado.jsp index 858bd327115c7d963977f063db8ffadfee1516f1..d251ce30be1115b08ed82308de7d7258ff8dfdb3 100644 --- a/l2g4/build/web/page/user/perfil-usuario_no_encontrado.jsp +++ b/l2g4/build/web/page/user/perfil-usuario_no_encontrado.jsp @@ -11,81 +11,81 @@ <%@page import="datatype.DtUsuario"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <% - List<DtUsuario> seguidores = (ArrayList<DtUsuario>)request.getAttribute("seguidores"); - List<DtUsuario> sigo = (ArrayList<DtUsuario>)request.getAttribute("seguidores"); - List<DtPropuesta> pruepuestas = (ArrayList<DtPropuesta>)request.getAttribute("pruepuestas"); - DtProponente user = (DtProponente)request.getAttribute("perfiluser"); + List<DtUsuario> seguidores = (ArrayList<DtUsuario>) request.getAttribute("seguidores"); + List<DtUsuario> sigo = (ArrayList<DtUsuario>) request.getAttribute("seguidores"); + List<DtPropuesta> pruepuestas = (ArrayList<DtPropuesta>) request.getAttribute("pruepuestas"); + DtProponente user = (DtProponente) request.getAttribute("perfiluser"); %> <!DOCTYPE html> <html lang="en" dir="ltr"> - <head> - <!-- Latest compiled and minified CSS --> - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> - <!-- jQuery library --> - <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> - <!-- Popper JS --> - <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> - <!-- Bootstrap --> - <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> - <!-- Fontawesome --> - <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> - <!-- Estilos --> - <link rel="stylesheet" href="./css/cards-propuesta.css"> - <link rel="stylesheet" href="./css/cards-usuario.css"> - <link rel="stylesheet" href="./css/footer.css"> - <link rel="stylesheet" href="./css/header.css"> - <link rel="stylesheet" href="./css/msg.css"> - <link rel="stylesheet" href="./css/pagination.css"> - <link rel="stylesheet" href="./css/style.css"> - <link rel="stylesheet" href="./css/title.css"> - <link rel="stylesheet" href="./css/form-propuesta.css"> - <link rel="stylesheet" href="./css/cards-seguir.css"> + <head> + <!-- Latest compiled and minified CSS --> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> + <!-- jQuery library --> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> + <!-- Popper JS --> + <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> + <!-- Bootstrap --> + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> + <!-- Fontawesome --> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> + <!-- Estilos --> + <link rel="stylesheet" href="./css/cards-propuesta.css"> + <link rel="stylesheet" href="./css/cards-usuario.css"> + <link rel="stylesheet" href="./css/footer.css"> + <link rel="stylesheet" href="./css/header.css"> + <link rel="stylesheet" href="./css/msg.css"> + <link rel="stylesheet" href="./css/pagination.css"> + <link rel="stylesheet" href="./css/style.css"> + <link rel="stylesheet" href="./css/title.css"> + <link rel="stylesheet" href="./css/form-propuesta.css"> + <link rel="stylesheet" href="./css/cards-seguir.css"> - <!-- Script --> - <script src="./js/loder.js"></script> - <script src="./js/app-ajax.js"></script> + <!-- Script --> + <script src="./js/loder.js"></script> + <script src="./js/app-ajax.js"></script> - <!-- MetaData --> - <title>Culturarte-G4</title> - <meta name="description" content="Web para el obligatorio 2"> - <meta name="keywords" content="HTML,CSS,JavaScript,jQuery,Popper,Bootstrap"> - <meta name="author" content="G-4"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta charset="utf-8"> - <style> + <!-- MetaData --> + <title>Culturarte-G4</title> + <meta name="description" content="Web para el obligatorio 2"> + <meta name="keywords" content="HTML,CSS,JavaScript,jQuery,Popper,Bootstrap"> + <meta name="author" content="G-4"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta charset="utf-8"> + <style> - header{ - background: url(./img/gb-user.jpg); - } - .flex-column { - padding: 0px; - } - .tab-content { - padding: 20px; - } - .tab-content h1{ - margin-bottom: 10px; - color: #333; - text-align: center; - font-size: 24px; - } - .tab-content b{ - width: 100px; - display: inline-block; - } - </style> - </head> - <body> - <%@include file="../nav.jspf" %> - <%@include file="../msg.jspf" %> - <section> - <img class="text-center svg" src="./img/noEncontrado.svg"> - </section> - <header> - <h1 class="title">No se encontro el usuario</h1> - </header> - <p class="text-center m-5">El usuario al que desea acceder no se encuntra disponible.</p> - </body> + header{ + background: url(./img/noEncontrado.svg); + background-position: bottom; + background-repeat: no-repeat; + padding: 50px; + background-color: indianred; + } + .flex-column { + padding: 0px; + } + .tab-content { + padding: 20px; + } + .tab-content h1{ + margin-bottom: 10px; + color: #333; + text-align: center; + font-size: 24px; + } + .tab-content b{ + width: 100px; + display: inline-block; + } + </style> + </head> + <body> + <%@include file="../nav.jspf" %> + <%@include file="../msg.jspf" %> + <header> + <h1 class="title">No se encontro el usuario</h1> + </header> + </body> </html> diff --git a/l2g4/build/web/page/user/registro-usuario.jsp b/l2g4/build/web/page/user/registro-usuario.jsp index 24030fff014681c2e0236a55d238ceb14f11ca3b..f9ae87cb14c47dc4a8346829accd51fda4f633bd 100644 --- a/l2g4/build/web/page/user/registro-usuario.jsp +++ b/l2g4/build/web/page/user/registro-usuario.jsp @@ -10,7 +10,7 @@ <head> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> - + <!-- Estilos --> <link rel="stylesheet" href="./css/cards-propuesta.css"> <link rel="stylesheet" href="./css/cards-seguir.css"> @@ -41,7 +41,15 @@ <script type="text/javascript"> /* Formularios */ function pasarPagina(newPage) { - $('.form-usuario.main').prop("class", "form-usuario main " + newPage); + if (newPage == "img" && ($("#nombre").val() == "" || + $("#apellido").val() == "" || + $("#email").val() == "" || + $("#fnac").val() == "" || + $("#nick").val() == "" )) { + alert("Faltan campos requeridos"); + } else { + $('.form-usuario.main').prop("class", "form-usuario main " + newPage); + } } function typeUser() { if (document.getElementById("typeProponente").checked) { @@ -56,10 +64,7 @@ <body> <%@include file="../nav.jspf" %> <%@include file="../msg.jspf" %> - - <header> - <h1 class="title">Registro de usuario</h1> - </header> + <br> <form class="form-usuario main type"> <input type="hidden" name="metodo" value="NuevoUsuario"> <div class="progreso"> @@ -87,7 +92,6 @@ </div> <div class="page info"> <h1>Información</h1> - <div class="row"> <div class="col-md-6 mb-3"> <label for="nombre">Nombre</label> @@ -161,8 +165,8 @@ <h1>Imagen</h1> <p>La imagen no es obligatoria</p> <div class="marco-img"> - <img id="img-prev" src="avatar.png" name="img"> - <input id="img" type="file"> + <img id="img-prev" src="./img/upload.svg" name="img"> + <input id="img" type="file" onchange="document.getElementById('img-prev').src = this.value"> </div> <div style="display: flex;"> <input type="button" class="btn btn-primary" onclick="pasarPagina('info')" value="Atras"> @@ -170,7 +174,7 @@ </div> </div> </form> - + <!-- jQuery library --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <!-- Popper JS --> @@ -179,8 +183,8 @@ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> <script src="./js/lib/moment.js"></script> <script src="./js/lib/bootstrap-datetimepicker.js"></script> - <!-- Script + <!-- Script --> <script src="./js/loder.js"></script> - <script src="./js/app-ajax.js"></script>--> + <script src="./js/app-ajax.js"></script> </body> </html> \ No newline at end of file diff --git a/l2g4/nbproject/private/private.xml b/l2g4/nbproject/private/private.xml index 4027868bc36513e2a5ce593be9862efa02b235e1..1fb2903160146eda475d8d2a224a6f03f472e640 100644 --- a/l2g4/nbproject/private/private.xml +++ b/l2g4/nbproject/private/private.xml @@ -3,13 +3,9 @@ <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> <group> - <file>file:/C:/tecnologo/Lab2/lab2-prog-app/l2g4/web/META-INF/web.xml</file> <file>file:/C:/tecnologo/Lab2/lab2-prog-app/l2g4/web/META-INF/context.xml</file> <file>file:/C:/tecnologo/Lab2/lab2-prog-app/l2g4/src/java/controladores/index.java</file> - <file>file:/C:/tecnologo/Lab2/lab2-prog-app/l2g4/web/page/error.jsp</file> - <file>file:/C:/tecnologo/Lab2/lab2-prog-app/l2g4/web/index.html</file> - <file>file:/C:/tecnologo/Lab2/lab2-prog-app/l2g4/src/java/META-INF/persistence.xml</file> - <file>file:/C:/tecnologo/Lab2/lab2-prog-app/l2g4/src/conf/MANIFEST.MF</file> + <file>file:/C:/tecnologo/Lab2/lab2-prog-app/l2g4/src/java/controladores/login.java</file> </group> </open-files> </project-private> diff --git a/l2g4/src/java/controladores/addPropuesta.java b/l2g4/src/java/controladores/addPropuesta.java index 4b659410ab8c3d285f97f4d617e5b393b67b784d..112266fccfb0d5a48a7a2a301b49df2d92297c47 100644 --- a/l2g4/src/java/controladores/addPropuesta.java +++ b/l2g4/src/java/controladores/addPropuesta.java @@ -9,6 +9,7 @@ import Logica.*; import datatype.DtPropuesta; import java.io.IOException; import java.io.PrintWriter; +import java.util.List; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; @@ -48,43 +49,27 @@ public class addPropuesta extends HttpServlet { } - // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> - /** - * Handles the HTTP <code>GET</code> method. - * - * @param request servlet request - * @param response servlet response - * @throws ServletException if a servlet-specific error occurs - * @throws IOException if an I/O error occurs - */ + @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - processRequest(request, response); + + List<String> ListCategorias = conexionServidor.listarCatergorias(); + String categorias = ""; + for (String e : ListCategorias) { + categorias+= "<option value='"+e+"'>"+e+"</option>"; + } + request.setAttribute("categorias", categorias); + + response.setContentType("text/html;charset=UTF-8"); + RequestDispatcher dispatsh = request.getRequestDispatcher("page/propuesta/registro-propuesta.jsp"); + dispatsh.forward(request, response); } - /** - * Handles the HTTP <code>POST</code> method. - * - * @param request servlet request - * @param response servlet response - * @throws ServletException if a servlet-specific error occurs - * @throws IOException if an I/O error occurs - */ + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } - - /** - * Returns a short description of the servlet. - * - * @return a String containing servlet description - */ - @Override - public String getServletInfo() { - return "Short description"; - }// </editor-fold> - } diff --git a/l2g4/src/java/controladores/conexionServidor.java b/l2g4/src/java/controladores/conexionServidor.java index f9283f12941b117b26f0ea9d25c88b22ef1835db..4f9851896ec852623cd827e984c3f829aa397277 100644 --- a/l2g4/src/java/controladores/conexionServidor.java +++ b/l2g4/src/java/controladores/conexionServidor.java @@ -7,23 +7,51 @@ package controladores; import Logica.Factory; import Logica.ISistema; +import Logica.datatype.DtPropuesta; +import datatype.DtUsuario; +import java.util.List; /** * * @author Lucas */ public class conexionServidor { + private static ISistema sys = null; public conexionServidor(){ - ISistema sys = null; sys = Factory.getInstance(); } public String seguirUsuario(String nickUsu, String nickUsuSeguir){ - return seguirUsuario(nickUsu, nickUsuSeguir); + sys = Factory.getInstance(); + return sys.seguirUsuario(nickUsu, nickUsuSeguir); } public String dejarSeguirUsuario(String nickUsu, String nickUsuDejarSeguir){ - return dejarSeguirUsuario(nickUsu,nickUsuDejarSeguir); + sys = Factory.getInstance(); + return sys.dejarDeSeguirUsuario(nickUsu, nickUsuDejarSeguir); + } + + public List<Logica.datatype.DtUsuario> lista_usuarios(){ + sys = Factory.getInstance(); + return sys.obtenerUsuarios(); + } + + public static List<String> listarCatergorias(){ + sys = Factory.getInstance(); + return sys.listarCatergorias(); + } + + public static List<DtPropuesta> listarPropuestas(){ + sys = Factory.getInstance(); + return sys.listarPropuestas(); + } + + public static List<DtPropuesta> listarPropuestasPorCategoria(String categoria){ + sys = Factory.getInstance(); + return sys.listarPropuestasPorCategoria(categoria); } + + + } diff --git a/l2g4/src/java/controladores/index.java b/l2g4/src/java/controladores/index.java index 7b69df471f2a7f9ee28a2ccb9c15c8d3fb686904..deec913cc189c42580e687bd9897ffc3fa50e127 100644 --- a/l2g4/src/java/controladores/index.java +++ b/l2g4/src/java/controladores/index.java @@ -7,8 +7,11 @@ package controladores; import Logica.Factory; import Logica.ISistema; +import Logica.Sistema; +import datatype.DtPropuesta; import java.io.IOException; import java.io.PrintWriter; +import java.util.ArrayList; import java.util.List; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; @@ -22,7 +25,7 @@ import javax.servlet.http.HttpSession; * * @author pecaa */ -@WebServlet(name = "index", urlPatterns = {"/*"}) +@WebServlet(name = "index", urlPatterns = {""}) public class index extends HttpServlet { /** @@ -36,45 +39,45 @@ public class index extends HttpServlet { */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - + HttpSession session = request.getSession(); String categoria = request.getParameter("categoria"); - ISistema sys = Factory.getInstance(); List<Logica.datatype.DtPropuesta> Listpruepuestas = null; - if (categoria == null) { - Listpruepuestas = sys.listarPropuestas(); - } else { - Listpruepuestas = sys.listarPropuestasPorCategoria(categoria); + if (categoria == null){ + Listpruepuestas = conexionServidor.listarPropuestas(); + }else{ + Listpruepuestas = conexionServidor.listarPropuestasPorCategoria(categoria); } - + String propuestas = ""; for (Logica.datatype.DtPropuesta e : Listpruepuestas) { - propuestas += "<a class='col-md-4' href='/g4/propuesta?propuesta=" + e.getTitulo() + "'>" - + "<div class='card mb-4 shadow-sm'>" - + " <img class='card-img-top' onerror=\"this.src='./img/404.png'\" style='height: 225px; width: 100%; display: block;' src='" + e.getImagen() + "' data-holder-rendered='true'>" - + " <div class='card-body'>" - + " <p class='card-text'>" + e.getTitulo() + "</p>" - + " <p>" + e.getDescripcion() + "</p>" - + " <div class='d-flex justify-content-between align-items-center'>" - + " <small class='text-muted'></small>" - + " </div>" - + " </div>" - + "</div>" - + "</a>"; + propuestas += "<a class='col-md-4' href='/g4/propuesta?propuesta="+e.getTitulo()+"'>" + + "<div class='card mb-4 shadow-sm'>" + + " <img class='card-img-top' onerror=\"this.src='./img/404.png'\" style='height: 225px; width: 100%; display: block;' src='"+ e.getImagen()+"' data-holder-rendered='true'>" + + " <div class='card-body'>" + + " <p class='card-text'>"+e.getTitulo()+"</p>" + + " <p>"+e.getDescripcion() +"</p>" + + " <div class='d-flex justify-content-between align-items-center'>" + + " <small class='text-muted'></small>" + + " </div>" + + " </div>" + + "</div>" + + "</a>"; } request.setAttribute("pruepuestas", propuestas); - - List<String> ListCategorias = sys.listarCatergorias(); + + List<String> ListCategorias = conexionServidor.listarCatergorias(); String categorias = ""; for (String e : ListCategorias) { - categorias += "<a class='cot' href='?categoria=" + e + "'>" + e + "</a>"; + categorias+= "<a class='cot' href='?categoria="+e+"'>" + e + "</a>"; } request.setAttribute("categorias", categorias); - + response.setContentType("text/html;charset=UTF-8"); RequestDispatcher dispatsh = request.getRequestDispatcher("page/index/index.jsp"); dispatsh.forward(request, response); + } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> @@ -89,13 +92,7 @@ public class index extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - try { - processRequest(request, response); - } catch (Exception e) { - response.setContentType("text/html;charset=UTF-8"); - RequestDispatcher dispatsh = request.getRequestDispatcher("page/error.jsp"); - dispatsh.forward(request, response); - } + processRequest(request, response); } /** @@ -109,13 +106,7 @@ public class index extends HttpServlet { @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - try { - processRequest(request, response); - } catch (Exception e) { - response.setContentType("text/html;charset=UTF-8"); - RequestDispatcher dispatsh = request.getRequestDispatcher("page/error.jsp"); - dispatsh.forward(request, response); - } + processRequest(request, response); } /** diff --git a/l2g4/src/java/controladores/login.java b/l2g4/src/java/controladores/login.java index ddec93d901af1813f177367657ecb1854f03083a..be2bb7652e36ea4efba76838f02d0d10f673c295 100644 --- a/l2g4/src/java/controladores/login.java +++ b/l2g4/src/java/controladores/login.java @@ -17,6 +17,7 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import datatype.DtUsuario; import datatype.respuesta; +import java.util.Base64; /** * @@ -33,7 +34,9 @@ public class login extends HttpServlet { if (session.getAttribute("userId") != null){ response.sendRedirect(request.getContextPath()); }else{ - processRequest(request, response); + response.setContentType("text/html;charset=UTF-8"); + RequestDispatcher dispatsh = request.getRequestDispatcher("page/login/login.jsp"); + dispatsh.forward(request, response); } } @@ -127,6 +130,7 @@ public class login extends HttpServlet { private String login(HttpServletRequest request){ String userName = getParameter(request,"userName"); String userPass = getParameter(request,"userPass"); + Logica.datatype.DtUsuario u = null; if (userName == null || "".equals(userName)){ return "Contraseña es nesecaria"; }else if ( userPass == null || "".equals(userPass)) { @@ -135,11 +139,18 @@ public class login extends HttpServlet { ISistema sys = null; sys = Factory.getInstance(); if (sys.existeUserConPass(userName, userPass)){ + u = sys.getUser(userName); + if (u != null){ HttpSession s = request.getSession(); - s.setAttribute("userName", userName); - s.setAttribute("userId", 1); - s.setAttribute("imgUser", "avatar.png"); + s.setAttribute("userName", u.getNick()); + s.setAttribute("userPass", u.getPass()); + if (u.getImg() != null){ + s.setAttribute("imgUser", Base64.getEncoder().encodeToString(u.getImg()) ); + } return "exito"; + }else{ + return "Error no esperado."; + } } else{ return "El usuario no existe"; @@ -153,16 +164,7 @@ public class login extends HttpServlet { private void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - DtUsuario user = new DtUsuario(); - user.setApellido("piston"); - user.setNombre("mauro"); - user.setEmail("mauro@email.com"); - user.setNick("img"); - /* Pasa los datos al jsp */ - request.setAttribute("data", user); - - /* Carga el jsp */ response.setContentType("text/html;charset=UTF-8"); RequestDispatcher dispatsh = request.getRequestDispatcher("page/login/login.jsp"); dispatsh.forward(request, response); diff --git a/l2g4/src/java/controladores/propuesta.java b/l2g4/src/java/controladores/propuesta.java index 4da6b60fe57c08bb2602fa2e5da5895638fb1025..092cde4b8423e05cdc9258323c0b8579fbab3a55 100644 --- a/l2g4/src/java/controladores/propuesta.java +++ b/l2g4/src/java/controladores/propuesta.java @@ -16,21 +16,22 @@ import javax.servlet.http.HttpSession; @WebServlet(name = "propuesta", urlPatterns = {"/propuesta"}) public class propuesta extends HttpServlet { + protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String respuesta = "Error"; - String metodo = getParameter(request,"metodo"); - String propuestaId,userId,text,CategoríaId; - + String metodo = getParameter(request, "metodo"); + String propuestaId, userId, text, CategoríaId; + HttpSession session = request.getSession(); - String user = (String)session.getAttribute("userId"); + String user = (String) session.getAttribute("userId"); - switch(metodo){ + switch (metodo) { case "ExtenderFinanciación": /* * @parametro propuestaId id propuesta */ - propuestaId = getParameter(request,"propuestaId"); + propuestaId = getParameter(request, "propuestaId"); //user; break; case "CancelarPropuesta": @@ -38,7 +39,7 @@ public class propuesta extends HttpServlet { * @parametro propuestaId id propuesta * @parametro userId nick usuario */ - propuestaId = getParameter(request,"propuestaId"); + propuestaId = getParameter(request, "propuestaId"); //user; break; case "Comentario": @@ -46,24 +47,31 @@ public class propuesta extends HttpServlet { * @parametro propuestaId id propuesta * @parametro text msj a guardar */ - propuestaId = getParameter(request,"propuestaId"); + propuestaId = getParameter(request, "propuestaId"); //user; - text = getParameter(request,"text"); - + text = getParameter(request, "text"); + break; case "PropuestaCategoría": /* * @parametro Categoría id Categoría */ - CategoríaId = getParameter(request,"Categoría"); + CategoríaId = getParameter(request, "Categoría"); break; case "nuevo": /* - * @parametro Categoría id Categoría + * @parametro categoria String + * @parametro titulo String + * @parametro lugar String + * @parametro precioEntrada String + * @parametro fechaPrevista String + * @parametro montoNecesario String + * @parametro descripcion String + * @parametro retorno String */ - CategoríaId = getParameter(request,"Categoría"); + respuesta = NuevoPropuesta(request); break; - + default: respuesta = "Metodo invalido"; } @@ -72,18 +80,19 @@ public class propuesta extends HttpServlet { response.getWriter().write(respuesta); } + /** * GetParameter retorna el parametro de existir en request - * + * * @param request type HttpServletRequest -> request de la peticion * @param text type String -> parametro que desea buscar - * @return parametro type String -> retorna valor de parametro o null de no + * @return parametro type String -> retorna valor de parametro o null de no * encontrarlo - * + * */ - private String getParameter(HttpServletRequest request,String text){ + private String getParameter(HttpServletRequest request, String text) { String parametro = request.getParameter(text); - if (parametro != null){ + if (parametro != null) { parametro = parametro.trim(); } return parametro; @@ -95,17 +104,31 @@ public class propuesta extends HttpServlet { processRequest(request, response); } - @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } - @Override public String getServletInfo() { return "Short description"; } + private String NuevoPropuesta(HttpServletRequest request) { + // Variavles para nueva propuesta + String categoria, titulo, lugar, precioEntrada, fechaPrevista, montoNecesario, descripcion, retorno; + + categoria = getParameter(request, "categoria"); + titulo = getParameter(request, "titulo"); + lugar = getParameter(request, "lugar"); + precioEntrada = getParameter(request, "precioEntrada"); + fechaPrevista = getParameter(request, "fechaPrevista"); + montoNecesario = getParameter(request, "montoNecesario"); + descripcion = getParameter(request, "descripcion"); + retorno = getParameter(request, "retorno"); + + return ""; + } + } diff --git a/l2g4/src/java/controladores/user.java b/l2g4/src/java/controladores/user.java index 400611c30472bc8120efc80b657169eb4d6d2bf0..20d3dd5e0dfcb9f3e92b15185569c73b0ce4f9bf 100644 --- a/l2g4/src/java/controladores/user.java +++ b/l2g4/src/java/controladores/user.java @@ -5,6 +5,8 @@ */ package controladores; +import Logica.Factory; +import Logica.ISistema; import controladores.conexionServidor; import datatype.DtProponente; import datatype.DtPropuesta; @@ -13,6 +15,7 @@ import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; +import java.util.Map; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; @@ -28,71 +31,47 @@ import javax.servlet.http.HttpSession; //@WebServlet(name = "user", urlPatterns = {"/user"}) @WebServlet("/user/*") public class user extends HttpServlet { - + private conexionServidor sys = null; + + protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - HttpSession session = request.getSession(); - - String userNick = request.getPathInfo(); - if (userNick == null){ + + String userNick = request.getParameter("user"); + if (userNick == null) { response.setContentType("text/html;charset=UTF-8"); RequestDispatcher dispatsh = request.getRequestDispatcher("page/user/perfil-usuario_no_encontrado.jsp"); dispatsh.forward(request, response); - }else{ - userNick = userNick.substring(1, userNick.length()); - - DtProponente user = new DtProponente(); - user.setApellido("piston"); - user.setNombre("mauro"); - user.setEmail("mauro@email.com"); - user.setNick("nick"); - + } else { + + ISistema sys = null; + sys = Factory.getInstance(); + Logica.datatype.DtUsuario u = null; + u = sys.getUser(userNick); + + List<DtUsuario> seguidores = new ArrayList<DtUsuario>(); - DtUsuario user1 = new DtUsuario(); - user1.setApellido("apellido"); - user1.setNombre("nombre"); - user1.setEmail("email@email.com"); - user1.setNick("nick"); - - - DtUsuario user2 = new DtUsuario(); - user2.setApellido("apellido2"); - user2.setNombre("nombre2"); - user2.setEmail("email2@email.com"); - user2.setNick("nick2"); - - seguidores.add(user1); - seguidores.add(user2); - - List<DtPropuesta> pruepuestas = new ArrayList<DtPropuesta>(); - DtPropuesta prop1 = new DtPropuesta(); - prop1.setTitulo("sadas"); - prop1.setDescripcion("dexcripcion"); - - - DtPropuesta prop2 = new DtPropuesta(); - prop2.setTitulo("sadas"); - prop2.setDescripcion("dexcripcion"); - - pruepuestas.add(prop1); - pruepuestas.add(prop2); + List<DtPropuesta> pruepuestas = new ArrayList<DtPropuesta>(); + + String user = (String)session.getAttribute("userName"); /* Pasa los datos al jsp */ - request.setAttribute("perfiluser", user); + request.setAttribute("perfiluser", u); + request.setAttribute("yo", user); + request.setAttribute("tipo", "Colaborador"); request.setAttribute("seguidores", seguidores); - request.setAttribute("pruepuestas", pruepuestas); + request.setAttribute("Creo", pruepuestas); + request.setAttribute("Favoritos", pruepuestas); -response.sendRedirect("/page/user/perfil-usuario.jsp"); - /* response.setContentType("text/html;charset=UTF-8"); + // response.sendRedirect("/g4/page/user/perfil-usuario.jsp"); + response.setContentType("text/html;charset=UTF-8"); getServletContext().getRequestDispatcher("/page/user/perfil-usuario.jsp").forward(request, response); -*/ } - - + } @Override @@ -104,17 +83,17 @@ response.sendRedirect("/page/user/perfil-usuario.jsp"); @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - /* Preparo respuesta */ + /* Preparo respuesta */ String respuesta = "Error"; - String metodo = getParameter(request,"metodo"); - String asegido,segidor,propuesta; - + String metodo = getParameter(request, "metodo"); + String asegido, segidor, propuesta; + HttpSession session = request.getSession(); - String user = (String)session.getAttribute("userId"); - + String user = (String) session.getAttribute("userId"); + conexionServidor sys = new conexionServidor(); - - switch(metodo){ + Map<String, String[]> asdsa = getAllParam(request); + switch (metodo) { case "NuevoUsuario": respuesta = NuevoUsuario(request); break; @@ -123,17 +102,15 @@ response.sendRedirect("/page/user/perfil-usuario.jsp"); * @parametro segido nick usuario deseo seguir * @parametro segidor nick usuario session */ - asegido = getParameter(request,"asegido"); - - if(asegido.isEmpty() == false){ - if(user.matches(asegido) == false){ + asegido = getParameter(request, "asegido"); + + if (asegido.isEmpty() == false) { + if (user.matches(asegido) == false) { respuesta = sys.seguirUsuario(user, asegido); - } - else{ + } else { respuesta = "Un usuario no puede seguirse a si mismo"; } - } - else{ + } else { respuesta = "El campo de usuario a seguir esta en blanco"; } break; @@ -142,28 +119,26 @@ response.sendRedirect("/page/user/perfil-usuario.jsp"); * @parametro segido nick usuario deseo seguir * @parametro segidor nick usuario session */ - asegido = getParameter(request,"asegido"); - - if(asegido.isEmpty() == false){ - if(user.matches(asegido) == false){ + asegido = getParameter(request, "asegido"); + + if (asegido.isEmpty() == false) { + if (user.matches(asegido) == false) { respuesta = sys.dejarSeguirUsuario(user, asegido); - } - else{ + } else { respuesta = "Un usuario no se sigue a si mismo"; } - } - else{ + } else { respuesta = "El campo usuario a dejar de seguir esta en blanco"; } - + break; case "Favorita": /* * @parametro propuesta id propuesta * @parametro segidor nick usuario */ - propuesta = getParameter(request,"propuesta"); - segidor = getParameter(request,"segidor"); + propuesta = getParameter(request, "propuesta"); + segidor = getParameter(request, "segidor"); break; default: respuesta = "Metodo invalido"; @@ -171,36 +146,45 @@ response.sendRedirect("/page/user/perfil-usuario.jsp"); /* respondo */ response.setContentType("text/plain"); response.getWriter().write(respuesta); - + } @Override public String getServletInfo() { return "Short description"; } - - + /* Funciopnes propias ----------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - + /*------------------------------------------------------------------------*/ /** * GetParameter retorna el parametro de existir en request - * + * * @param request type HttpServletRequest -> request de la peticion * @param text type String -> parametro que desea buscar - * @return parametro type String -> retorna valor de parametro o null de no + * @return parametro type String -> retorna valor de parametro o null de no * encontrarlo - * + * */ - private String getParameter(HttpServletRequest request,String text){ + private String getParameter(HttpServletRequest request, String text) { String parametro = request.getParameter(text); - if (parametro != null){ + if (parametro != null) { parametro = parametro.trim(); } return parametro; } - - private String NuevoUsuario(HttpServletRequest request){ + + private Map<String, String[]> getAllParam(HttpServletRequest request) { + Map<String, String[]> parameters = request.getParameterMap(); + for (String parameter : parameters.keySet()) { + if (parameter.toLowerCase().startsWith("question")) { + String[] values = parameters.get(parameter); + } + } + + return parameters; + } + + private String NuevoUsuario(HttpServletRequest request) { return ""; } } diff --git a/l2g4/web/META-INF/web.xml b/l2g4/web/META-INF/web.xml deleted file mode 100644 index c8fbfcc550798fab507a7ab87cd6f284b0c30ff5..0000000000000000000000000000000000000000 --- a/l2g4/web/META-INF/web.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"> - <servlet> - <servlet-name>index</servlet-name> - <servlet-class>controladores.index</servlet-class> - </servlet> - - <servlet-mapping> - <servlet-name>index</servlet-name> - <url-pattern>/</url-pattern> - </servlet-mapping> - - <error-page> - <error-code>404</error-code> - <location>/404page.jsp</location> - </error-page> - - <session-config> - <session-timeout> - 30 - </session-timeout> - </session-config> -</web-app> diff --git a/l2g4/web/css/header.css b/l2g4/web/css/header.css index fd779ab83d51e9c3088cb5054f08304dbaeb9cb5..43c99eea1c7debdc5ec597abad54691aa0df24d9 100644 --- a/l2g4/web/css/header.css +++ b/l2g4/web/css/header.css @@ -5,7 +5,7 @@ nav { box-shadow: 0 3px 2px 0 rgba(0,0,0,0.1), 0 1px 1px 0 rgba(0,0,0,0.11); - padding: 5px; + padding: 0px; background: #fff; border-bottom: solid 3px #333; display: flex; @@ -23,13 +23,19 @@ nav { margin: 5px; } /* Tools */ +.tools{ + justify-content: center; + align-items: center; + display: flex; + +} .tools > div { display: none; } .tools.search .search, .tools.logeado .logeado, .tools.Visitante .Visitante{ - display: block; + display: block; } /* Search */ .input-search { @@ -61,9 +67,10 @@ nav { white-space: nowrap; width: 100px; margin: 5px; + padding-right: 10px; } /* Visitante */ -.Visitante a{ +.tools a{ color: #999; font-weight: 300; margin: 5px; @@ -71,8 +78,9 @@ nav { outline: none; transition: all .2s; } -.Visitante a:hover{ +.tools a:hover{ text-decoration: none; color: #222; outline: none; + background: rgba(0,0,0,.02); } diff --git a/l2g4/web/css/style.css b/l2g4/web/css/style.css index fafc02a7367243cd6e254e62fb1f0ce7ca2be992..d39e76999ce828a2cae28ea3f3ce384ccfc7c579 100644 --- a/l2g4/web/css/style.css +++ b/l2g4/web/css/style.css @@ -34,4 +34,9 @@ body { position: fixed; bottom: 0; right: 10px; +} + +.msjNone{ + margin: 40px; + color: #999; } \ No newline at end of file diff --git a/l2g4/web/img/404.png b/l2g4/web/img/404.png new file mode 100644 index 0000000000000000000000000000000000000000..8cf5c77d29fb3f3ab3c858642bc6a0a609a71621 Binary files /dev/null and b/l2g4/web/img/404.png differ diff --git a/l2g4/web/img/bg.jpg b/l2g4/web/img/bg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e63595bd9d81c222b585985008a32c39974ebb69 Binary files /dev/null and b/l2g4/web/img/bg.jpg differ diff --git a/l2g4/web/img/upload.svg b/l2g4/web/img/upload.svg new file mode 100644 index 0000000000000000000000000000000000000000..fca84bc2be8febfb55b4ea7c998a66996a3ef260 --- /dev/null +++ b/l2g4/web/img/upload.svg @@ -0,0 +1 @@ +<svg aria-hidden="true" data-prefix="fas" data-icon="file-upload" class="svg-inline--fa fa-file-upload fa-w-12" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="currentColor" d="M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm65.18 216.01H224v80c0 8.84-7.16 16-16 16h-32c-8.84 0-16-7.16-16-16v-80H94.82c-14.28 0-21.41-17.29-11.27-27.36l96.42-95.7c6.65-6.61 17.39-6.61 24.04 0l96.42 95.7c10.15 10.07 3.03 27.36-11.25 27.36zM377 105L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128v-6.1c0-6.3-2.5-12.4-7-16.9z"></path></svg> \ No newline at end of file diff --git a/l2g4/web/js/app-ajax.js b/l2g4/web/js/app-ajax.js index 8157c907c1b2f3f4feae330326ff23ac7fd51d36..ebd7f62a58902505aa82220d199936617d3d66a6 100644 --- a/l2g4/web/js/app-ajax.js +++ b/l2g4/web/js/app-ajax.js @@ -31,17 +31,15 @@ $(document).ready(function () { }); - /* $('#btn-new-user').click(function () { - funcionNuevoUsaurio(); - });*/ - $("form").submit(function (event) { - - }); - + funcionAltaPerfil(); + }); + + $('#btn-new-propuesta').click(function () { + funcionAltaPropuesta(); + }); $("#img").change(function () { - if (this.files && this.files[0]) { var reader = new FileReader(); reader.onload = function (e) { @@ -76,7 +74,7 @@ function funcionAltaPerfil() { event.preventDefault(); var type = "POST"; var url = 'user'; - var cadena = $(this).serialize(); + var cadena = $(".form-usuario").serialize(); funcionMandaFormulario(type, url, cadena); } /* Cierre de Sesión ----------------------------------------------------------*/ @@ -140,7 +138,7 @@ function funcionAltaPropuesta() { event.preventDefault(); var type = "POST"; var url = 'propuesta'; - var cadena = $(this).serialize(); + var cadena = $(".form-usuario").serialize(); funcionMandaFormulario(type, url, cadena); } /* Registrar Colaboración a Propuesta ----------------------------------------*/ diff --git a/l2g4/web/page/error.jsp b/l2g4/web/page/error.jsp deleted file mode 100644 index 2d2ba52a3245a15ac67c27c4df0f9d856b73d0ea..0000000000000000000000000000000000000000 --- a/l2g4/web/page/error.jsp +++ /dev/null @@ -1,24 +0,0 @@ -<%-- - Document : error - Created on : 19-oct-2018, 18:43:35 - Author : pecaa ---%> - -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<!DOCTYPE html> -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>Error</title> - </head> - <body> - <h1 style=" - width: 100%; - height: 100%; - display: flex; - justify-content: center; - padding: 30px 00px; - color: #333; - font-size: 60px;">Error inseperado!</h1> - </body> -</html> diff --git a/l2g4/web/page/login/login.jsp b/l2g4/web/page/login/login.jsp index 3732709d8893f5f8a15c380f72ec7eb31e71ed65..18013e56cc963beab21543d71e6434adab6afe60 100644 --- a/l2g4/web/page/login/login.jsp +++ b/l2g4/web/page/login/login.jsp @@ -49,7 +49,10 @@ <input type="text" id="loginNick" class="form-control" placeholder="Nick" required="" autofocus=""> <input type="password" id="loginPass" class="form-control" placeholder="Contraseña" required=""> <hr> - <input type="button" class="btn btn-primary" id="btn-login" value="Iniciar sesión"> + <div class="row"> + <input type="button" class="col btn btn-primary" id="btn-login" value="Iniciar sesión"> + <a class="col btn btn-primary" id="btn-login" href="/g4/addUser">Registrarse</a> + </div> </form> diff --git a/l2g4/web/page/nav.jspf b/l2g4/web/page/nav.jspf index a1b34995eb514f586275b9dc4a28c23910d7636b..38d02fd51d65c30dc095028dd4888af60213e30f 100644 --- a/l2g4/web/page/nav.jspf +++ b/l2g4/web/page/nav.jspf @@ -2,16 +2,12 @@ <%@ page pageEncoding="UTF-8" %> <!-- Nav --> <% - /* - String nameUser = (String)session.getAttribute("nameUser"); - String idUser = (String)session.getAttribute("userId"); - String imgUser = (String)session.getAttribute("imgUser"); - */ - String nameUser = "sdad"; - String idUser = "sdad"; - String imgUser = "sdad"; + + String nameUser = (String)session.getAttribute("userName"); + String imgUser = "data:image/jpeg;base64,"+(String)session.getAttribute("imgUser"); + String estado = "logeado"; - if (idUser == null){ + if (nameUser == null){ estado = "Visitante"; } %> @@ -21,12 +17,12 @@ </div> <div class="tools <% out.print( estado ); %>"> - <% if (idUser != null ) { %> + <% if (nameUser != null ) { %> <!-- User logeado--> + <a href="/g4/addPropuesta">Nueva Propuesta</a> <div class="logeado dropdown" data-toggle="dropdown" style="width: 150px; text-align: right;"> <ul class="dropdown-menu" role="menu"> - <a class="dropdown-item" href="#">Perfil</a> - <a class="dropdown-item" href="#">Favoritos</a> + <a class="dropdown-item" onclick="window.location='/g4/user?user=<% out.print( nameUser ); %>';" >Perfil</a> <a class="dropdown-item" id="btn-logout">Salir</a> </ul> <div class="dropdown-toggle" data-toggle="dropdown"> @@ -37,8 +33,8 @@ <% } else { %> <!-- Visitante --> <div class="Visitante"> - <a href="registro-usuario.html">Registrarse</a> - <a href="login.html">Loguearse</a> + <a href="addUser">Registrarse</a> + <a href="login">Loguearse</a> </div> <% } %> diff --git a/l2g4/web/page/propuesta/registro-propuesta.jsp b/l2g4/web/page/propuesta/registro-propuesta.jsp index 22f3dba20921c7bc1427d60bd310db58c2c11f11..7d1058e40cdf133d927fa69b0828295bd6efd204 100644 --- a/l2g4/web/page/propuesta/registro-propuesta.jsp +++ b/l2g4/web/page/propuesta/registro-propuesta.jsp @@ -4,189 +4,247 @@ Author : pecaa --%> +<%@page import="java.util.Date"%> +<%@page import="java.text.SimpleDateFormat"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> +<% + /* Para limitar la fecha minima de fechaPrevista */ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-M-dd"); + String date = sdf.format(new Date()); + + String categorias = ""; + if (request.getAttribute("categorias") != null) { + categorias = (String) request.getAttribute("categorias"); + } +%> <!DOCTYPE html> <html lang="en" dir="ltr"> - <head> - <!-- Latest compiled and minified CSS --> - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> - <!-- jQuery library --> - <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> - <!-- Popper JS --> - <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> - <!-- Latest compiled JavaScript --> - <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> - <!-- Estilos --> - <link rel="stylesheet" href="./css/cards-propuesta.css"> - <link rel="stylesheet" href="./css/cards-seguir.css"> - <link rel="stylesheet" href="./css/cards-usuario.css"> - <link rel="stylesheet" href="./css/footer.css"> - <link rel="stylesheet" href="./css/header.css"> - <link rel="stylesheet" href="./css/msg.css"> - <link rel="stylesheet" href="./css/pagination.css"> - <link rel="stylesheet" href="./css/style.css"> - <link rel="stylesheet" href="./css/title.css"> - <link rel="stylesheet" href="./css/form-propuesta.css"> - - - <!-- MetaData --> - <title>Culturarte-G4</title> - <meta name="description" content="Web para el obligatorio 2"> - <meta name="keywords" content="HTML,CSS,JavaScript,jQuery,Popper,Bootstrap"> - <meta name="author" content="G-4"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta charset="utf-8"> - <style> - - header{ - background: url(./img/gb-user.jpg); - } - .list-group-item { - user-select: none; - } - - .list-group input[type="checkbox"] { - display: none; - } - - .list-group input[type="checkbox"] + .list-group-item { - cursor: pointer; - } - - .list-group input[type="checkbox"] + .list-group-item:before { - content: "\2713"; - color: transparent; - font-weight: bold; - margin-right: 1em; - } - - .list-group input[type="checkbox"]:checked + .list-group-item { - background-color: #0275D8; - color: #FFF; - } - - .list-group input[type="checkbox"]:checked + .list-group-item:before { - color: inherit; - } - - .list-group input[type="radio"] { - display: none; - } - - - .list-group input[type="radio"]:checked + .list-group-item { - background-color: #0275D8; - color: #FFF; - } - - .list-group input[type="radio"]:checked + .list-group-item:before { - color: inherit; - } - </style> - </head> - <body> - - <%@include file="../nav.jspf" %> - <%@include file="../msg.jspf" %> - <%@include file="../loder.jspf" %> - <header> - <h1 class="title">Registro de usuario</h1> - </header> - <form class="form-usuario main retorno"> - <div class="progreso"> - <span></span> - <span></span> - <span></span> - </div> - <div class="page categoria"> - <h1>categoria</h1> - <select multiple class="form-control" id="exampleFormControlSelect1"> - <option>1</option> - <option>2</option> - <option>3</option> - <option>4</option> - <option>5</option> - </select> - <button class="btn btn-primary">Siginte</button> - </div> - <div class="page info"> - <h1>Información</h1> - - <div class="row"> - <div class="col-md-6 mb-3"> - <label for="titulo">Titulo</label> - <input type="text" class="form-control" id="titulo" placeholder="Titulo" value="" required=""> - <div class="invalid-feedback"> - El titulo no es válido. + <head> + <!-- Latest compiled and minified CSS --> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> + <!-- jQuery library --> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> + <!-- Popper JS --> + <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> + <!-- Latest compiled JavaScript --> + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> + <!-- Estilos --> + <link rel="stylesheet" href="./css/cards-propuesta.css"> + <link rel="stylesheet" href="./css/cards-seguir.css"> + <link rel="stylesheet" href="./css/cards-usuario.css"> + <link rel="stylesheet" href="./css/footer.css"> + <link rel="stylesheet" href="./css/header.css"> + <link rel="stylesheet" href="./css/msg.css"> + <link rel="stylesheet" href="./css/pagination.css"> + <link rel="stylesheet" href="./css/style.css"> + <link rel="stylesheet" href="./css/title.css"> + <link rel="stylesheet" href="./css/form-propuesta.css"> + + + <!-- MetaData --> + <title>Culturarte-G4</title> + <meta name="description" content="Web para el obligatorio 2"> + <meta name="keywords" content="HTML,CSS,JavaScript,jQuery,Popper,Bootstrap"> + <meta name="author" content="G-4"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta charset="utf-8"> + <style> + + header{ + background: url(./img/gb-user.jpg); + } + .list-group-item { + user-select: none; + } + + .list-group input[type="checkbox"] { + display: none; + } + + .list-group input[type="checkbox"] + .list-group-item { + cursor: pointer; + } + + .list-group input[type="checkbox"] + .list-group-item:before { + content: "\2713"; + color: transparent; + font-weight: bold; + margin-right: 1em; + } + + .list-group input[type="checkbox"]:checked + .list-group-item { + background-color: #0275D8; + color: #FFF; + } + + .list-group input[type="checkbox"]:checked + .list-group-item:before { + color: inherit; + } + + .list-group input[type="radio"] { + display: none; + } + + + .list-group input[type="radio"]:checked + .list-group-item { + background-color: #0275D8; + color: #FFF; + } + + .list-group input[type="radio"]:checked + .list-group-item:before { + color: inherit; + } + </style> + </head> + <body> + <script type="text/javascript"> + /* Formularios */ + function pasarPagina(newPage) { + switch (newPage) { + + case "categoria": + $('.form-usuario.main').prop("class", "form-usuario main " + newPage); + break; + case "info": + if ($("#categoria").val() == "") + alert("Selecciona la categoria."); + else + $('.form-usuario.main').prop("class", "form-usuario main " + newPage); + break; + case "retorno": + if ($("#descripcion").val() == "") { + alert("Es nesesario una descripcion."); + } else if ($("#titulo").val() == "") { + alert("Falta un titulo"); + } else if ($("#lugar").val() == "") { + alert("Falta un lugar"); + } else if ($("#precioEntrada").val() == "") { + alert("Cual es el precio de entrada"); + } else if ($("#fechaPrevista").val() == "") { + alert("Falta un fecha prevista"); + } else if ($("#montoNecesario").val() == "") { + alert("Cuanto quieres recolectar."); + } else { + $('.form-usuario.main').prop("class", "form-usuario main " + newPage); + } + break; + } + + } + </script> + <%@include file="../nav.jspf" %> + <%@include file="../msg.jspf" %> + <%@include file="../loder.jspf" %> + <form class="form-usuario main categoria"> + <input type="hidden" name="metodo" value="nuevo"> + <div class="progreso"> + <span></span> + <span></span> + <span></span> </div> - </div> - <div class="col-md-6 mb-3"> - <label for="lugar">Lugar</label> - <input type="text" class="form-control" id="lugar" placeholder="Lugar" value="" required=""> - <div class="invalid-feedback"> - El lugar no es válido. + <div class="page categoria"> + <h1>Categoria</h1> + <p>La categorai seleccionada sera de utilidad luego si algun colaborador lista por categorias</p> + <select multiple class="form-control" name="categoria" id="categoria"> + <% out.print(categorias);%> + </select> + <div style="display: flex;"> + <input type="button" class="btn btn-primary" onclick="pasarPagina('info')" value="Siguinte"> + </div> </div> - </div> - </div> - <div class="row"> - <div class="col-md-6 mb-3"> - <label for="precioEntrada">Precio entrada</label> - <input type="precioEntrada" class="form-control" id="precioEntrada" placeholder="10"> - <div class="invalid-feedback"> - El precio de entrada no es válido. - </div> + <div class="page info"> + <h1>Información</h1> + + <div class="row"> + <div class="col-md-6 mb-3"> + <label for="titulo">Titulo</label> + <input type="text" class="form-control" name="titulo" id="titulo" placeholder="Titulo" value="" required=""> + <div class="invalid-feedback"> + El titulo no es válido. + </div> + </div> + <div class="col-md-6 mb-3"> + <label for="lugar">Lugar</label> + <input type="text" class="form-control" name="lugar" id="lugar" placeholder="Lugar" value="" required=""> + <div class="invalid-feedback"> + El lugar no es válido. + </div> + </div> + </div> + <div class="row"> + <div class="col-md-6 mb-3"> + <label for="precioEntrada">Precio entrada</label> + <input min="0" type="number" name="precioEntrada" class="form-control" id="precioEntrada" placeholder="10"> + <div class="invalid-feedback"> + El precio de entrada no es válido. + </div> + </div> + <div class="col-md-6 mb-3"> + <label for="fechaPrevista">Fecha prevista</label> + <input min="<% out.print(date);%>" type="date" class="form-control" name="fechaPrevista" id="fechaPrevista" placeholder="Fecha prevista"> + <div class="invalid-feedback"> + La fecha prevista no es válida. + </div> + </div> + </div> + <div class="mb-3"> + <label for="montoNecesario">Monto necesario</label> + <div class="input-group"> + <input min="0" type="number" class="form-control" name="montoNecesario" id="montoNecesario" placeholder="1000000" required=""> + <div class="invalid-feedback" style="width: 100%;"> + El monto no es válido. + </div> + </div> + </div> + + <div class="mb-3"> + <label for="descripcion">Descripción</label> + <textarea + class="form-control" name="descripcion" id="descripcion" placeholder="Descripcion"></textarea> + <div class="invalid-feedback"> + La descripción no es válida. + </div> + </div> + + <div style="display: flex;"> + <input type="button" class="btn btn-primary" onclick="pasarPagina('categoria')" value="Atras"> + <input type="button" class="btn btn-primary" onclick="pasarPagina('retorno')" value="Siguinte"> + </div> </div> - <div class="col-md-6 mb-3"> - <label for="fechaPrevista">Fecha prevista</label> - <input type="datetime-datetime-local" class="form-control" id="fechaPrevista" placeholder="Fecha prevista"> - <div class="invalid-feedback"> - La fecha prevista no es válida. - </div> + <div class="page retorno"> + <h1>Retorno</h1> + <div class="form-check form-check-inline"> + <input class="form-check-input" type="radio" name="retorno" id="retornoEntrada" value="entrada"checked=""> + <label class="form-check-label" for="retornoEntrada">Entrada Gratis</label> + </div> + <p> + Se le entregara una entrada gratis a cada colaborador en tu proyecto. + </p> + <div class="form-check form-check-inline"> + <input class="form-check-input" type="radio" name="retorno" id="retornoPorsentaje" value="porsentaje" > + <label class="form-check-label" for="retornoPorsentaje">Porsentaje</label> + </div> + <p> + Darle un porsentaje de las ganancias. + </p> + + <div style="display: flex;"> + <input type="button" class="btn btn-primary" onclick="pasarPagina('info')" value="Atras"> + <input type="submit" class="btn btn-primary" id="btn-new-propuesta" value="Mandar"> + </div> </div> - </div> - <div class="mb-3"> - <label for="montoNecesario">Monto necesario</label> - <div class="input-group"> - <input type="text" class="form-control" id="montoNecesario" placeholder="1000000" required=""> - <div class="invalid-feedback" style="width: 100%;"> - El monto no es válido. - </div> - </div> - </div> - - <div class="mb-3"> - <label for="descripcion">Descripción</label> - <input type="datetime-datetime-local" class="form-control" id="descripcion" placeholder="Descripcion"> - <div class="invalid-feedback"> - La descripción no es válida. - </div> - </div> - - <button class="btn btn-primary">Siginte</button> - </div> - <div class="page retorno"> - <h1>Retorno</h1> - <div class="form-group"> - <label for="formControlRange">Porcentaje 10</label> - <input step="1" min="0" max="100" type="range" class="form-control-range" id="formControlRange"> - </div> - <div class="d-flex justify-content-center"> - <hr class="col-4"> - <span class="col-1"> O </span> - <hr class="col-4"> - </div> - <label for="exampleFormControlSelect1">Numero de entradas</label> - <select class="form-control" id="exampleFormControlSelect1"> - <option>1</option> - <option>2</option> - <option>3</option> - <option>4</option> - <option>5</option> - </select> - - <button class="btn btn-primary">Listo</button> - </div> - </form> - - </body> + </form> + + <!-- jQuery library --> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> + <!-- Popper JS --> + <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> + <!-- Latest compiled JavaScript --> + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> + <script src="./js/lib/moment.js"></script> + <script src="./js/lib/bootstrap-datetimepicker.js"></script> + <!-- Script --> + <script src="./js/loder.js"></script> + <script src="./js/app-ajax.js"></script> + </body> </html> diff --git a/l2g4/web/page/user/perfil-usuario.jsp b/l2g4/web/page/user/perfil-usuario.jsp index eb703e708bd77f29506533cfdce6127294966789..9021fb7bbc6c36ac4bc6f2cae3a7606ffef17f40 100644 --- a/l2g4/web/page/user/perfil-usuario.jsp +++ b/l2g4/web/page/user/perfil-usuario.jsp @@ -4,6 +4,7 @@ Author : pecaa --%> +<%@page import="java.util.Base64"%> <%@page import="datatype.DtPropuesta"%> <%@page import="java.util.ArrayList"%> <%@page import="java.util.List"%> @@ -11,188 +12,205 @@ <%@page import="datatype.DtUsuario"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <% - List<DtUsuario> seguidores = (ArrayList<DtUsuario>)request.getAttribute("seguidores"); - List<DtUsuario> sigo = (ArrayList<DtUsuario>)request.getAttribute("seguidores"); - List<DtPropuesta> pruepuestas = (ArrayList<DtPropuesta>)request.getAttribute("pruepuestas"); - DtProponente user = (DtProponente)request.getAttribute("perfiluser"); + List<DtUsuario> seguidores = (ArrayList<DtUsuario>) request.getAttribute("seguidores"); + List<DtUsuario> sigo = (ArrayList<DtUsuario>) request.getAttribute("sigo"); + List<DtPropuesta> Favoritos = (ArrayList<DtPropuesta>) request.getAttribute("Creo"); + List<DtPropuesta> Creo = (ArrayList<DtPropuesta>) request.getAttribute("Favoritos"); + Logica.datatype.DtUsuario user = (Logica.datatype.DtUsuario) request.getAttribute("perfiluser"); + String yo = (String) request.getAttribute("yo"); %> <!DOCTYPE html> <html lang="en" dir="ltr"> - <head> - <!-- Latest compiled and minified CSS --> - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> - <!-- jQuery library --> - <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> - <!-- Popper JS --> - <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> - <!-- Bootstrap --> - <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> - <!-- Fontawesome --> - <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> - <!-- Estilos --> - <link rel="stylesheet" href="./css/cards-propuesta.css"> - <link rel="stylesheet" href="./css/cards-usuario.css"> - <link rel="stylesheet" href="./css/footer.css"> - <link rel="stylesheet" href="./css/header.css"> - <link rel="stylesheet" href="./css/msg.css"> - <link rel="stylesheet" href="./css/pagination.css"> - <link rel="stylesheet" href="./css/style.css"> - <link rel="stylesheet" href="./css/title.css"> - <link rel="stylesheet" href="./css/form-propuesta.css"> - <link rel="stylesheet" href="./css/cards-seguir.css"> + <head> + <!-- Latest compiled and minified CSS --> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> + <!-- jQuery library --> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> + <!-- Popper JS --> + <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> + <!-- Bootstrap --> + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> + <!-- Fontawesome --> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> + <!-- Estilos --> + <link rel="stylesheet" href="./css/cards-propuesta.css"> + <link rel="stylesheet" href="./css/cards-usuario.css"> + <link rel="stylesheet" href="./css/footer.css"> + <link rel="stylesheet" href="./css/header.css"> + <link rel="stylesheet" href="./css/msg.css"> + <link rel="stylesheet" href="./css/pagination.css"> + <link rel="stylesheet" href="./css/style.css"> + <link rel="stylesheet" href="./css/title.css"> + <link rel="stylesheet" href="./css/form-propuesta.css"> + <link rel="stylesheet" href="./css/cards-seguir.css"> - <!-- Script --> - <script src="./js/loder.js"></script> - <script src="./js/app-ajax.js"></script> + <!-- Script --> + <script src="./js/loder.js"></script> + <script src="./js/app-ajax.js"></script> - <!-- MetaData --> - <title>Culturarte-G4</title> - <meta name="description" content="Web para el obligatorio 2"> - <meta name="keywords" content="HTML,CSS,JavaScript,jQuery,Popper,Bootstrap"> - <meta name="author" content="G-4"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta charset="utf-8"> - <style> + <!-- MetaData --> + <title>Culturarte-G4</title> + <meta name="description" content="Web para el obligatorio 2"> + <meta name="keywords" content="HTML,CSS,JavaScript,jQuery,Popper,Bootstrap"> + <meta name="author" content="G-4"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta charset="utf-8"> + <style> - header{ - background: url(./img/gb-user.jpg); - } - .flex-column { - padding: 0px; - } - .tab-content { - padding: 20px; - } - .tab-content h1{ - margin-bottom: 10px; - color: #333; - text-align: center; - font-size: 24px; - } - .tab-content b{ - width: 100px; - display: inline-block; - } - </style> - </head> - <body> - <%@include file="../nav.jspf" %> - <%@include file="../msg.jspf" %> - <header> - <h1 class="title">Registro de usuario</h1> - </header> - <form class="form-usuario container"> - <div class="row"> - <div class="col-8 main card "> - <div class="tab-content" id="v-pills-tabContent"> - <div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab"> - <h1>Información </h1> - <label><b>Nombre </b> <% out.print(user.getNombre()); %></label><br> - <label><b>Apellido </b> <% out.print(user.getApellido()); %></label><br> - <label><b>Web </b> <a href="#"><% out.print(user.getUrl()); %></a></label><br> - <label><b>Email </b> <% out.print(user.getEmail()); %></label><br> - <label><b>Descripción </b></label><br> - <p><% out.print(user.getBiografia()); %></p> - </div> - <div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab"> - <h1>Usuarios que sigo </h1> - <div class="box-cards-center"> - <% for (DtUsuario e : seguidores) {%> - <div class="cards-seguidor"> - <img class="user-creador" src="avatar.png"> - <div class="body"> - <h6><% out.print( e.getNombre() ); %></h6> - <button class="btn btn-desSeguir" data-user="<% out.print( e.getNick()); %>"> <i class="fas fa-times"></i> </button> - </div> + header{ + background: url(./img/gb-user.jpg); + } + .flex-column { + padding: 0px; + } + .tab-content { + padding: 20px; + } + .tab-content h1{ + margin-bottom: 10px; + color: #333; + text-align: center; + font-size: 24px; + } + .tab-content b{ + width: 100px; + display: inline-block; + } + </style> + </head> + <body> + <%@include file="../nav.jspf" %> + <%@include file="../msg.jspf" %> + <form class="form-usuario container"> + <div class="row"> + <div class="col-8 main card "> + <div class="tab-content" id="v-pills-tabContent"> + <%if (user != null) {%> + <div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab"> + <h1>Información </h1> + <label><b>Nombre </b> <% out.print(user.getNombre()); %></label><br> + <label><b>Apellido </b> <% out.print(user.getApellido()); %></label><br> + <label><b>Web </b> <a href="#"><% out.print(user.getUrl()); %></a></label><br> + <label><b>Email </b> <% out.print(user.getEmail()); %></label><br> + <label><b>Descripción </b></label><br> </div> - <% } %> - </div> - </div> - <div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab"> - <h1>Usuarios me siguen </h1> - <div class="box-cards-center"> - <% for (DtUsuario e : sigo) {%> - <div class="cards-seguidor"> - <img class="user-creador" src="avatar.png"> - <div class="body"> - <h1><% out.print( e.getNombre() ); %></h1> - </div> - </div> - <% } %> - </div> - - </div> - <div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab"> - - <div class="box-cards-center"> - - <% for (DtPropuesta e : pruepuestas) {%> - <!-- Cards propuestas para colaborador --> - <div class="cards-propuestas"> - <div class="body"> - <h1><% out.print( e.getTitulo() ); %></h1> - <p><% out.print( e.getDescripcion() ); %></p> - <span class="colaboracion"> - <b>Colaborasion: </b>$100 el 07/10/2018 - </span> - <div class="estado" data-estado="3"> - <div> - <span></span><span></span><span></span><span></span><span></span> - </div> + <% } %> + <div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab"> + <h1>Ususario seguidos</h1> + <div class="box-cards-center"> + <%if (seguidores != null && seguidores.size() > 0) {%> + <% for (DtUsuario e : seguidores) {%> + <div class="cards-seguidor"> + <img class="user-creador" src="avatar.png"> + <div class="body"> + <h6><% out.print(e.getNombre()); %></h6> + <button class="btn btn-desSeguir" data-user="<% out.print(e.getNick()); %>"> <i class="fas fa-times"></i> </button> + </div> + </div> + <% } %> + <% } else { %> + <h1>No se encontraron Segiuidores</h1> + <% } %> </div> - </div> - <div class="footer"> - <img class="user-creador" src="avatar.png"> - Usuario creador - </div> </div> - <% } %> - <% for (DtPropuesta e : pruepuestas) {%> - <!-- Cards propuestas para creador --> - <div class="cards-propuestas"> - <div class="body"> - <span class="total">54</span> - <h1><% out.print( e.getTitulo() ); %></h1> - <p><% out.print( e.getDescripcion() ); %></p> - <div class="estado" data-estado="2"> - <div> - <span></span><span></span><span></span><span></span><span></span> - </div> + <div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab"> + <h1>Usuarios me siguen </h1> + <div class="box-cards-center"> + <%if (sigo != null && sigo.size() > 0) {%> + <% for (DtUsuario e : sigo) {%> + <div class="cards-seguidor"> + <img class="user-creador" src="avatar.png"> + <div class="body"> + <h1><% out.print(e.getNombre()); %></h1> + </div> + </div> + <% } %> + <% } else { %> + <h1>No se encontraron Segiuidores</h1> + <% } %> </div> - </div> - <div class="footer"> - <button class="btn btn-primary btn-extender" data-user="<% out.print( e.getTitulo()); %>"> Extender </button> - <button class="btn btn-danger btn-cancelar" data-user="<% out.print( e.getTitulo()); %>"> Cancelar </button> - </div> </div> - <% } %> - + <div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab"> + <div class="box-cards-center"> + <%if (Favoritos != null) {%> + <% for (DtPropuesta e : Favoritos) {%> + <!-- Cards propuestas para colaborador --> + <div class="cards-propuestas"> + <div class="body"> + <h1><% out.print(e.getTitulo()); %></h1> + <p><% out.print(e.getDescripcion()); %></p> + <span class="colaboracion"> + <b>Colaborasion: </b>$100 el 07/10/2018 + </span> + <div class="estado" data-estado="3"> + <div> + <span></span><span></span><span></span><span></span><span></span> + </div> + </div> + </div> + <div class="footer"> + <img class="user-creador" src="avatar.png"> + Usuario creador + </div> + </div> + <% } %> + <% } else { %> + <h1>No se encontraron Segiuidores</h1> + <% } %> + <%if (Creo != null) {%> + <% for (DtPropuesta e : Creo) {%> + <!-- Cards propuestas para creador --> + <div class="cards-propuestas"> + <div class="body"> + <span class="total">54</span> + <h1><% out.print(e.getTitulo()); %></h1> + <p><% out.print(e.getDescripcion()); %></p> + <div class="estado" data-estado="2"> + <div> + <span></span><span></span><span></span><span></span><span></span> + </div> + </div> + </div> + <div class="footer"> + <button class="btn btn-primary btn-extender" data-user="<% out.print(e.getTitulo()); %>"> Extender </button> + <button class="btn btn-danger btn-cancelar" data-user="<% out.print(e.getTitulo()); %>"> Cancelar </button> + </div> + </div> + <% } %> + <% } else { %> + <h1>No se encontraron Segiuidores</h1> + <% } %> + </div> + </div> + </div> + </div> + <div class="col-4"> + <div class="card cards-usuario"> + <%if (user != null) {%> + <img class="user-creador" src="<% out.print("data:image/jpeg;base64,"+ Base64.getEncoder().encodeToString(user.getImg())); %>"> + <h6 class="user-type"><% out.print(user.getType()); %></h6> + <h1 class="user-name"><% out.print(user.getNick());%></h1> + <% }%> + <% if (yo != null && yo != user.getNick()) { %> + <button class="btn btn-primary btn-Seguir" data-user="<% out.print(user.getNick());%>">Seguir</button> + <% }%> + + </div> + <div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical"> + <a class="nav-link active" id="v-pills-home-tab" data-toggle="pill" href="#v-pills-home" role="tab" aria-controls="v-pills-home" aria-selected="true">Información</a> + <a class="nav-link" id="v-pills-profile-tab" data-toggle="pill" href="#v-pills-profile" role="tab" aria-controls="v-pills-profile" aria-selected="false">Segidores</a> + <a class="nav-link" id="v-pills-messages-tab" data-toggle="pill" href="#v-pills-messages" role="tab" aria-controls="v-pills-messages" aria-selected="false">Seguidos</a> + <a class="nav-link" id="v-pills-settings-tab" data-toggle="pill" href="#v-pills-settings" role="tab" aria-controls="v-pills-settings" aria-selected="false">Favoritos</a> + <a class="nav-link" id="v-pills-settings-tab" data-toggle="pill" href="#v-pills-settings" role="tab" aria-controls="v-pills-settings" aria-selected="false">Creación</a> + </div> </div> - - </div> </div> - </div> - <div class="col-4"> - <div class="card cards-usuario"> - <img class="user-creador" src="<% out.print(user.getImg()); %>"> - <h6 class="user-type"><% out.print(user.getType()); %></h6> - <h1 class="user-name"><% out.print(user.getNick()); %></h1> - </div> - <div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical"> - <a class="nav-link active" id="v-pills-home-tab" data-toggle="pill" href="#v-pills-home" role="tab" aria-controls="v-pills-home" aria-selected="true">Información</a> - <a class="nav-link" id="v-pills-profile-tab" data-toggle="pill" href="#v-pills-profile" role="tab" aria-controls="v-pills-profile" aria-selected="false">Segidores</a> - <a class="nav-link" id="v-pills-messages-tab" data-toggle="pill" href="#v-pills-messages" role="tab" aria-controls="v-pills-messages" aria-selected="false">Seguidos</a> - <a class="nav-link" id="v-pills-settings-tab" data-toggle="pill" href="#v-pills-settings" role="tab" aria-controls="v-pills-settings" aria-selected="false">Favoritos</a> - <a class="nav-link" id="v-pills-settings-tab" data-toggle="pill" href="#v-pills-settings" role="tab" aria-controls="v-pills-settings" aria-selected="false">Creación</a> - </div> - </div> - </div> - </form> + </form> - </body> + </body> </html> diff --git a/l2g4/web/page/user/perfil-usuario_no_encontrado.jsp b/l2g4/web/page/user/perfil-usuario_no_encontrado.jsp index 858bd327115c7d963977f063db8ffadfee1516f1..d251ce30be1115b08ed82308de7d7258ff8dfdb3 100644 --- a/l2g4/web/page/user/perfil-usuario_no_encontrado.jsp +++ b/l2g4/web/page/user/perfil-usuario_no_encontrado.jsp @@ -11,81 +11,81 @@ <%@page import="datatype.DtUsuario"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <% - List<DtUsuario> seguidores = (ArrayList<DtUsuario>)request.getAttribute("seguidores"); - List<DtUsuario> sigo = (ArrayList<DtUsuario>)request.getAttribute("seguidores"); - List<DtPropuesta> pruepuestas = (ArrayList<DtPropuesta>)request.getAttribute("pruepuestas"); - DtProponente user = (DtProponente)request.getAttribute("perfiluser"); + List<DtUsuario> seguidores = (ArrayList<DtUsuario>) request.getAttribute("seguidores"); + List<DtUsuario> sigo = (ArrayList<DtUsuario>) request.getAttribute("seguidores"); + List<DtPropuesta> pruepuestas = (ArrayList<DtPropuesta>) request.getAttribute("pruepuestas"); + DtProponente user = (DtProponente) request.getAttribute("perfiluser"); %> <!DOCTYPE html> <html lang="en" dir="ltr"> - <head> - <!-- Latest compiled and minified CSS --> - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> - <!-- jQuery library --> - <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> - <!-- Popper JS --> - <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> - <!-- Bootstrap --> - <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> - <!-- Fontawesome --> - <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> - <!-- Estilos --> - <link rel="stylesheet" href="./css/cards-propuesta.css"> - <link rel="stylesheet" href="./css/cards-usuario.css"> - <link rel="stylesheet" href="./css/footer.css"> - <link rel="stylesheet" href="./css/header.css"> - <link rel="stylesheet" href="./css/msg.css"> - <link rel="stylesheet" href="./css/pagination.css"> - <link rel="stylesheet" href="./css/style.css"> - <link rel="stylesheet" href="./css/title.css"> - <link rel="stylesheet" href="./css/form-propuesta.css"> - <link rel="stylesheet" href="./css/cards-seguir.css"> + <head> + <!-- Latest compiled and minified CSS --> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> + <!-- jQuery library --> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> + <!-- Popper JS --> + <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> + <!-- Bootstrap --> + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> + <!-- Fontawesome --> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> + <!-- Estilos --> + <link rel="stylesheet" href="./css/cards-propuesta.css"> + <link rel="stylesheet" href="./css/cards-usuario.css"> + <link rel="stylesheet" href="./css/footer.css"> + <link rel="stylesheet" href="./css/header.css"> + <link rel="stylesheet" href="./css/msg.css"> + <link rel="stylesheet" href="./css/pagination.css"> + <link rel="stylesheet" href="./css/style.css"> + <link rel="stylesheet" href="./css/title.css"> + <link rel="stylesheet" href="./css/form-propuesta.css"> + <link rel="stylesheet" href="./css/cards-seguir.css"> - <!-- Script --> - <script src="./js/loder.js"></script> - <script src="./js/app-ajax.js"></script> + <!-- Script --> + <script src="./js/loder.js"></script> + <script src="./js/app-ajax.js"></script> - <!-- MetaData --> - <title>Culturarte-G4</title> - <meta name="description" content="Web para el obligatorio 2"> - <meta name="keywords" content="HTML,CSS,JavaScript,jQuery,Popper,Bootstrap"> - <meta name="author" content="G-4"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta charset="utf-8"> - <style> + <!-- MetaData --> + <title>Culturarte-G4</title> + <meta name="description" content="Web para el obligatorio 2"> + <meta name="keywords" content="HTML,CSS,JavaScript,jQuery,Popper,Bootstrap"> + <meta name="author" content="G-4"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta charset="utf-8"> + <style> - header{ - background: url(./img/gb-user.jpg); - } - .flex-column { - padding: 0px; - } - .tab-content { - padding: 20px; - } - .tab-content h1{ - margin-bottom: 10px; - color: #333; - text-align: center; - font-size: 24px; - } - .tab-content b{ - width: 100px; - display: inline-block; - } - </style> - </head> - <body> - <%@include file="../nav.jspf" %> - <%@include file="../msg.jspf" %> - <section> - <img class="text-center svg" src="./img/noEncontrado.svg"> - </section> - <header> - <h1 class="title">No se encontro el usuario</h1> - </header> - <p class="text-center m-5">El usuario al que desea acceder no se encuntra disponible.</p> - </body> + header{ + background: url(./img/noEncontrado.svg); + background-position: bottom; + background-repeat: no-repeat; + padding: 50px; + background-color: indianred; + } + .flex-column { + padding: 0px; + } + .tab-content { + padding: 20px; + } + .tab-content h1{ + margin-bottom: 10px; + color: #333; + text-align: center; + font-size: 24px; + } + .tab-content b{ + width: 100px; + display: inline-block; + } + </style> + </head> + <body> + <%@include file="../nav.jspf" %> + <%@include file="../msg.jspf" %> + <header> + <h1 class="title">No se encontro el usuario</h1> + </header> + </body> </html> diff --git a/l2g4/web/page/user/registro-usuario.jsp b/l2g4/web/page/user/registro-usuario.jsp index 24030fff014681c2e0236a55d238ceb14f11ca3b..f9ae87cb14c47dc4a8346829accd51fda4f633bd 100644 --- a/l2g4/web/page/user/registro-usuario.jsp +++ b/l2g4/web/page/user/registro-usuario.jsp @@ -10,7 +10,7 @@ <head> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> - + <!-- Estilos --> <link rel="stylesheet" href="./css/cards-propuesta.css"> <link rel="stylesheet" href="./css/cards-seguir.css"> @@ -41,7 +41,15 @@ <script type="text/javascript"> /* Formularios */ function pasarPagina(newPage) { - $('.form-usuario.main').prop("class", "form-usuario main " + newPage); + if (newPage == "img" && ($("#nombre").val() == "" || + $("#apellido").val() == "" || + $("#email").val() == "" || + $("#fnac").val() == "" || + $("#nick").val() == "" )) { + alert("Faltan campos requeridos"); + } else { + $('.form-usuario.main').prop("class", "form-usuario main " + newPage); + } } function typeUser() { if (document.getElementById("typeProponente").checked) { @@ -56,10 +64,7 @@ <body> <%@include file="../nav.jspf" %> <%@include file="../msg.jspf" %> - - <header> - <h1 class="title">Registro de usuario</h1> - </header> + <br> <form class="form-usuario main type"> <input type="hidden" name="metodo" value="NuevoUsuario"> <div class="progreso"> @@ -87,7 +92,6 @@ </div> <div class="page info"> <h1>Información</h1> - <div class="row"> <div class="col-md-6 mb-3"> <label for="nombre">Nombre</label> @@ -161,8 +165,8 @@ <h1>Imagen</h1> <p>La imagen no es obligatoria</p> <div class="marco-img"> - <img id="img-prev" src="avatar.png" name="img"> - <input id="img" type="file"> + <img id="img-prev" src="./img/upload.svg" name="img"> + <input id="img" type="file" onchange="document.getElementById('img-prev').src = this.value"> </div> <div style="display: flex;"> <input type="button" class="btn btn-primary" onclick="pasarPagina('info')" value="Atras"> @@ -170,7 +174,7 @@ </div> </div> </form> - + <!-- jQuery library --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <!-- Popper JS --> @@ -179,8 +183,8 @@ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> <script src="./js/lib/moment.js"></script> <script src="./js/lib/bootstrap-datetimepicker.js"></script> - <!-- Script + <!-- Script --> <script src="./js/loder.js"></script> - <script src="./js/app-ajax.js"></script>--> + <script src="./js/app-ajax.js"></script> </body> </html> \ No newline at end of file