diff --git a/l2g4/build/web/WEB-INF/classes/controladores/addPropuesta.class b/l2g4/build/web/WEB-INF/classes/controladores/addPropuesta.class index 0e58b3ede53e9abd7178e31e9825fdaa50101364..1c675362e6c434321d04e2465d9e142acb288dc1 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/addUser$1.class b/l2g4/build/web/WEB-INF/classes/controladores/addUser$1.class new file mode 100644 index 0000000000000000000000000000000000000000..ae3a7e985a9aa5cfe1cf7ccfd40eb816418719f9 Binary files /dev/null and b/l2g4/build/web/WEB-INF/classes/controladores/addUser$1.class differ diff --git a/l2g4/build/web/WEB-INF/classes/controladores/addUser.class b/l2g4/build/web/WEB-INF/classes/controladores/addUser.class index 5cb5e37d582b44a45d72decd0fe9d95ab0a27eda..2aca1c75cf5451d3f590189b76e244e983bfcc27 100644 Binary files a/l2g4/build/web/WEB-INF/classes/controladores/addUser.class and b/l2g4/build/web/WEB-INF/classes/controladores/addUser.class differ diff --git a/l2g4/build/web/WEB-INF/classes/controladores/conexionServidor.class b/l2g4/build/web/WEB-INF/classes/controladores/conexionServidor.class new file mode 100644 index 0000000000000000000000000000000000000000..c67788f6bf7ae13ff75def9bd3015da904ad0ca0 Binary files /dev/null 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..0fc69a23475d4d1dd96706f30b84cfd6b3d845f3 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 661942b62b4f591d57843a1c1a9cb563820f299b..2d1b890ee5f0519635df1efa013d8ac1fc82b619 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..43d84ac4887d9b48d77c7d61a06289beff1e3fde 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 0916064ca53dbd354da6c5293b0b118d85cb9e0d..a21ca0017c2cc028e9662f897a55e5223f7a6e77 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/g4-prog-app-lab1.jar b/l2g4/build/web/WEB-INF/lib/g4-prog-app-lab1.jar index c01b83a7997396ef3bf468e46b060614ee23f62f..6853b2c1adcf1cc9afee5f6d3704488d5dcd63b1 100644 Binary files a/l2g4/build/web/WEB-INF/lib/g4-prog-app-lab1.jar and b/l2g4/build/web/WEB-INF/lib/g4-prog-app-lab1.jar differ diff --git a/l2g4/build/web/css/footer.css b/l2g4/build/web/css/footer.css index cb1f62cb7200e70c49c0b395c940b2336e3f0580..dccfe1b664abfcdf9376dbd44af15d70d4ac9781 100644 --- a/l2g4/build/web/css/footer.css +++ b/l2g4/build/web/css/footer.css @@ -5,7 +5,8 @@ footer { display: flex; justify-content: center; - background: rgba(0,0,0,.1); + background: rgba(0,0,0,.04); color: #666; padding: 10px; + } diff --git a/l2g4/build/web/css/header.css b/l2g4/build/web/css/header.css index fd779ab83d51e9c3088cb5054f08304dbaeb9cb5..b27d470705b48c4adbf41e67eed187f8c421d405 100644 --- a/l2g4/build/web/css/header.css +++ b/l2g4/build/web/css/header.css @@ -4,32 +4,42 @@ */ 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; + box-shadow: 0px 4px 8px -3px rgba(17, 17, 17, .06); + padding: 0px; background: #fff; - border-bottom: solid 3px #333; +} +nav .container{ display: flex; justify-content: space-between; align-items: center; + } .logo { margin: 0 10px 0 10PX; float: none; font-size: 20px; padding: 7px 14px; + /* border: solid 2px #333; font-family: 'Cabin Sketch', cursive; + */ display: inline-block; 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 +71,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 +82,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/propuesta.css b/l2g4/build/web/css/propuesta.css new file mode 100644 index 0000000000000000000000000000000000000000..e94d1bea6afd371a6c4023420b7548aac503a8a5 --- /dev/null +++ b/l2g4/build/web/css/propuesta.css @@ -0,0 +1,111 @@ +/* + Titulo: Style + Description: Estilos generales +*/ + +.perfil_img img { + width: 100% +} +.loder{ + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: -9999; + background: none; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} +.animation{ + height: 200px; + width: 200px; + display: flex; + justify-content: center; + align-items: center; + margin-bottom: -100px; +} +.animation::after{ + content: ""; + height: 100px; + width: 100px; + border: solid 5px #222; + display: block; + position: relative; + -webkit-animation: none; + animation: none; + opacity: 0; + transition: all .5s; +} +.loder.active { + z-index: 9999; + background: rgba(255,255,255,.8); +} +.loder.active .animation::after{ + -webkit-animation: animate-stripes 5s ease infinite; + animation: animate-stripes 2s ease infinite; + opacity: 1; +} +@-webkit-keyframes animate-stripes { + 0% { + height: 200px; + width: 200px; + opacity: 0; + transform: rotate(0deg); + -moz-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + } + 50% { + height: 10px; + width: 10px; + opacity: 1; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + } + 100% { + height: 200px; + width: 200px; + opacity: 0; + transform: rotate(360deg); + -moz-transform: rotate(360deg); + -webkit-transform: rotate(360deg); + } +} + +@keyframes animate-stripes { + 0% { + height: 200px; + width: 200px; + opacity: 0; + transform: rotate(0deg); + -moz-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + } + 50% { + height: 10px; + width: 10px; + opacity: 1; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + } + 100% { + height: 200px; + width: 200px; + opacity: 0; + transform: rotate(360deg); + -moz-transform: rotate(360deg); + -webkit-transform: rotate(360deg); + } +} +.desc{ + margin-bottom: 0; + color: #666; +} +.desc span{ + color: #333; + font-weight: 500; +} diff --git a/l2g4/build/web/css/style.css b/l2g4/build/web/css/style.css index fafc02a7367243cd6e254e62fb1f0ce7ca2be992..593160b7e052860ad879fc61c7b223aa29e0c842 100644 --- a/l2g4/build/web/css/style.css +++ b/l2g4/build/web/css/style.css @@ -4,7 +4,7 @@ */ * { box-sizing: border-box;} body { - background-color: #f0f0f0; + background-color: #fafafa; } .box-cards-center { display: flex; @@ -25,7 +25,9 @@ body { margin: 0 5px; box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12); } - +.cot{ + width: auto!important; +} .svg { max-width: 100%; margin: 20px auto 0; @@ -34,4 +36,180 @@ body { position: fixed; bottom: 0; right: 10px; +} + + +.msjNone{ + margin: 40px; + color: #999; +} + +.Acard{ + text-decoration: none; + color: #333; + text-align: center; +} + + +.img-cir{ + display: block; + border-radius: 50%; + width: 100px !important; + height: 100px !important; + margin: 40px auto 0; +} + +.div-felx { + display: flex; +} + +.card{ + border: none!important; +} +.imgNo{ + position: absolute; + width: 100px; + bottom: 0; +} +.box-cards-center h1 { + + color: #aaa; + margin-top: 50px; + font-weight: 100; +} + +.btn-like{ + position: absolute; + z-index: 2; + color: #fff; + background: rgba(0,0,0,.2); + width: 40px; + height: 40px; + font-size: 24px; + display: flex; + justify-content: center; + align-items: center; + border-radius: 50%; + top: 5px; + right: 5px; + cursor: pointer; +} +.colaborador { + width: auto; +} +.text-center{ + text-align: center; + margin: 10px auto; + color: #666; +} + +/* Comentarios */ +.clearfix { + overflow: auto; + zoom: 1; +} +.feed-container{ + margin:auto; +} +.feed-border{ + background:#fff; + width:600px; + box-shadow:0px 1px 0px 2px rgba(51, 51, 51, 0.1); + border-radius: 1px; + margin:15px 0px; +} +.feed-options{ + position:absolute; + left:600px; + color: #808080; + cursor:pointer; +} +.feed-content,.feed-avatar{ + float:left; + +} +.feed-avatar{ + margin: 10px 10px; +} +.feed-content{ + margin: 20px 5px; + width:80%; +} +.feed-avatar img{ + border-radius:50%; +} +.feed-footer{ + padding-top:10px; + background: rgba(0,0,0,.01); +} +.feed-footer .footer-left{ + float:left; + margin:0px 15px 10px 15px; + font-size:14px; +} +.feed-footer .footer-right{ + float:right; + margin:0px 15px 10px 0px; + font-size:14px; +} +.footer-time{ + color: #808080; + cursor:pointer; +} +.feed-footer a{ + color:#808080; +} +.feed-footer a:hover{ + color:#333; +} + +.feed-send{ + width: auto; + margin: 5px auto; + display: block; +} +.feed-msg { + width: 100%; + height: 200px; + margin: 0; + display: block; + border: none; + resize: none; +} + + +.cot { + background: #007aff; + padding: 5px 15px 7px; + margin: 5px; + border-radius: 3px; + color: #eee; + display: inline-block; + transition: all .2s; +} + +.cot:hover { + box-shadow: 0 0 7px rgba(33,33,33,.2); + color: #fff; + text-decoration: none; + outline: none +} +.cat-box { + width: 100%; + display: flex; + flex-wrap: wrap; + align-content: center; + justify-content: center; +} +.search{ + box-shadow: 0 2px 11px rgba(0,0,0,.5); + border: none; + background: rgba(255,255,255,.8); + transition: all .5s; +} +.search:hover{ + box-shadow: 0 2px 7px rgba(0,0,0,1); +} +.search:focus,.search:active{ + background: rgba(255,255,255,.9); } \ 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..fce245bb723f5540b0bfa7e8eeb900167887f22e 100644 --- a/l2g4/build/web/js/app-ajax.js +++ b/l2g4/build/web/js/app-ajax.js @@ -2,11 +2,13 @@ $(document).ready(function () { $('#btn-login').click(function () { funcionLogin(); }); + $('#loginNick').keyup(function (e) { if (e.keyCode == 13) { funcionLogin(); } }); + $('#loginPass').keyup(function (e) { if (e.keyCode == 13) { funcionLogin(); @@ -21,27 +23,45 @@ $(document).ready(function () { let propuesta = $(this).prop("data-user"); funcionExtenderFinanciación(propuesta); }); + $('#btn-cancelar').click(function () { let propuesta = $(this).prop("data-user"); funcionCancelarPropuesta(propuesta) }); - $('#btn-desSeguir').click(function () { - let user = $(this).prop("data-user"); - funcionDejarSeguirUsuario(user); + + $('.btn-Seguir').click(function () { + let user = $(this).attr("data-user"); + funcionSeguirUsuario(user); }); + $('.btn-desSeguir').click(function () { + event.preventDefault(); + let user = $(this).attr("data-user"); + funcionDejarSeguirUsuario(user); + }); - /* - $('#btn-new-user').click(function () { - funcionNuevoUsaurio(); - });*/ - $("form").submit(function (event) { - + $('.btn-like').click(function () { + event.preventDefault(); + let titulo = $(this).attr("data-titulo"); + funcionPropuestaFavorita(titulo); }); + $('#btn-new-user').click(function () { + funcionAltaPerfil(); + }); + + $('#btn-new-propuesta').click(function () { + funcionAltaPropuesta(); + }); + + $('.btn-send').click(function () { + event.preventDefault(); + let prop = $(this).attr("data-prop"); + let msg = $("#feed-msg").val(); + funcionComentario(prop,msg); + }); $("#img").change(function () { - if (this.files && this.files[0]) { var reader = new FileReader(); reader.onload = function (e) { @@ -52,7 +72,7 @@ $(document).ready(function () { }); }); -function funcionMandaFormulario(type, url, cadena) { +function funcionMandaFormulario(type, url, cadena, success,error) { $.ajax({ url: url, type: type, @@ -63,10 +83,12 @@ function funcionMandaFormulario(type, url, cadena) { success: function (responseText) { alert(responseText); cargar(false); + success(); }, error: function (jqXHR, textStatus) { alert(textStatus); cargar(false); + error(); } }); } @@ -76,7 +98,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 ----------------------------------------------------------*/ @@ -134,22 +156,25 @@ function funcionLogin() { }); } } - /* Alta de Propuesta ---------------------------------------------------------*/ 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 ----------------------------------------*/ function funcionRegistrarColaboración() { - event.preventDefault(); var type = "POST"; var url = 'colaboracion'; - var cadena = $(this).serialize();// - funcionMandaFormulario(type, url, cadena); + var data = { + monto:$("#monto").val(), + porsentaje:document.getElementById('porsentaje').checked, + entrada:document.getElementById('entrada').checked, + metodo: "colaboracion" + }; + funcionMandaFormulario(type, url, data); } /* Extender Financiación -----------------------------------------------------*/ function funcionExtenderFinanciación( propuesta) { @@ -294,14 +319,13 @@ function funcionDejarSeguirUsuario(asegido) { }); } /* Marcar Propuesta como Favorita --------------------------------------------*/ -function funcionPropuestaFavorita(propuesta,usuario) { +function funcionPropuestaFavorita(propuesta) { $.ajax({ url: 'user', type: 'POST', data: { metodo: "Favorita", propuesta: propuesta, - usuario: usuario }, beforeSend: function () { cargar(true); diff --git a/l2g4/build/web/page/ListaUsuario/index.jsp b/l2g4/build/web/page/ListaUsuario/index.jsp new file mode 100644 index 0000000000000000000000000000000000000000..2e79b10ee770eeadc0e925a65e05e0ca4b8ba449 --- /dev/null +++ b/l2g4/build/web/page/ListaUsuario/index.jsp @@ -0,0 +1,97 @@ +<%-- + Document : index + Created on : 12-oct-2018, 19:12:22 + Author : pecaa +--%> + +<%@page import="java.util.ArrayList"%> +<%@page import="java.util.List"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<!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" %> + <div class="container"> + + <% + String user = null; + if (request.getAttribute("usuarios") != null) { + user = (String) request.getAttribute("usuarios"); + } + if (user != null && user != "") { + out.print("<h1 class='text-center m-5'>Usuarios</h1>"); + out.print("<div class='row'>"); + out.print(user); + out.print("</div>"); + } else { + out.print("<h1 class='text-center'>No se encontraron usuarios</h1>"); + } + %> + </div> + </div> + </div> +</main> + +</body> +</html> diff --git a/l2g4/build/web/page/ListaUsuario/main.jspf b/l2g4/build/web/page/ListaUsuario/main.jspf new file mode 100644 index 0000000000000000000000000000000000000000..a45d35f97fafd3c582c744d48708c6ae7dfed837 --- /dev/null +++ b/l2g4/build/web/page/ListaUsuario/main.jspf @@ -0,0 +1,16 @@ +<%-- any content can be specified here e.g.: --%> +<%@page import="java.util.ArrayList"%> +<%@page import="java.util.List"%> +<%@ 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/index/index.jsp b/l2g4/build/web/page/index/index.jsp new file mode 100644 index 0000000000000000000000000000000000000000..68727483627403095e6aa5500173fdf2730dd824 --- /dev/null +++ b/l2g4/build/web/page/index/index.jsp @@ -0,0 +1,121 @@ +<%-- + Document : index + Created on : 12-oct-2018, 19:12:22 + Author : pecaa +--%> + +<%@page import="java.util.ArrayList"%> +<%@page import="java.util.List"%> +<%@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"> + <div class="container"> + <div class="row"> + <% if (categorias != null && categorias != "") {%> + <div class="col-md-8 col-sm-12 "> + <h2 class="text-center m-5">Propuestas</h2> + <div class="row"> + <%@include file="main.jspf" %> + </div> + </div> + <div class="col-md-4 col-sm-12 "> + <h2 class="text-center m-5">Categorioas</h2> + <div class="cat-box"> + <% out.print(categorias);%> + </div> + </div> + <% } else {%> + <div class="col-md-12 col-sm-12 "> + <h2 class="text-center m-5">Propuestas</h2> + <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..a45d35f97fafd3c582c744d48708c6ae7dfed837 --- /dev/null +++ b/l2g4/build/web/page/index/main.jspf @@ -0,0 +1,16 @@ +<%-- any content can be specified here e.g.: --%> +<%@page import="java.util.ArrayList"%> +<%@page import="java.util.List"%> +<%@ 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..185a087551687c98ba24f71a660365515749167f 100644 --- a/l2g4/build/web/page/nav.jspf +++ b/l2g4/build/web/page/nav.jspf @@ -2,54 +2,53 @@ <%@ 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 estado = "logeado"; - if (idUser == null){ - estado = "Visitante"; - } + + String nameUser = (String) session.getAttribute("userName"); + String imgUser = "data:image/jpeg;base64," + (String) session.getAttribute("imgUser"); + + String estado = "logeado"; + if (nameUser == null) { + estado = "Visitante"; + } %> <nav> - <div class="logo"> - Culturarte - </div> - <div class="tools <% out.print( estado ); %>"> - - <% if (idUser != null ) { %> - <!-- User logeado--> - <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" id="btn-logout">Salir</a> - </ul> - <div class="dropdown-toggle" data-toggle="dropdown"> - <label class="name-user"><% out.print( nameUser ); %></label> - <img class=" user-creador" src="<% out.print( imgUser ); %>"> + <div class="container"> + <div class="logo"> + Culturarte + </div> + <div class="tools <% out.print(estado); %>"> + + <% if (nameUser != null) { %> + <!-- User logeado--> + <a href="/g4/?usuarios" data-toggle="tooltip" data-placement="bottom" title="Busca usuarios"><i class="fas fa-users"></i></a> + <a href="/g4/addPropuesta" data-toggle="tooltip" data-placement="bottom" title="Crea propuesta"><i class="fas fa-lightbulb"></i></a> + <div class="logeado dropdown" data-toggle="dropdown" style="width: 150px; text-align: right;"> + <ul class="dropdown-menu" role="menu"> + <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"> + <label class="name-user"><% out.print(nameUser); %></label> + <img class=" user-creador" src="<% out.print(imgUser); %>"> + </div> </div> - </div> - <% } else { %> - <!-- Visitante --> - <div class="Visitante"> - <a href="registro-usuario.html">Registrarse</a> - <a href="login.html">Loguearse</a> - </div> - <% } %> - - - - <!-- Buscar --> - <div class="search"> - <input class="input-search" type="text"> - <button class="button-search">B</button> + <% } else { %> + <!-- Visitante --> + <div class="Visitante"> + <a href="addUser">Registrarse</a> + <a href="login">Loguearse</a> + </div> + <% }%> + + + + <!-- Buscar --> + <div class="search"> + <input class="input-search" type="text"> + <button class="button-search">B</button> + </div> + + + </div> </div> - - - </div> </nav> diff --git a/l2g4/build/web/page/propuesta/propuesta.jsp b/l2g4/build/web/page/propuesta/propuesta.jsp new file mode 100644 index 0000000000000000000000000000000000000000..7a4d9ac0f0788ce5314ac2afb599d301e2e74f61 --- /dev/null +++ b/l2g4/build/web/page/propuesta/propuesta.jsp @@ -0,0 +1,239 @@ +<%-- + Document : propuesta + Created on : 15-oct-2018, 18:27:20 + Author : pecaa +--%> + +<%@page import="Logica.datatype.DtComentario"%> +<%@page import="java.util.Base64"%> +<%@page import="java.util.ArrayList"%> +<%@page import="java.util.List"%> +<%@page import="Logica.datatype.DtPropuesta"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<% + Logica.datatype.DtPropuesta p = (Logica.datatype.DtPropuesta) request.getAttribute("propuesta"); + List<String> dsds = new ArrayList<>(); + String userType = (String) session.getAttribute("userType"); + +%> +<!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"> + <link rel="stylesheet" href="./css/propuesta.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/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; + } + .perfil_img img{ + width: 100%; + } + .perfil_img { + border: solid 1px #ddd; + border-radius: 3px; + overflow: hidden; + background: #eee; + } + .desc { + margin: 0; + color: #999; + + } + .desc span{ + color: #666; + font-weight: 700; + } + .categoria{ + font-size: 15px; + color: #666; + } + h3 { + font-size: 4rem; + margin-top: 0px; + margin-bottom: 20px; + } + .description { + width: 100%; + margin: 10px 0 20px; + } + </style> + </head> + <body> + <%@include file="../nav.jspf" %> + <%@include file="../msg.jspf" %> + <!-- + private String ; + private byte[] ; + private String ; + private Fecha ; + private float ; + private float ¿; + private float ; + private Date ; + private boolean retornoEntradas; + private boolean retornoPorcentajeGanancias; + private List<String> colaboradores = new ArrayList<>(); + private String ; + private String ; + private float ; + --> + + <section class="container"> + <div class="row m-5"> + <div class="col-md-6 col-sm-6 col-xs-12"> + <div class="perfil_img"> + <img src="data:image/jpeg;base64,<% out.print(Base64.getEncoder().encodeToString(p.getImagen())); %>" onerror="this.src='./img/404.png'"> + </div> + </div> + <div class="col-md-6 col-sm-6 col-xs-12"> + <div class="perfil_info"> + <a class="categoria" href="/g4/?categoria=<% out.print(p.getCategoria()); %>"><% out.print(p.getCategoria()); %></a> + <h3><% out.print(p.getTitulo()); %></h3> + <p class="desc"><% out.print(p.getRecaudado()); %>/<% out.print(p.getMontoNecesario()); %></p> + <p class="desc"><span>Publicado:</span> <% out.print(p.getFechaPublicacion()); %></p> + <p class="desc"><span>Finalisa:</span> <% out.print(p.getFechaPrevista()); %></p> + <p class="desc"><span>Precio Entrada:</span> <% out.print(p.getPrecioEntrada()); %></p> + <p class="desc"><span>Autor:</span><a href="/g4/user?user=<% out.print(p.getCreador()); %>"><% out.print(p.getCreador()); %></a></p> + <p class="desc"><span>Lugar</span><% out.print(p.getLugar()); %></p> + <% if (userType == "Colaborador") {%> + <button + type="button" + class="btn btn-info btn-lg" + data-toggle="modal" + data-target="#myColabaoracion" + style="margin: 20px 0 0 0;">Colabaora</button> + <% } %> + </div> + </div> + <% if (p.getDescripcion() != null && p.getDescripcion() != "") {%> + <div class="col-md-12 col-sm-6 col-xs-12 "> + <h4>Descripcion</h4> + <div class="description"><% out.print(p.getDescripcion()); %></div> + </div> + <% } %> + </div> + <div class="row "> + <% + if (p != null && p.getColaboradores().size() != 0) { + out.print("<h2 clss='text-center'>Muchas gracias a</h2>"); + for (String elem : p.getColaboradores()) { + out.print("<a class='btn btn-primary colaborador' href='/g4/user?user=" + elem + "'>" + elem + "</a>"); + } + } else { + out.print("<h2 clss='text-center'>Nadie a colaborado se el primero!</h2>"); + } + %> + </div> + <div class="row "> + <div class="feed-container"> + <div class="feed-border clearfix"> + <div class="feed-body clearfix"> + <div class="feed-avatar"> + <img src="http://a06.t26.net/taringa/avatares/A/6/F/9/A/0/OK/48x48_BCD.jpg" alt="" /> + </div> + <div class="feed-content"> + <a class="username" href="#">usuario</a> + <p>texto</p> + </div> + </div> + <div class="feed-footer clearfix"> + <div class="footer-left"> + <span class="footer-time">fecha</span> + </div> + </div> + </div> + <div class="feed-border clearfix"> + <div class="feed-body clearfix"><textarea id="feed-msg" class="feed-msg"></textarea></div> + <div class="feed-footer clearfix"><button + type="button" + data-prop="<% out.print(p.getTitulo()); %>" + class="btn btn-primary feed-send btn-send" + >Mandar</button></div> + + </div> + </div> + <% + if (p != null && p.getComentario().size() != 0) { + for (DtComentario c : p.getComentario()) { + } + } + %> + </div> + <a href="#" class="btn btn-sm main_btn"></a> + </div> + + <!-- Colabaoracion --> + <div id="myColabaoracion" class="modal fade" role="dialog"> + <div class="modal-dialog" id="RegistrarColaboracion"> + + <!-- Modal content--> + <div class="modal-content"> + <div class="modal-body"> + <p>Seleccione un tipo de la reconvensa, la cantidad que quiera donar y dele a el boton de Listo.</p> + <label class="radio-inline"><input type="radio" name="retorno" id="entrada" checked>Entrada </label><br> + <label class="radio-inline"><input type="radio" name="retorno" id="porsentaje">Porsentaje</label> + <div class="form-group"> + <label for="monto">Cantidad</label> + <input type="number" class="form-control" id="monto"> + </div> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="funcionRegistrarColaboración()">Listo</button> + <button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button> + </div> + </div> + + </div> + </div> + </section> +</body> +</html> diff --git a/l2g4/build/web/page/propuesta/registro-propuesta.jsp b/l2g4/build/web/page/propuesta/registro-propuesta.jsp index 22f3dba20921c7bc1427d60bd310db58c2c11f11..ff72c869fd131e48def8b52101ea7f8ada565255 100644 --- a/l2g4/build/web/page/propuesta/registro-propuesta.jsp +++ b/l2g4/build/web/page/propuesta/registro-propuesta.jsp @@ -4,189 +4,250 @@ 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"> + + + <!-- Fontawesome --> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> + + <!-- 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..192eae21dc69ce477067b924423634b364f77e0e 100644 --- a/l2g4/build/web/page/user/perfil-usuario.jsp +++ b/l2g4/build/web/page/user/perfil-usuario.jsp @@ -4,195 +4,222 @@ Author : pecaa --%> -<%@page import="datatype.DtPropuesta"%> +<%@page import="Logica.datatype.DtPropuesta"%> +<%@page import="Logica.datatype.DtUsuariosMauro"%> +<%@page import="Logica.datatype.DtUsuario"%> +<%@page import="java.util.Base64"%> <%@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"%> <% - 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<DtPropuesta> Favoritos = (ArrayList<DtPropuesta>) request.getAttribute("Creo"); + List<DtPropuesta> Creo = (ArrayList<DtPropuesta>) request.getAttribute("Favoritos"); + Logica.datatype.DtUsuariosMauro user = (Logica.datatype.DtUsuariosMauro) request.getAttribute("perfiluser"); + String yo = (String) request.getAttribute("yo"); + List<DtUsuario> seguidores = user.getSigo(); + List<DtUsuario> sigo = user.getSigo(); %> <!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> - </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> + 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"> + + <% + if (user != null){ + out.print("<h1>Información </h1>"); + if (user.getNombre() != null ){ out.print("<label><b>Nombre </b>" + user.getNombre() + "</label><br>"); }; + if (user.getApellido() != null ){ out.print("<label><b>Apellido </b>" + user.getApellido() + "</label><br>"); }; + if (user.getUrl() != null ){ out.print("<label><b>Web </b><a href='"+user.getUrl()+"'>" + user.getUrl() + "</a></label><br>"); }; + if (user.getEmail() != null ){ out.print("<label><b>Email </b>" + user.getEmail() + "</label><br>"); }; + if (user.getFnac() != null ){ out.print("<label><b>Naciminto </b>" + user.getFnac()+ "</label><br>"); }; + }else{ + out.print("<h1>No se encontraron Segiuidores</h1>"); + out.print("<img src='./img/noEncontrado.svg' class='imgNo'>"); + } + %> </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="data:image/jpeg;base64,<% out.print(Base64.getEncoder().encodeToString(e.getImg())); %>" onerror="this.src='./img/404.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> + <img src="./img/noEncontrado.svg" class="imgNo"> + <% } %> </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="data:image/jpeg;base64,<% out.print(Base64.getEncoder().encodeToString(e.getImg())); %>" onerror="this.src='./img/404.png'"> + <div class="body"> + <h1><% out.print(e.getNombre()); %></h1> + </div> + </div> + <% } %> + <% } else { %> + <h1>No se encontraron Segiuidores</h1> + <img src="./img/noEncontrado.svg" class="imgNo"> + <% } %> </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"> + <% out.print(e.getCreador()); %> + </div> + </div> + <% } %> + <% } else { %> + <h1>No se encontraron Segiuidores</h1> + <img src="./img/noEncontrado.svg" class="imgNo"> + <% } %> + <%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> + <img src="./img/noEncontrado.svg" class="imgNo"> + <% } %> + </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> - </body> + </form> + <footer>Equipo G4</footer> + </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..ce35ccb55f083e4a94bec42a0c58792646bb349a 100644 --- a/l2g4/build/web/page/user/perfil-usuario_no_encontrado.jsp +++ b/l2g4/build/web/page/user/perfil-usuario_no_encontrado.jsp @@ -4,88 +4,80 @@ 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"%> -<% - 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> + <!-- Fontawesome --> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> + + <!-- 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..961d85287bb19d86d91b22bd24288442b5647318 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"> @@ -24,6 +24,9 @@ <link rel="stylesheet" href="./css/form-usuario.css"> <link rel="stylesheet" href="./css/lib/bootstrap-datetimepicker.css"> + <!-- Fontawesome --> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> + <!-- MetaData --> <title>Culturarte-G4</title> @@ -41,7 +44,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 +67,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 +95,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> @@ -139,14 +146,14 @@ </div> <div class="mb-3 proponente"> <label for="link">link</label> - <input type="datetime-datetime-local" name="link" class="form-control" id="link" placeholder="direccion"> + <input type="text" name="link" class="form-control" id="link" placeholder="direccion"> <div class="invalid-feedback"> link es requerido. </div> </div> <div class="mb-3 proponente"> <label for="Biografia">Biografia</label> - <input type="datetime-datetime-local" name="Biografia" class="form-control" id="Biografia" placeholder="direccion"> + <input type="text" name="Biografia" class="form-control" id="Biografia" placeholder="direccion"> <div class="invalid-feedback"> El Biografia no es và lida. </div> @@ -161,8 +168,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 +177,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 +186,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/project.properties b/l2g4/nbproject/project.properties index c0b33babcd150165d3375e6b22dc262a4333b771..cc3265fcaafddefa74f5730d03043514dcf1e3aa 100644 --- a/l2g4/nbproject/project.properties +++ b/l2g4/nbproject/project.properties @@ -67,7 +67,7 @@ j2ee.compile.on.save=true j2ee.copy.static.files.on.save=true j2ee.deploy.on.save=true j2ee.platform=1.7-web -j2ee.platform.classpath=${j2ee.server.home}/lib/annotations-api.jar:${j2ee.server.home}/lib/catalina-ant.jar:${j2ee.server.home}/lib/catalina-ha.jar:${j2ee.server.home}/lib/catalina-storeconfig.jar:${j2ee.server.home}/lib/catalina-tribes.jar:${j2ee.server.home}/lib/catalina.jar:${j2ee.server.home}/lib/ecj-4.7.3a.jar:${j2ee.server.home}/lib/el-api.jar:${j2ee.server.home}/lib/jasper-el.jar:${j2ee.server.home}/lib/jasper.jar:${j2ee.server.home}/lib/jaspic-api.jar:${j2ee.server.home}/lib/jsp-api.jar:${j2ee.server.home}/lib/servlet-api.jar:${j2ee.server.home}/lib/tomcat-api.jar:${j2ee.server.home}/lib/tomcat-coyote.jar:${j2ee.server.home}/lib/tomcat-dbcp.jar:${j2ee.server.home}/lib/tomcat-i18n-es.jar:${j2ee.server.home}/lib/tomcat-i18n-fr.jar:${j2ee.server.home}/lib/tomcat-i18n-ja.jar:${j2ee.server.home}/lib/tomcat-i18n-ru.jar:${j2ee.server.home}/lib/tomcat-jdbc.jar:${j2ee.server.home}/lib/tomcat-jni.jar:${j2ee.server.home}/lib/tomcat-util-scan.jar:${j2ee.server.home}/lib/tomcat-util.jar:${j2ee.server.home}/lib/tomcat-websocket.jar:${j2ee.server.home}/lib/websocket-api.jar +j2ee.platform.classpath=${j2ee.server.home}/lib/annotations-api.jar:${j2ee.server.home}/lib/catalina-ant.jar:${j2ee.server.home}/lib/catalina-ha.jar:${j2ee.server.home}/lib/catalina-storeconfig.jar:${j2ee.server.home}/lib/catalina-tribes.jar:${j2ee.server.home}/lib/catalina.jar:${j2ee.server.home}/lib/ecj-4.7.3a.jar:${j2ee.server.home}/lib/el-api.jar:${j2ee.server.home}/lib/jasper-el.jar:${j2ee.server.home}/lib/jasper.jar:${j2ee.server.home}/lib/jaspic-api.jar:${j2ee.server.home}/lib/jsp-api.jar:${j2ee.server.home}/lib/org-netbeans-modules-java-j2seproject-copylibstask.jar:${j2ee.server.home}/lib/servlet-api.jar:${j2ee.server.home}/lib/tomcat-api.jar:${j2ee.server.home}/lib/tomcat-coyote.jar:${j2ee.server.home}/lib/tomcat-dbcp.jar:${j2ee.server.home}/lib/tomcat-i18n-es.jar:${j2ee.server.home}/lib/tomcat-i18n-fr.jar:${j2ee.server.home}/lib/tomcat-i18n-ja.jar:${j2ee.server.home}/lib/tomcat-i18n-ru.jar:${j2ee.server.home}/lib/tomcat-jdbc.jar:${j2ee.server.home}/lib/tomcat-jni.jar:${j2ee.server.home}/lib/tomcat-util-scan.jar:${j2ee.server.home}/lib/tomcat-util.jar:${j2ee.server.home}/lib/tomcat-websocket.jar:${j2ee.server.home}/lib/websocket-api.jar j2ee.server.type=Tomcat jar.compress=false javac.classpath=\ diff --git a/l2g4/src/java/controladores/addPropuesta.java b/l2g4/src/java/controladores/addPropuesta.java index b434ddf0e6d53ddc36cd4c09bc3c9cdd6296298c..fb839467a52d0e609d95932ab5023b255443f4d1 100644 --- a/l2g4/src/java/controladores/addPropuesta.java +++ b/l2g4/src/java/controladores/addPropuesta.java @@ -5,8 +5,10 @@ */ package controladores; +import Logica.*; 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; @@ -28,45 +30,45 @@ public class addPropuesta extends HttpServlet { RequestDispatcher dispatsh = request.getRequestDispatcher("page/propuesta/registro-propuesta.jsp"); dispatsh.forward(request, response); + String titulo= request.getParameter("titulo"); + String lugar= request.getParameter("lugar"); + String precioE= request.getParameter("precioEntrada"); + String fechaP= request.getParameter("fechaPrevista"); + String montoN= request.getParameter("montoNecesario"); + String descripcion= request.getParameter("descripcion"); + + // Deberian ser checkboxs + String porcGanancias= request.getParameter("formControlRange"); + String entradas= request.getParameter("exampleFormControlSelect1"); + + ISistema sys = null; + sys = Factory.getInstance(); + // DtPropuesta datosPropuesta= new DtPropuesta(titulo, descripcion, imagen, lugar, fechaPrevista, precioEntradas, montoNecesario, retornoE, retornoP, categoria); + // sys.altaPropuesta(nickUsrLog, categoria, datosPropuesta); + } - // <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/addUser.java b/l2g4/src/java/controladores/addUser.java index 897ab0ebe2d41b3ada349e32522f64044b5df2ec..3b3f7a16790ccefade0400e60c4161ebe2afbfb8 100644 --- a/l2g4/src/java/controladores/addUser.java +++ b/l2g4/src/java/controladores/addUser.java @@ -5,6 +5,7 @@ */ package controladores; +import Logica.*; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.RequestDispatcher; @@ -36,6 +37,103 @@ public class addUser extends HttpServlet { response.setContentType("text/html;charset=UTF-8"); RequestDispatcher dispatsh = request.getRequestDispatcher("page/user/registro-usuario.jsp"); dispatsh.forward(request, response); + + /* Preparo respuesta */ + String respuesta = "Error"; + + respuesta= agregarUsuario(request); + + /* respondo */ + response.setContentType("text/plain"); + response.getWriter().write(respuesta); + + } + + public String agregarUsuario(HttpServletRequest request){ + String nombre, apellido, email, fnac, nick, pass, tipo, dia, mes ,anio, retorno; + tipo= request.getParameter("type"); + boolean esColaborador= "Colaborador".equals(tipo); + + nombre= request.getParameter("nombre"); + apellido= request.getParameter("apellido"); + email= request.getParameter("email"); + fnac= request.getParameter("fnac"); + // Como carajos recupero bien la fecha + dia= "1"; + mes= "1"; + anio= "1999"; + nick= request.getParameter("nick"); + // falta la pass en el formulario + pass = ""; + // Avatar + byte[] fileContent= null; + + ISistema sys = null; + sys = Factory.getInstance(); + + Logica.datatype.Enum_Respuesta re = null; + if(esColaborador){ + Logica.datatype.DtColaborador c = new Logica.datatype.DtColaborador( + nick, + nombre, + apellido, + email, + fileContent, + dia, + mes, + anio, + pass, + tipo + ); + re = sys.crearUsuario(c); + } + else{ + String url, link, bio; + url= request.getParameter("url"); + link= request.getParameter("link"); + bio= request.getParameter("Biografia"); + Logica.datatype.DtProponente p = new Logica.datatype.DtProponente( + nick, + nombre, + apellido, + email, + url, + link, + bio, + fileContent, + dia, + mes, + anio, + pass, + tipo + ); + re = sys.crearUsuario(p); + } + + // Respuesta + String titulo, message; + switch (re) { + case exitoso: + titulo = "Todo salio bien"; + message = "Su usuario fue creado con exito.\n"; + break; + case fallido: + titulo = "Ups 0.0!"; + message = "Algun dato esta incorrecto.\n"; + break; + case error: + titulo = "Uy!"; + message = "Algo nos salio mal.\n"; + break; + default: + titulo = "Ahhh!"; + message = "Algo insperado paso.\n"; + + } + + retorno= titulo + ". " + message; + return retorno; + } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> @@ -77,4 +175,4 @@ public class addUser extends HttpServlet { return "Short description"; }// </editor-fold> -} +} \ No newline at end of file diff --git a/l2g4/src/java/controladores/conexionServidor.java b/l2g4/src/java/controladores/conexionServidor.java new file mode 100644 index 0000000000000000000000000000000000000000..c3ed226eaf740b3c4841c4f4a84912d5b5900010 --- /dev/null +++ b/l2g4/src/java/controladores/conexionServidor.java @@ -0,0 +1,91 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package controladores; + +import Logica.Factory; +import Logica.ISistema; +import Logica.datatype.DtPropuesta; +import Logica.datatype.DtUsuariosMauro; +import Logica.datatype.Fecha; +import java.util.List; + +/** + * + * @author Lucas + */ +public class conexionServidor { + private static ISistema sys = null; + + public conexionServidor(){ + sys = Factory.getInstance(); + } + + public static String seguirUsuario(String nickUsu, String nickUsuSeguir){ + sys = Factory.getInstance(); + return sys.seguirUsuario(nickUsu, nickUsuSeguir); + } + + public static String dejarSeguirUsuario(String nickUsu, String nickUsuDejarSeguir){ + sys = Factory.getInstance(); + return sys.dejarDeSeguirUsuario(nickUsu, nickUsuDejarSeguir); + } + + public static 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); + } + + public static DtPropuesta consultarPropuesta(String titulo){ + sys = Factory.getInstance(); + return sys.obtenerPropuesta(titulo); + } + + public static DtUsuariosMauro getUser(String userNick){ + sys = Factory.getInstance(); + return sys.getUsuariosMauro(userNick); + } + public static String Favorita(String user,String propuesta){ + sys = Factory.getInstance(); + return sys.marcarPropuestaComoFavorita(user,propuesta); + } + public static String NuevoPropuesta(String user, String categoria,String titulo,String lugar,String precioEntrada,String fechaPrevista,String montoNecesario,String descripcion,String retorno){ + sys = Factory.getInstance(); + Fecha f = new Fecha(); + String[] parts = fechaPrevista.split("-"); + if (parts.length == 3){ + f.setAnio(parts[0]); + f.setMes(parts[1]); + f.setDia(parts[2]); + }else{ + f.actualizarFecha(); + } + + DtPropuesta p = new DtPropuesta(titulo, descripcion, null, lugar, f, Integer.parseInt(precioEntrada), Integer.parseInt(montoNecesario), retorno == "entrada", retorno == "porsentaje", categoria, 0); + try { + sys.altaPropuesta(user,categoria,p); + return "Exito"; + } catch (Exception e) { + return e.getMessage(); + } + } + + +} diff --git a/l2g4/src/java/controladores/index.java b/l2g4/src/java/controladores/index.java new file mode 100644 index 0000000000000000000000000000000000000000..42f630b7a1559edd3b618b7b35e7efcc981cd024 --- /dev/null +++ b/l2g4/src/java/controladores/index.java @@ -0,0 +1,167 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package controladores; + +import Logica.Factory; +import Logica.ISistema; +import Logica.Sistema; +import Logica.datatype.DtUsuariosMauro; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.Base64; +import java.util.List; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +/** + * + * @author pecaa + */ +@WebServlet(name = "index", urlPatterns = {""}) +public class index extends HttpServlet { + + /** + * Processes requests for both HTTP <code>GET</code> and <code>POST</code> + * methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + HttpSession session = request.getSession(); + String categoria = request.getParameter("categoria"); + String usuarios = request.getParameter("usuarios"); + + if (usuarios == null) { + List<Logica.datatype.DtPropuesta> Listpruepuestas = null; + if (categoria == null) { + Listpruepuestas = conexionServidor.listarPropuestas(); + } else { + Listpruepuestas = conexionServidor.listarPropuestasPorCategoria(categoria); + } + + String propuestas = ""; + for (Logica.datatype.DtPropuesta e : Listpruepuestas) { + propuestas += "<a class='Acard col-md-4' href='/g4/propuesta?propuesta=" + e.getTitulo() + "'>" + + "<div class='card mb-4 shadow-sm'>" + + "<i class='far fa-heart btn-like' data-titulo='" + e.getTitulo() + "'></i>" + + " <img class='card-img-top' onerror=\"this.src='./img/404.png'\" style=' width: 100%; display: block;' src='data:image/jpeg;base64," + Base64.getEncoder().encodeToString(e.getImagen()) + "' data-holder-rendered='true'>" + + " <div class='card-body'>" + + " <p class='card-text'>" + e.getTitulo() + "</p>" + + " </div>" + + "</div>" + + "</a>"; + } + request.setAttribute("pruepuestas", propuestas); + + List<String> ListCategorias = conexionServidor.listarCatergorias(); + String categorias = ""; + for (String e : ListCategorias) { + categorias += "<a class='cot btn btn-primary' 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); + } else { + //Lista usuarios del sistema + List<Logica.datatype.DtUsuario> Listusuarios = null; + Listusuarios = conexionServidor.lista_usuarios(); + //usuario logeado + String nameuser = (String) session.getAttribute("userName"); + DtUsuariosMauro user = null; + if (nameuser != null) { + user = conexionServidor.getUser(nameuser); + } + //lista de nick de usuarios que sigo + List<String> sigo = new ArrayList<String>(); + if (user != null) { + for (Logica.datatype.DtUsuario e : user.getSigo()) { + sigo.add(e.getNick()); + } + } + + String respuesta = ""; + if (Listusuarios != null) { + for (Logica.datatype.DtUsuario e : Listusuarios) { + if (e.getNick() != nameuser) { + respuesta += "<div class='Acard col-md-4 card mb-4 shadow-sm'>" + + " <img class='card-img-top img-cir' onerror=\"this.src='./img/404.png'\" style='height: 225px; width: 100%; display: block;' src='data:image/jpeg;base64," + Base64.getEncoder().encodeToString(e.getImg()) + "' data-holder-rendered='true'>" + + " <div class='card-body'>" + + " <p class='card-text'>" + e.getNick() + "</p>" + + " <div class='div-felx'>"; + if (!sigo.contains(e.getNick())) { + respuesta += " <button class='btn btn-primary btn-Seguir' data-user='" + e.getNick() + "'> Seguir </button>"; + } else { + respuesta += " <button class='btn btn-danger btn-desSeguir' data-user='" + e.getNick() + "'> Dejar seguir </button>"; + } + respuesta += " <a href='/g4/user?user=" + e.getNick() + "' class='btn btn-primary'> ver </a>" + + " </div>" + + " </div>" + + "</div>" + + "</a>"; + } + } + } + request.setAttribute("usuarios", respuesta); + + response.setContentType("text/html;charset=UTF-8"); + RequestDispatcher dispatsh = request.getRequestDispatcher("page/ListaUsuario/index.jsp"); + dispatsh.forward(request, response); + } + + } + + // <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); + } + + /** + * 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/login.java b/l2g4/src/java/controladores/login.java index 3378e6930b0c678d072e23ffff398d1fa9523a79..67c1f4dda19ffe475fc169e092fca363ee561227 100644 --- a/l2g4/src/java/controladores/login.java +++ b/l2g4/src/java/controladores/login.java @@ -15,8 +15,7 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import datatype.DtUsuario; -import datatype.respuesta; +import java.util.Base64; /** * @@ -30,10 +29,12 @@ public class login extends HttpServlet { throws ServletException, IOException { /* Atiende las llamadas por get (las llamadas del navegador) */ HttpSession session = request.getSession(); - if (session.getAttribute("userId") != null){ + if (session.getAttribute("userName") != 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); } } @@ -110,7 +111,6 @@ public class login extends HttpServlet { private String logout(HttpServletRequest request){ HttpSession s = request.getSession(); s.removeAttribute("userName"); - s.removeAttribute("userId"); s.removeAttribute("imgUser"); return "exito"; } @@ -127,6 +127,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)) { @@ -134,17 +135,22 @@ public class login extends HttpServlet { } else { ISistema sys = null; sys = Factory.getInstance(); - if (sys.existeUser(userName)){ - if ( userPass.equals("123")){ + 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()); + s.setAttribute("userType", u.getType()); + if (u.getImg() != null){ + s.setAttribute("imgUser", Base64.getEncoder().encodeToString(u.getImg()) ); + } return "exito"; }else{ - return "El passwerd no es valido."; + return "Error no esperado."; } - }else{ + } + else{ return "El usuario no existe"; } } @@ -156,16 +162,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..5c09279b30a77a383c3c0813e5a7ef9960c4a58f 100644 --- a/l2g4/src/java/controladores/propuesta.java +++ b/l2g4/src/java/controladores/propuesta.java @@ -6,7 +6,7 @@ package controladores; import java.io.IOException; -import java.io.PrintWriter; +import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; @@ -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("userName"); - 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,35 @@ 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"); + if (user != null){ + respuesta = NuevoPropuesta(request,user); + }else{ + respuesta = "El usuario tinene que estar logeado."; + } break; - + default: respuesta = "Metodo invalido"; } @@ -72,18 +84,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; @@ -92,20 +105,57 @@ public class propuesta extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - processRequest(request, response); + + HttpSession session = request.getSession(); + String id = getParameter(request,"propuesta"); + + if (id == null){ + response.setContentType("text/html;charset=UTF-8"); + RequestDispatcher dispatsh = request.getRequestDispatcher("page/propuesta/propuesta.jsp"); + dispatsh.forward(request, response); + }else{ + response.setContentType("text/html;charset=UTF-8"); + Logica.datatype.DtPropuesta propuesta = conexionServidor.consultarPropuesta(id); + request.setAttribute("propuesta", propuesta); + RequestDispatcher dispatsh = request.getRequestDispatcher("page/propuesta/propuesta.jsp"); + dispatsh.forward(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,String user) { + // 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 conexionServidor.NuevoPropuesta(user, categoria, titulo, lugar, precioEntrada, fechaPrevista, montoNecesario, descripcion, retorno ); + } + } diff --git a/l2g4/src/java/controladores/user.java b/l2g4/src/java/controladores/user.java index 1d7af1040186bfae554bc0afe7c0e7e46a4a1176..c03d03e78c5f5485f868fd0254c220f19f06b2b4 100644 --- a/l2g4/src/java/controladores/user.java +++ b/l2g4/src/java/controladores/user.java @@ -5,13 +5,16 @@ */ package controladores; -import datatype.DtProponente; -import datatype.DtPropuesta; -import datatype.DtUsuario; +import Logica.Factory; +import Logica.ISistema; +import Logica.datatype.DtPropuesta; +import Logica.datatype.DtUsuario; +import controladores.conexionServidor; 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; @@ -27,71 +30,42 @@ 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"); - - 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); + } else { + + Logica.datatype.DtUsuariosMauro u = conexionServidor.getUser(userNick); + + + 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 @@ -103,39 +77,68 @@ 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"); - - switch(metodo){ + String user = (String) session.getAttribute("userName"); + + conexionServidor sys = new conexionServidor(); + Map<String, String[]> asdsa = getAllParam(request); + switch (metodo) { case "NuevoUsuario": respuesta = NuevoUsuario(request); break; case "SeguirUsuario": /* - * @parametro segido nick usuario deseo seguir - * @parametro segidor nick usuario session + * @parametro asegido nick usuario deseo seguir + * @parametro user nick usuario en session */ - asegido = getParameter(request,"asegido"); + asegido = getParameter(request, "asegido"); + + if (asegido != null) { + if (user != null) { + respuesta = conexionServidor.seguirUsuario(user, asegido); + } else { + respuesta = "Un usuario no esta logeado"; + } + } else { + respuesta = "El campo de usuario a seguir esta en blanco"; + } break; case "DejarSeguirUsuario": /* - * @parametro segido nick usuario deseo seguir - * @parametro segidor nick usuario session + * @parametro asegido nick usuario deseo dejar de seguir + * @parametro user nick usuario en session */ - asegido = getParameter(request,"asegido"); + asegido = getParameter(request, "asegido"); + + if (asegido != null) { + if (user != null) { + respuesta = conexionServidor.dejarSeguirUsuario(user, asegido); + } else { + respuesta = "Un usuario no puede seguirse a si mismo"; + } + } else { + respuesta = "El campo de usuario a seguir esta en blanco"; + } break; case "Favorita": /* - * @parametro propuesta id propuesta - * @parametro segidor nick usuario + * @parametro propuesta titulo propuesta */ - propuesta = getParameter(request,"propuesta"); - segidor = getParameter(request,"segidor"); + propuesta = getParameter(request, "propuesta"); + if (propuesta != null) { + if (user != null) { + respuesta = conexionServidor.Favorita(user, propuesta); + } else { + respuesta = "Un usuario no puede seguirse a si mismo"; + } + } else { + respuesta = "Error con la propuesta, el titulo no ha llegado."; + } break; default: respuesta = "Metodo invalido"; @@ -143,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/css/footer.css b/l2g4/web/css/footer.css index cb1f62cb7200e70c49c0b395c940b2336e3f0580..dccfe1b664abfcdf9376dbd44af15d70d4ac9781 100644 --- a/l2g4/web/css/footer.css +++ b/l2g4/web/css/footer.css @@ -5,7 +5,8 @@ footer { display: flex; justify-content: center; - background: rgba(0,0,0,.1); + background: rgba(0,0,0,.04); color: #666; padding: 10px; + } diff --git a/l2g4/web/css/header.css b/l2g4/web/css/header.css index fd779ab83d51e9c3088cb5054f08304dbaeb9cb5..b27d470705b48c4adbf41e67eed187f8c421d405 100644 --- a/l2g4/web/css/header.css +++ b/l2g4/web/css/header.css @@ -4,32 +4,42 @@ */ 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; + box-shadow: 0px 4px 8px -3px rgba(17, 17, 17, .06); + padding: 0px; background: #fff; - border-bottom: solid 3px #333; +} +nav .container{ display: flex; justify-content: space-between; align-items: center; + } .logo { margin: 0 10px 0 10PX; float: none; font-size: 20px; padding: 7px 14px; + /* border: solid 2px #333; font-family: 'Cabin Sketch', cursive; + */ display: inline-block; 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 +71,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 +82,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/propuesta.css b/l2g4/web/css/propuesta.css new file mode 100644 index 0000000000000000000000000000000000000000..e94d1bea6afd371a6c4023420b7548aac503a8a5 --- /dev/null +++ b/l2g4/web/css/propuesta.css @@ -0,0 +1,111 @@ +/* + Titulo: Style + Description: Estilos generales +*/ + +.perfil_img img { + width: 100% +} +.loder{ + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: -9999; + background: none; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} +.animation{ + height: 200px; + width: 200px; + display: flex; + justify-content: center; + align-items: center; + margin-bottom: -100px; +} +.animation::after{ + content: ""; + height: 100px; + width: 100px; + border: solid 5px #222; + display: block; + position: relative; + -webkit-animation: none; + animation: none; + opacity: 0; + transition: all .5s; +} +.loder.active { + z-index: 9999; + background: rgba(255,255,255,.8); +} +.loder.active .animation::after{ + -webkit-animation: animate-stripes 5s ease infinite; + animation: animate-stripes 2s ease infinite; + opacity: 1; +} +@-webkit-keyframes animate-stripes { + 0% { + height: 200px; + width: 200px; + opacity: 0; + transform: rotate(0deg); + -moz-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + } + 50% { + height: 10px; + width: 10px; + opacity: 1; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + } + 100% { + height: 200px; + width: 200px; + opacity: 0; + transform: rotate(360deg); + -moz-transform: rotate(360deg); + -webkit-transform: rotate(360deg); + } +} + +@keyframes animate-stripes { + 0% { + height: 200px; + width: 200px; + opacity: 0; + transform: rotate(0deg); + -moz-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + } + 50% { + height: 10px; + width: 10px; + opacity: 1; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + } + 100% { + height: 200px; + width: 200px; + opacity: 0; + transform: rotate(360deg); + -moz-transform: rotate(360deg); + -webkit-transform: rotate(360deg); + } +} +.desc{ + margin-bottom: 0; + color: #666; +} +.desc span{ + color: #333; + font-weight: 500; +} diff --git a/l2g4/web/css/style.css b/l2g4/web/css/style.css index fafc02a7367243cd6e254e62fb1f0ce7ca2be992..593160b7e052860ad879fc61c7b223aa29e0c842 100644 --- a/l2g4/web/css/style.css +++ b/l2g4/web/css/style.css @@ -4,7 +4,7 @@ */ * { box-sizing: border-box;} body { - background-color: #f0f0f0; + background-color: #fafafa; } .box-cards-center { display: flex; @@ -25,7 +25,9 @@ body { margin: 0 5px; box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12); } - +.cot{ + width: auto!important; +} .svg { max-width: 100%; margin: 20px auto 0; @@ -34,4 +36,180 @@ body { position: fixed; bottom: 0; right: 10px; +} + + +.msjNone{ + margin: 40px; + color: #999; +} + +.Acard{ + text-decoration: none; + color: #333; + text-align: center; +} + + +.img-cir{ + display: block; + border-radius: 50%; + width: 100px !important; + height: 100px !important; + margin: 40px auto 0; +} + +.div-felx { + display: flex; +} + +.card{ + border: none!important; +} +.imgNo{ + position: absolute; + width: 100px; + bottom: 0; +} +.box-cards-center h1 { + + color: #aaa; + margin-top: 50px; + font-weight: 100; +} + +.btn-like{ + position: absolute; + z-index: 2; + color: #fff; + background: rgba(0,0,0,.2); + width: 40px; + height: 40px; + font-size: 24px; + display: flex; + justify-content: center; + align-items: center; + border-radius: 50%; + top: 5px; + right: 5px; + cursor: pointer; +} +.colaborador { + width: auto; +} +.text-center{ + text-align: center; + margin: 10px auto; + color: #666; +} + +/* Comentarios */ +.clearfix { + overflow: auto; + zoom: 1; +} +.feed-container{ + margin:auto; +} +.feed-border{ + background:#fff; + width:600px; + box-shadow:0px 1px 0px 2px rgba(51, 51, 51, 0.1); + border-radius: 1px; + margin:15px 0px; +} +.feed-options{ + position:absolute; + left:600px; + color: #808080; + cursor:pointer; +} +.feed-content,.feed-avatar{ + float:left; + +} +.feed-avatar{ + margin: 10px 10px; +} +.feed-content{ + margin: 20px 5px; + width:80%; +} +.feed-avatar img{ + border-radius:50%; +} +.feed-footer{ + padding-top:10px; + background: rgba(0,0,0,.01); +} +.feed-footer .footer-left{ + float:left; + margin:0px 15px 10px 15px; + font-size:14px; +} +.feed-footer .footer-right{ + float:right; + margin:0px 15px 10px 0px; + font-size:14px; +} +.footer-time{ + color: #808080; + cursor:pointer; +} +.feed-footer a{ + color:#808080; +} +.feed-footer a:hover{ + color:#333; +} + +.feed-send{ + width: auto; + margin: 5px auto; + display: block; +} +.feed-msg { + width: 100%; + height: 200px; + margin: 0; + display: block; + border: none; + resize: none; +} + + +.cot { + background: #007aff; + padding: 5px 15px 7px; + margin: 5px; + border-radius: 3px; + color: #eee; + display: inline-block; + transition: all .2s; +} + +.cot:hover { + box-shadow: 0 0 7px rgba(33,33,33,.2); + color: #fff; + text-decoration: none; + outline: none +} +.cat-box { + width: 100%; + display: flex; + flex-wrap: wrap; + align-content: center; + justify-content: center; +} +.search{ + box-shadow: 0 2px 11px rgba(0,0,0,.5); + border: none; + background: rgba(255,255,255,.8); + transition: all .5s; +} +.search:hover{ + box-shadow: 0 2px 7px rgba(0,0,0,1); +} +.search:focus,.search:active{ + background: rgba(255,255,255,.9); } \ 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/alert.js b/l2g4/web/js/alert.js index 75fce0e0d53f86c5444e8526b405d42155b92683..d147fea0fecfe675f4bb132ebb56a3b3fa01b7bb 100644 --- a/l2g4/web/js/alert.js +++ b/l2g4/web/js/alert.js @@ -1,7 +1,14 @@ +var stateAlert = 0; function alert(text){ - if (newState || newState === 1 ){ - $( ".loder" ).addClass( "active" ); + var contenedor = $(".msg"); + if (stateAlert == 1 ){ + contenedor.val(contenedor.val() + "<br>"+text); }else{ - $( ".loder" ).removeClass( "active" ); + stateAlert = 1; + contenedor.removeClass('hidden'); + setTimeout(function(){ + contenedor.addClass('hidden'); + stateAlert = 0; + }, 1000); } } \ No newline at end of file diff --git a/l2g4/web/js/app-ajax.js b/l2g4/web/js/app-ajax.js index 8157c907c1b2f3f4feae330326ff23ac7fd51d36..fce245bb723f5540b0bfa7e8eeb900167887f22e 100644 --- a/l2g4/web/js/app-ajax.js +++ b/l2g4/web/js/app-ajax.js @@ -2,11 +2,13 @@ $(document).ready(function () { $('#btn-login').click(function () { funcionLogin(); }); + $('#loginNick').keyup(function (e) { if (e.keyCode == 13) { funcionLogin(); } }); + $('#loginPass').keyup(function (e) { if (e.keyCode == 13) { funcionLogin(); @@ -21,27 +23,45 @@ $(document).ready(function () { let propuesta = $(this).prop("data-user"); funcionExtenderFinanciación(propuesta); }); + $('#btn-cancelar').click(function () { let propuesta = $(this).prop("data-user"); funcionCancelarPropuesta(propuesta) }); - $('#btn-desSeguir').click(function () { - let user = $(this).prop("data-user"); - funcionDejarSeguirUsuario(user); + + $('.btn-Seguir').click(function () { + let user = $(this).attr("data-user"); + funcionSeguirUsuario(user); }); + $('.btn-desSeguir').click(function () { + event.preventDefault(); + let user = $(this).attr("data-user"); + funcionDejarSeguirUsuario(user); + }); - /* - $('#btn-new-user').click(function () { - funcionNuevoUsaurio(); - });*/ - $("form").submit(function (event) { - + $('.btn-like').click(function () { + event.preventDefault(); + let titulo = $(this).attr("data-titulo"); + funcionPropuestaFavorita(titulo); }); + $('#btn-new-user').click(function () { + funcionAltaPerfil(); + }); + + $('#btn-new-propuesta').click(function () { + funcionAltaPropuesta(); + }); + + $('.btn-send').click(function () { + event.preventDefault(); + let prop = $(this).attr("data-prop"); + let msg = $("#feed-msg").val(); + funcionComentario(prop,msg); + }); $("#img").change(function () { - if (this.files && this.files[0]) { var reader = new FileReader(); reader.onload = function (e) { @@ -52,7 +72,7 @@ $(document).ready(function () { }); }); -function funcionMandaFormulario(type, url, cadena) { +function funcionMandaFormulario(type, url, cadena, success,error) { $.ajax({ url: url, type: type, @@ -63,10 +83,12 @@ function funcionMandaFormulario(type, url, cadena) { success: function (responseText) { alert(responseText); cargar(false); + success(); }, error: function (jqXHR, textStatus) { alert(textStatus); cargar(false); + error(); } }); } @@ -76,7 +98,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 ----------------------------------------------------------*/ @@ -134,22 +156,25 @@ function funcionLogin() { }); } } - /* Alta de Propuesta ---------------------------------------------------------*/ 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 ----------------------------------------*/ function funcionRegistrarColaboración() { - event.preventDefault(); var type = "POST"; var url = 'colaboracion'; - var cadena = $(this).serialize();// - funcionMandaFormulario(type, url, cadena); + var data = { + monto:$("#monto").val(), + porsentaje:document.getElementById('porsentaje').checked, + entrada:document.getElementById('entrada').checked, + metodo: "colaboracion" + }; + funcionMandaFormulario(type, url, data); } /* Extender Financiación -----------------------------------------------------*/ function funcionExtenderFinanciación( propuesta) { @@ -294,14 +319,13 @@ function funcionDejarSeguirUsuario(asegido) { }); } /* Marcar Propuesta como Favorita --------------------------------------------*/ -function funcionPropuestaFavorita(propuesta,usuario) { +function funcionPropuestaFavorita(propuesta) { $.ajax({ url: 'user', type: 'POST', data: { metodo: "Favorita", propuesta: propuesta, - usuario: usuario }, beforeSend: function () { cargar(true); diff --git a/l2g4/web/page/ListaUsuario/index.jsp b/l2g4/web/page/ListaUsuario/index.jsp new file mode 100644 index 0000000000000000000000000000000000000000..2e79b10ee770eeadc0e925a65e05e0ca4b8ba449 --- /dev/null +++ b/l2g4/web/page/ListaUsuario/index.jsp @@ -0,0 +1,97 @@ +<%-- + Document : index + Created on : 12-oct-2018, 19:12:22 + Author : pecaa +--%> + +<%@page import="java.util.ArrayList"%> +<%@page import="java.util.List"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<!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" %> + <div class="container"> + + <% + String user = null; + if (request.getAttribute("usuarios") != null) { + user = (String) request.getAttribute("usuarios"); + } + if (user != null && user != "") { + out.print("<h1 class='text-center m-5'>Usuarios</h1>"); + out.print("<div class='row'>"); + out.print(user); + out.print("</div>"); + } else { + out.print("<h1 class='text-center'>No se encontraron usuarios</h1>"); + } + %> + </div> + </div> + </div> +</main> + +</body> +</html> diff --git a/l2g4/web/page/ListaUsuario/main.jspf b/l2g4/web/page/ListaUsuario/main.jspf new file mode 100644 index 0000000000000000000000000000000000000000..a45d35f97fafd3c582c744d48708c6ae7dfed837 --- /dev/null +++ b/l2g4/web/page/ListaUsuario/main.jspf @@ -0,0 +1,16 @@ +<%-- any content can be specified here e.g.: --%> +<%@page import="java.util.ArrayList"%> +<%@page import="java.util.List"%> +<%@ 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/web/page/index/index.jsp b/l2g4/web/page/index/index.jsp new file mode 100644 index 0000000000000000000000000000000000000000..68727483627403095e6aa5500173fdf2730dd824 --- /dev/null +++ b/l2g4/web/page/index/index.jsp @@ -0,0 +1,121 @@ +<%-- + Document : index + Created on : 12-oct-2018, 19:12:22 + Author : pecaa +--%> + +<%@page import="java.util.ArrayList"%> +<%@page import="java.util.List"%> +<%@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"> + <div class="container"> + <div class="row"> + <% if (categorias != null && categorias != "") {%> + <div class="col-md-8 col-sm-12 "> + <h2 class="text-center m-5">Propuestas</h2> + <div class="row"> + <%@include file="main.jspf" %> + </div> + </div> + <div class="col-md-4 col-sm-12 "> + <h2 class="text-center m-5">Categorioas</h2> + <div class="cat-box"> + <% out.print(categorias);%> + </div> + </div> + <% } else {%> + <div class="col-md-12 col-sm-12 "> + <h2 class="text-center m-5">Propuestas</h2> + <div class="row"> + <%@include file="main.jspf" %> + </div> + </div> + <% }%> + </div> + </div> + </div> + </main> + + </body> +</html> diff --git a/l2g4/web/page/index/main.jspf b/l2g4/web/page/index/main.jspf new file mode 100644 index 0000000000000000000000000000000000000000..a45d35f97fafd3c582c744d48708c6ae7dfed837 --- /dev/null +++ b/l2g4/web/page/index/main.jspf @@ -0,0 +1,16 @@ +<%-- any content can be specified here e.g.: --%> +<%@page import="java.util.ArrayList"%> +<%@page import="java.util.List"%> +<%@ 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/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..185a087551687c98ba24f71a660365515749167f 100644 --- a/l2g4/web/page/nav.jspf +++ b/l2g4/web/page/nav.jspf @@ -2,54 +2,53 @@ <%@ 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 estado = "logeado"; - if (idUser == null){ - estado = "Visitante"; - } + + String nameUser = (String) session.getAttribute("userName"); + String imgUser = "data:image/jpeg;base64," + (String) session.getAttribute("imgUser"); + + String estado = "logeado"; + if (nameUser == null) { + estado = "Visitante"; + } %> <nav> - <div class="logo"> - Culturarte - </div> - <div class="tools <% out.print( estado ); %>"> - - <% if (idUser != null ) { %> - <!-- User logeado--> - <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" id="btn-logout">Salir</a> - </ul> - <div class="dropdown-toggle" data-toggle="dropdown"> - <label class="name-user"><% out.print( nameUser ); %></label> - <img class=" user-creador" src="<% out.print( imgUser ); %>"> + <div class="container"> + <div class="logo"> + Culturarte + </div> + <div class="tools <% out.print(estado); %>"> + + <% if (nameUser != null) { %> + <!-- User logeado--> + <a href="/g4/?usuarios" data-toggle="tooltip" data-placement="bottom" title="Busca usuarios"><i class="fas fa-users"></i></a> + <a href="/g4/addPropuesta" data-toggle="tooltip" data-placement="bottom" title="Crea propuesta"><i class="fas fa-lightbulb"></i></a> + <div class="logeado dropdown" data-toggle="dropdown" style="width: 150px; text-align: right;"> + <ul class="dropdown-menu" role="menu"> + <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"> + <label class="name-user"><% out.print(nameUser); %></label> + <img class=" user-creador" src="<% out.print(imgUser); %>"> + </div> </div> - </div> - <% } else { %> - <!-- Visitante --> - <div class="Visitante"> - <a href="registro-usuario.html">Registrarse</a> - <a href="login.html">Loguearse</a> - </div> - <% } %> - - - - <!-- Buscar --> - <div class="search"> - <input class="input-search" type="text"> - <button class="button-search">B</button> + <% } else { %> + <!-- Visitante --> + <div class="Visitante"> + <a href="addUser">Registrarse</a> + <a href="login">Loguearse</a> + </div> + <% }%> + + + + <!-- Buscar --> + <div class="search"> + <input class="input-search" type="text"> + <button class="button-search">B</button> + </div> + + + </div> </div> - - - </div> </nav> diff --git a/l2g4/web/page/propuesta/propuesta.jsp b/l2g4/web/page/propuesta/propuesta.jsp new file mode 100644 index 0000000000000000000000000000000000000000..7a4d9ac0f0788ce5314ac2afb599d301e2e74f61 --- /dev/null +++ b/l2g4/web/page/propuesta/propuesta.jsp @@ -0,0 +1,239 @@ +<%-- + Document : propuesta + Created on : 15-oct-2018, 18:27:20 + Author : pecaa +--%> + +<%@page import="Logica.datatype.DtComentario"%> +<%@page import="java.util.Base64"%> +<%@page import="java.util.ArrayList"%> +<%@page import="java.util.List"%> +<%@page import="Logica.datatype.DtPropuesta"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<% + Logica.datatype.DtPropuesta p = (Logica.datatype.DtPropuesta) request.getAttribute("propuesta"); + List<String> dsds = new ArrayList<>(); + String userType = (String) session.getAttribute("userType"); + +%> +<!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"> + <link rel="stylesheet" href="./css/propuesta.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/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; + } + .perfil_img img{ + width: 100%; + } + .perfil_img { + border: solid 1px #ddd; + border-radius: 3px; + overflow: hidden; + background: #eee; + } + .desc { + margin: 0; + color: #999; + + } + .desc span{ + color: #666; + font-weight: 700; + } + .categoria{ + font-size: 15px; + color: #666; + } + h3 { + font-size: 4rem; + margin-top: 0px; + margin-bottom: 20px; + } + .description { + width: 100%; + margin: 10px 0 20px; + } + </style> + </head> + <body> + <%@include file="../nav.jspf" %> + <%@include file="../msg.jspf" %> + <!-- + private String ; + private byte[] ; + private String ; + private Fecha ; + private float ; + private float ¿; + private float ; + private Date ; + private boolean retornoEntradas; + private boolean retornoPorcentajeGanancias; + private List<String> colaboradores = new ArrayList<>(); + private String ; + private String ; + private float ; + --> + + <section class="container"> + <div class="row m-5"> + <div class="col-md-6 col-sm-6 col-xs-12"> + <div class="perfil_img"> + <img src="data:image/jpeg;base64,<% out.print(Base64.getEncoder().encodeToString(p.getImagen())); %>" onerror="this.src='./img/404.png'"> + </div> + </div> + <div class="col-md-6 col-sm-6 col-xs-12"> + <div class="perfil_info"> + <a class="categoria" href="/g4/?categoria=<% out.print(p.getCategoria()); %>"><% out.print(p.getCategoria()); %></a> + <h3><% out.print(p.getTitulo()); %></h3> + <p class="desc"><% out.print(p.getRecaudado()); %>/<% out.print(p.getMontoNecesario()); %></p> + <p class="desc"><span>Publicado:</span> <% out.print(p.getFechaPublicacion()); %></p> + <p class="desc"><span>Finalisa:</span> <% out.print(p.getFechaPrevista()); %></p> + <p class="desc"><span>Precio Entrada:</span> <% out.print(p.getPrecioEntrada()); %></p> + <p class="desc"><span>Autor:</span><a href="/g4/user?user=<% out.print(p.getCreador()); %>"><% out.print(p.getCreador()); %></a></p> + <p class="desc"><span>Lugar</span><% out.print(p.getLugar()); %></p> + <% if (userType == "Colaborador") {%> + <button + type="button" + class="btn btn-info btn-lg" + data-toggle="modal" + data-target="#myColabaoracion" + style="margin: 20px 0 0 0;">Colabaora</button> + <% } %> + </div> + </div> + <% if (p.getDescripcion() != null && p.getDescripcion() != "") {%> + <div class="col-md-12 col-sm-6 col-xs-12 "> + <h4>Descripcion</h4> + <div class="description"><% out.print(p.getDescripcion()); %></div> + </div> + <% } %> + </div> + <div class="row "> + <% + if (p != null && p.getColaboradores().size() != 0) { + out.print("<h2 clss='text-center'>Muchas gracias a</h2>"); + for (String elem : p.getColaboradores()) { + out.print("<a class='btn btn-primary colaborador' href='/g4/user?user=" + elem + "'>" + elem + "</a>"); + } + } else { + out.print("<h2 clss='text-center'>Nadie a colaborado se el primero!</h2>"); + } + %> + </div> + <div class="row "> + <div class="feed-container"> + <div class="feed-border clearfix"> + <div class="feed-body clearfix"> + <div class="feed-avatar"> + <img src="http://a06.t26.net/taringa/avatares/A/6/F/9/A/0/OK/48x48_BCD.jpg" alt="" /> + </div> + <div class="feed-content"> + <a class="username" href="#">usuario</a> + <p>texto</p> + </div> + </div> + <div class="feed-footer clearfix"> + <div class="footer-left"> + <span class="footer-time">fecha</span> + </div> + </div> + </div> + <div class="feed-border clearfix"> + <div class="feed-body clearfix"><textarea id="feed-msg" class="feed-msg"></textarea></div> + <div class="feed-footer clearfix"><button + type="button" + data-prop="<% out.print(p.getTitulo()); %>" + class="btn btn-primary feed-send btn-send" + >Mandar</button></div> + + </div> + </div> + <% + if (p != null && p.getComentario().size() != 0) { + for (DtComentario c : p.getComentario()) { + } + } + %> + </div> + <a href="#" class="btn btn-sm main_btn"></a> + </div> + + <!-- Colabaoracion --> + <div id="myColabaoracion" class="modal fade" role="dialog"> + <div class="modal-dialog" id="RegistrarColaboracion"> + + <!-- Modal content--> + <div class="modal-content"> + <div class="modal-body"> + <p>Seleccione un tipo de la reconvensa, la cantidad que quiera donar y dele a el boton de Listo.</p> + <label class="radio-inline"><input type="radio" name="retorno" id="entrada" checked>Entrada </label><br> + <label class="radio-inline"><input type="radio" name="retorno" id="porsentaje">Porsentaje</label> + <div class="form-group"> + <label for="monto">Cantidad</label> + <input type="number" class="form-control" id="monto"> + </div> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="funcionRegistrarColaboración()">Listo</button> + <button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button> + </div> + </div> + + </div> + </div> + </section> +</body> +</html> diff --git a/l2g4/web/page/propuesta/registro-propuesta.jsp b/l2g4/web/page/propuesta/registro-propuesta.jsp index 22f3dba20921c7bc1427d60bd310db58c2c11f11..ff72c869fd131e48def8b52101ea7f8ada565255 100644 --- a/l2g4/web/page/propuesta/registro-propuesta.jsp +++ b/l2g4/web/page/propuesta/registro-propuesta.jsp @@ -4,189 +4,250 @@ 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"> + + + <!-- Fontawesome --> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> + + <!-- 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..192eae21dc69ce477067b924423634b364f77e0e 100644 --- a/l2g4/web/page/user/perfil-usuario.jsp +++ b/l2g4/web/page/user/perfil-usuario.jsp @@ -4,195 +4,222 @@ Author : pecaa --%> -<%@page import="datatype.DtPropuesta"%> +<%@page import="Logica.datatype.DtPropuesta"%> +<%@page import="Logica.datatype.DtUsuariosMauro"%> +<%@page import="Logica.datatype.DtUsuario"%> +<%@page import="java.util.Base64"%> <%@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"%> <% - 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<DtPropuesta> Favoritos = (ArrayList<DtPropuesta>) request.getAttribute("Creo"); + List<DtPropuesta> Creo = (ArrayList<DtPropuesta>) request.getAttribute("Favoritos"); + Logica.datatype.DtUsuariosMauro user = (Logica.datatype.DtUsuariosMauro) request.getAttribute("perfiluser"); + String yo = (String) request.getAttribute("yo"); + List<DtUsuario> seguidores = user.getSigo(); + List<DtUsuario> sigo = user.getSigo(); %> <!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> - </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> + 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"> + + <% + if (user != null){ + out.print("<h1>Información </h1>"); + if (user.getNombre() != null ){ out.print("<label><b>Nombre </b>" + user.getNombre() + "</label><br>"); }; + if (user.getApellido() != null ){ out.print("<label><b>Apellido </b>" + user.getApellido() + "</label><br>"); }; + if (user.getUrl() != null ){ out.print("<label><b>Web </b><a href='"+user.getUrl()+"'>" + user.getUrl() + "</a></label><br>"); }; + if (user.getEmail() != null ){ out.print("<label><b>Email </b>" + user.getEmail() + "</label><br>"); }; + if (user.getFnac() != null ){ out.print("<label><b>Naciminto </b>" + user.getFnac()+ "</label><br>"); }; + }else{ + out.print("<h1>No se encontraron Segiuidores</h1>"); + out.print("<img src='./img/noEncontrado.svg' class='imgNo'>"); + } + %> </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="data:image/jpeg;base64,<% out.print(Base64.getEncoder().encodeToString(e.getImg())); %>" onerror="this.src='./img/404.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> + <img src="./img/noEncontrado.svg" class="imgNo"> + <% } %> </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="data:image/jpeg;base64,<% out.print(Base64.getEncoder().encodeToString(e.getImg())); %>" onerror="this.src='./img/404.png'"> + <div class="body"> + <h1><% out.print(e.getNombre()); %></h1> + </div> + </div> + <% } %> + <% } else { %> + <h1>No se encontraron Segiuidores</h1> + <img src="./img/noEncontrado.svg" class="imgNo"> + <% } %> </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"> + <% out.print(e.getCreador()); %> + </div> + </div> + <% } %> + <% } else { %> + <h1>No se encontraron Segiuidores</h1> + <img src="./img/noEncontrado.svg" class="imgNo"> + <% } %> + <%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> + <img src="./img/noEncontrado.svg" class="imgNo"> + <% } %> + </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> - </body> + </form> + <footer>Equipo G4</footer> + </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..ce35ccb55f083e4a94bec42a0c58792646bb349a 100644 --- a/l2g4/web/page/user/perfil-usuario_no_encontrado.jsp +++ b/l2g4/web/page/user/perfil-usuario_no_encontrado.jsp @@ -4,88 +4,80 @@ 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"%> -<% - 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> + <!-- Fontawesome --> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> + + <!-- 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..961d85287bb19d86d91b22bd24288442b5647318 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"> @@ -24,6 +24,9 @@ <link rel="stylesheet" href="./css/form-usuario.css"> <link rel="stylesheet" href="./css/lib/bootstrap-datetimepicker.css"> + <!-- Fontawesome --> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> + <!-- MetaData --> <title>Culturarte-G4</title> @@ -41,7 +44,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 +67,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 +95,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> @@ -139,14 +146,14 @@ </div> <div class="mb-3 proponente"> <label for="link">link</label> - <input type="datetime-datetime-local" name="link" class="form-control" id="link" placeholder="direccion"> + <input type="text" name="link" class="form-control" id="link" placeholder="direccion"> <div class="invalid-feedback"> link es requerido. </div> </div> <div class="mb-3 proponente"> <label for="Biografia">Biografia</label> - <input type="datetime-datetime-local" name="Biografia" class="form-control" id="Biografia" placeholder="direccion"> + <input type="text" name="Biografia" class="form-control" id="Biografia" placeholder="direccion"> <div class="invalid-feedback"> El Biografia no es và lida. </div> @@ -161,8 +168,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 +177,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 +186,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