Merge branch 'dev' into feature/US-29

This commit is contained in:
Mariela Bonilla 2021-07-25 02:42:16 -06:00
commit b85442e796
53 changed files with 2478 additions and 225 deletions

View File

@ -24,13 +24,13 @@ public class CacheConfiguration {
private final javax.cache.configuration.Configuration<Object, Object> jcacheConfiguration;
public CacheConfiguration(JHipsterProperties jHipsterProperties) {
JHipsterProperties.Cache.Ehcache ehcache = jHipsterProperties.getCache().getEhcache();
//JHipsterProperties.Cache.Ehcache ehcache = jHipsterProperties.getCache().getEhcache();
jcacheConfiguration =
Eh107Configuration.fromEhcacheCacheConfiguration(
CacheConfigurationBuilder
.newCacheConfigurationBuilder(Object.class, Object.class, ResourcePoolsBuilder.heap(ehcache.getMaxEntries()))
.withExpiry(ExpiryPolicyBuilder.timeToLiveExpiration(Duration.ofSeconds(ehcache.getTimeToLiveSeconds())))
.newCacheConfigurationBuilder(Object.class, Object.class, ResourcePoolsBuilder.heap(100L))
.withExpiry(ExpiryPolicyBuilder.timeToLiveExpiration(Duration.ofSeconds(1)))
.build()
);
}
@ -82,6 +82,7 @@ public class CacheConfiguration {
private void createCache(javax.cache.CacheManager cm, String cacheName) {
javax.cache.Cache<Object, Object> cache = cm.getCache(cacheName);
if (cache != null) {
cache.clear();
} else {

View File

@ -31,7 +31,7 @@ public interface UserRepository extends JpaRepository<User, Long> {
Optional<User> findOneByLogin(String login);
@EntityGraph(attributePaths = "authorities")
//@Cacheable(cacheNames = USERS_BY_LOGIN_CACHE)
@Cacheable(cacheNames = USERS_BY_LOGIN_CACHE)
Optional<User> findOneWithAuthoritiesByLogin(String login);
@EntityGraph(attributePaths = "authorities")

View File

@ -30,6 +30,8 @@ public class MailService {
private static final String USER = "user";
private static final String CONTRASENNA = "contrasenna";
private static final String BASE_URL = "baseUrl";
private final JHipsterProperties jHipsterProperties;
@ -93,6 +95,22 @@ public class MailService {
sendEmail(user.getEmail(), subject, content, false, true);
}
@Async
public void sendEmailFromTemplateEncuesta(User user, String templateName, String titleKey, String contrasenna) {
if (user.getEmail() == null) {
log.debug("Email doesn't exist for user '{}'", user.getLogin());
return;
}
Locale locale = Locale.forLanguageTag(user.getLangKey());
Context context = new Context(locale);
context.setVariable(CONTRASENNA, contrasenna);
context.setVariable(USER, user);
context.setVariable(BASE_URL, jHipsterProperties.getMail().getBaseUrl());
String content = templateEngine.process(templateName, context);
String subject = messageSource.getMessage(titleKey, null, locale);
sendEmail(user.getEmail(), subject, content, false, true);
}
@Async
public void sendActivationEmail(User user) {
log.debug("Sending activation email to '{}'", user.getEmail());
@ -128,4 +146,16 @@ public class MailService {
log.debug("Sending reactivated account mail to '{}'", user.getUser().getEmail());
sendEmailFromTemplate(user.getUser(), "mail/reactivatedAccountEmail", "email.reactivation.title");
}
@Async
public void sendPublishedPrivateMail(UsuarioExtra user, String contrasenna) {
log.debug("Sending reactivated account mail to '{}'", user.getUser().getEmail());
sendEmailFromTemplateEncuesta(user.getUser(), "mail/encuestaPrivadaEmail", "email.private.title", contrasenna);
}
@Async
public void sendPublishedPublicMail(UsuarioExtra user) {
log.debug("Sending reactivated account mail to '{}'", user.getUser().getEmail());
sendEmailFromTemplate(user.getUser(), "mail/encuestaPublicaEmail", "email.public.title");
}
}

View File

@ -394,12 +394,16 @@ public class UserService {
@Transactional(readOnly = true)
public Optional<User> getUserWithAuthoritiesByLogin(String login) {
return userRepository.findOneWithAuthoritiesByLogin(login);
//cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).clear();
}
@Transactional(readOnly = true)
public Optional<User> getUserWithAuthorities() {
return SecurityUtils.getCurrentUserLogin().flatMap(userRepository::findOneWithAuthoritiesByLogin);
//findOneWithAuthoritiesByLogin
//cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).clear();
//return user;
}
/**

View File

@ -14,8 +14,12 @@ import org.datasurvey.domain.EPreguntaAbierta;
import org.datasurvey.domain.EPreguntaCerrada;
import org.datasurvey.domain.EPreguntaCerradaOpcion;
import org.datasurvey.domain.Encuesta;
import org.datasurvey.domain.enumeration.AccesoEncuesta;
import org.datasurvey.repository.EncuestaRepository;
import org.datasurvey.service.*;
import org.datasurvey.service.EncuestaQueryService;
import org.datasurvey.service.EncuestaService;
import org.datasurvey.service.MailService;
import org.datasurvey.service.criteria.EncuestaCriteria;
import org.datasurvey.web.rest.errors.BadRequestAlertException;
import org.slf4j.Logger;
@ -46,6 +50,8 @@ public class EncuestaResource {
private final EncuestaQueryService encuestaQueryService;
private final MailService mailService;
private final EPreguntaCerradaService ePreguntaCerradaService;
private final EPreguntaAbiertaService ePreguntaAbiertaService;
@ -56,6 +62,7 @@ public class EncuestaResource {
EncuestaService encuestaService,
EncuestaRepository encuestaRepository,
EncuestaQueryService encuestaQueryService,
MailService mailService,
EPreguntaCerradaService ePreguntaCerradaService,
EPreguntaAbiertaService ePreguntaAbiertaService,
EPreguntaCerradaOpcionService ePreguntaCerradaOpcionService
@ -63,6 +70,7 @@ public class EncuestaResource {
this.encuestaService = encuestaService;
this.encuestaRepository = encuestaRepository;
this.encuestaQueryService = encuestaQueryService;
this.mailService = mailService;
this.ePreguntaCerradaService = ePreguntaCerradaService;
this.ePreguntaAbiertaService = ePreguntaAbiertaService;
this.ePreguntaCerradaOpcionService = ePreguntaCerradaOpcionService;
@ -116,6 +124,12 @@ public class EncuestaResource {
}
Encuesta result = encuestaService.save(encuesta);
if (result.getAcceso().equals(AccesoEncuesta.PRIVATE)) {
mailService.sendPublishedPrivateMail(result.getUsuarioExtra(), result.getContrasenna());
} else {
mailService.sendPublishedPublicMail(result.getUsuarioExtra());
}
return ResponseEntity
.ok()
.headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, encuesta.getId().toString()))

View File

@ -39,3 +39,16 @@ email.suspended.title=Your account has been suspended
email.suspended.greeting=Dear {0}
email.suspended.text1=Su cuenta en DatSurvey se encuentra temporalmente suspendida. Si cree que es un error por favor haga clic en el siguiente enlace para enviar una solicitud para reactivar su cuenta:
email.suspended.text2=Saludos,
#PublicEncuesta
email.public.title=Su encuesta ha sido publicada
email.public.greeting=¡Felicidades {0}!
email.public.text1=Su encuesta ha sido publicada de manera publica
email.public.text2=Saludos,
#PrivateEncuesta
email.private.title=Su encuesta ha sido publicada de manera privada
email.private.greeting=¡Felicidades {0}!
email.private.text1=Su encuesta ha sdo publicada de manera privada. Su contraseña de acceso es: {0}
email.private.text2=Saludos,

View File

@ -40,3 +40,15 @@ email.suspended.title=Su cuenta ha sido suspendida
email.suspended.greeting=Estimado {0}
email.suspended.text1=Lamentamos informarle que su cuenta en DatSurvey se encuentra temporalmente suspendida. Si cree que es un error por favor responda a este correo
email.suspended.text2=Saludos,
#PublicEncuesta
email.public.title=Su encuesta ha sido publicada
email.public.greeting=¡Felicidades {0}!
email.public.text1=Su encuesta ha sido publicada de manera publica
email.public.text2=Saludos,
#PrivateEncuesta
email.private.title=Su encuesta ha sido publicada de manera privada
email.private.greeting=¡Felicidades {0}!
email.private.text1=Su encuesta ha sdo publicada de manera privada. Su contraseña de acceso es: {0}
email.private.text2=Saludos,

View File

@ -0,0 +1,319 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:lang="${#locale.language}" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width" />
<!-- Forcing initial-scale shouldn't be necessary -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- Use the latest (edge) version of IE rendering engine -->
<meta name="x-apple-disable-message-reformatting" />
<!-- Disable auto-scale in iOS 10 Mail entirely -->
<title th:text="#{email.private.title}">JHipster activation</title>
<link rel="icon" th:href="@{|${baseUrl}/favicon.ico|}" />
<link href="https://fonts.googleapis.com/css?family=NotoSansSP:300,400,700" rel="stylesheet" />
<link rel="manifest" href="manifest.webapp" />
<style>
.bg_white {
background: #ffffff;
}
.bg_light {
background: #fafafa;
}
.bg_black {
background: #000000;
}
.bg_dark {
background: rgba(0, 0, 0, 0.8);
}
.email-section {
padding: 2.5em;
}
/*BUTTON*/
.btn {
padding: 10px 15px;
display: inline-block;
}
.btn.btn-primary {
border-radius: 5px;
background: #007bff;
color: #ffffff;
}
.btn.btn-white {
border-radius: 5px;
background: #ffffff;
color: #000000;
}
.btn.btn-white-outline {
border-radius: 5px;
background: transparent;
border: 1px solid #fff;
color: #fff;
}
.btn.btn-black-outline {
border-radius: 0px;
background: transparent;
border: 2px solid #000;
color: #000;
font-weight: 700;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'Lato', sans-serif;
color: #000000;
margin-top: 0;
font-weight: 400;
}
body {
font-family: 'Noto Sans JP', sans-serif;
font-weight: 400;
font-size: 15px;
line-height: 1.8;
color: rgba(0, 0, 0, 0.4);
}
a {
color: #30e3ca;
}
table {
}
/*LOGO*/
.logo h1 {
margin: 0;
}
.logo h1 a {
color: #30e3ca;
font-size: 24px;
font-weight: 700;
font-family: 'Lato', sans-serif;
}
/*HERO*/
.hero {
position: relative;
z-index: 0;
}
.hero .text {
color: rgba(0, 0, 0, 0.3);
}
.hero .text h2 {
color: #000;
font-size: 40px;
margin-bottom: 0;
font-weight: 400;
line-height: 1.4;
}
.hero .text h3 {
font-size: 24px;
font-weight: 300;
}
.hero .text h2 span {
font-weight: 600;
color: #30e3ca;
}
/*HEADING SECTION*/
.heading-section {
}
.heading-section h2 {
color: #000000;
font-size: 28px;
margin-top: 0;
line-height: 1.4;
font-weight: 400;
}
.heading-section .subheading {
margin-bottom: 20px !important;
display: inline-block;
font-size: 13px;
text-transform: uppercase;
letter-spacing: 2px;
color: rgba(0, 0, 0, 0.4);
position: relative;
}
.heading-section .subheading::after {
position: absolute;
left: 0;
right: 0;
bottom: -10px;
content: '';
width: 100%;
height: 2px;
background: #30e3ca;
margin: 0 auto;
}
.heading-section-white {
color: rgba(255, 255, 255, 0.8);
}
.heading-section-white h2 {
/*font-family: ;*/
line-height: 1;
padding-bottom: 0;
}
.heading-section-white h2 {
color: #ffffff;
}
.heading-section-white .subheading {
margin-bottom: 0;
display: inline-block;
font-size: 13px;
text-transform: uppercase;
letter-spacing: 2px;
color: rgba(255, 255, 255, 0.4);
}
ul.social {
padding: 0;
}
ul.social li {
display: inline-block;
margin-right: 10px;
}
.footer {
border-top: 1px solid rgba(0, 0, 0, 0.05);
color: rgba(0, 0, 0, 0.5);
}
.footer .heading {
color: #000;
font-size: 20px;
}
.footer ul {
margin: 0;
padding: 0;
}
.footer ul li {
list-style: none;
margin-bottom: 10px;
}
.footer ul li a {
color: rgba(0, 0, 0, 1);
}
</style>
</head>
<body width="100%" style="margin: 0; padding: 0 !important; mso-line-height-rule: exactly; background-color: #f1f1f1">
<center style="width: 100%; background-color: #f1f1f1">
<div
style="
display: none;
font-size: 1px;
max-height: 0px;
max-width: 0px;
opacity: 0;
overflow: hidden;
mso-hide: all;
font-family: sans-serif;
"
>
&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;
</div>
<div style="max-width: 600px; margin: 0 auto" class="email-container">
<!-- BEGIN BODY -->
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto">
<tr>
<td valign="top" class="bg_white" style="padding: 1em 2.5em 0 2.5em">
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td class="logo" style="text-align: center">
<h1>
<a href="#"
><img
src="https://res.cloudinary.com/marielascloud/image/upload/v1626333881/DataSurveyLogo2_smr2ok.png"
alt=""
width="300"
/></a>
</h1>
</td>
</tr>
</table>
</td>
</tr>
<!-- end tr -->
<tr>
<td valign="middle" class="hero bg_white" style="padding: 3em 0 2em 0">
<img
src="https://res.cloudinary.com/marielascloud/image/upload/v1626333882/email_v7pjtv.png"
alt=""
style="width: 300px; max-width: 600px; height: auto; margin: auto; display: block"
/>
</td>
</tr>
<!-- end tr -->
<tr>
<td valign="middle" class="hero bg_white" style="padding: 2em 0 4em 0">
<table>
<tr>
<td>
<div class="text" style="padding: 0 2.5em; text-align: center">
<h2 th:text="#{email.private.greeting(${user.login})}">¡Hola!</h2>
<h3 th:text="#{email.private.text1(${contrasenna})}">
Your JHipster account has been created, please click on the URL below to activate it:
</h3>
</div>
<div class="text" style="padding: 1em 2.5em; text-align: center">
<p>
<span th:text="#{email.private.text2}">Regards, </span>
<br />
<em th:text="#{email.signature}">JHipster.</em>
</p>
</div>
</td>
</tr>
</table>
</td>
</tr>
<!-- end tr -->
<!-- 1 Column Text + Button : END -->
</table>
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto">
<tr>
<td valign="middle" class="bg_light footer email-section">
<table>
<tr>
<td valign="top" width="33.333%" style="padding-top: 20px">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td style="text-align: left; padding-right: 10px">
<h3 class="heading">Acerca de</h3>
<p>DataSurvey es su compañero más cercano para poder recolectar información valiosa para usted</p>
</td>
</tr>
</table>
</td>
<td valign="top" width="33.333%" style="padding-top: 20px">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td style="text-align: left; padding-left: 5px; padding-right: 5px">
<h3 class="heading">Información de contacto</h3>
<ul>
<li><span href="mailto:datasurveyapp@gmail.com" class="text">datasurveyapp@gmail.com</span></li>
</ul>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<!-- end: tr -->
<tr>
<td class="bg_light" style="text-align: center">
<p><a href="https://datasurvey.org" style="color: rgba(0, 0, 0, 0.8)">DataSurvey.org</a></p>
</td>
</tr>
</table>
</div>
</center>
</body>
</html>

View File

@ -0,0 +1,319 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:lang="${#locale.language}" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width" />
<!-- Forcing initial-scale shouldn't be necessary -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- Use the latest (edge) version of IE rendering engine -->
<meta name="x-apple-disable-message-reformatting" />
<!-- Disable auto-scale in iOS 10 Mail entirely -->
<title th:text="#{email.public.title}">JHipster activation</title>
<link rel="icon" th:href="@{|${baseUrl}/favicon.ico|}" />
<link href="https://fonts.googleapis.com/css?family=NotoSansSP:300,400,700" rel="stylesheet" />
<link rel="manifest" href="manifest.webapp" />
<style>
.bg_white {
background: #ffffff;
}
.bg_light {
background: #fafafa;
}
.bg_black {
background: #000000;
}
.bg_dark {
background: rgba(0, 0, 0, 0.8);
}
.email-section {
padding: 2.5em;
}
/*BUTTON*/
.btn {
padding: 10px 15px;
display: inline-block;
}
.btn.btn-primary {
border-radius: 5px;
background: #007bff;
color: #ffffff;
}
.btn.btn-white {
border-radius: 5px;
background: #ffffff;
color: #000000;
}
.btn.btn-white-outline {
border-radius: 5px;
background: transparent;
border: 1px solid #fff;
color: #fff;
}
.btn.btn-black-outline {
border-radius: 0px;
background: transparent;
border: 2px solid #000;
color: #000;
font-weight: 700;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'Lato', sans-serif;
color: #000000;
margin-top: 0;
font-weight: 400;
}
body {
font-family: 'Noto Sans JP', sans-serif;
font-weight: 400;
font-size: 15px;
line-height: 1.8;
color: rgba(0, 0, 0, 0.4);
}
a {
color: #30e3ca;
}
table {
}
/*LOGO*/
.logo h1 {
margin: 0;
}
.logo h1 a {
color: #30e3ca;
font-size: 24px;
font-weight: 700;
font-family: 'Lato', sans-serif;
}
/*HERO*/
.hero {
position: relative;
z-index: 0;
}
.hero .text {
color: rgba(0, 0, 0, 0.3);
}
.hero .text h2 {
color: #000;
font-size: 40px;
margin-bottom: 0;
font-weight: 400;
line-height: 1.4;
}
.hero .text h3 {
font-size: 24px;
font-weight: 300;
}
.hero .text h2 span {
font-weight: 600;
color: #30e3ca;
}
/*HEADING SECTION*/
.heading-section {
}
.heading-section h2 {
color: #000000;
font-size: 28px;
margin-top: 0;
line-height: 1.4;
font-weight: 400;
}
.heading-section .subheading {
margin-bottom: 20px !important;
display: inline-block;
font-size: 13px;
text-transform: uppercase;
letter-spacing: 2px;
color: rgba(0, 0, 0, 0.4);
position: relative;
}
.heading-section .subheading::after {
position: absolute;
left: 0;
right: 0;
bottom: -10px;
content: '';
width: 100%;
height: 2px;
background: #30e3ca;
margin: 0 auto;
}
.heading-section-white {
color: rgba(255, 255, 255, 0.8);
}
.heading-section-white h2 {
/*font-family: ;*/
line-height: 1;
padding-bottom: 0;
}
.heading-section-white h2 {
color: #ffffff;
}
.heading-section-white .subheading {
margin-bottom: 0;
display: inline-block;
font-size: 13px;
text-transform: uppercase;
letter-spacing: 2px;
color: rgba(255, 255, 255, 0.4);
}
ul.social {
padding: 0;
}
ul.social li {
display: inline-block;
margin-right: 10px;
}
.footer {
border-top: 1px solid rgba(0, 0, 0, 0.05);
color: rgba(0, 0, 0, 0.5);
}
.footer .heading {
color: #000;
font-size: 20px;
}
.footer ul {
margin: 0;
padding: 0;
}
.footer ul li {
list-style: none;
margin-bottom: 10px;
}
.footer ul li a {
color: rgba(0, 0, 0, 1);
}
</style>
</head>
<body width="100%" style="margin: 0; padding: 0 !important; mso-line-height-rule: exactly; background-color: #f1f1f1">
<center style="width: 100%; background-color: #f1f1f1">
<div
style="
display: none;
font-size: 1px;
max-height: 0px;
max-width: 0px;
opacity: 0;
overflow: hidden;
mso-hide: all;
font-family: sans-serif;
"
>
&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;
</div>
<div style="max-width: 600px; margin: 0 auto" class="email-container">
<!-- BEGIN BODY -->
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto">
<tr>
<td valign="top" class="bg_white" style="padding: 1em 2.5em 0 2.5em">
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td class="logo" style="text-align: center">
<h1>
<a href="#"
><img
src="https://res.cloudinary.com/marielascloud/image/upload/v1626333881/DataSurveyLogo2_smr2ok.png"
alt=""
width="300"
/></a>
</h1>
</td>
</tr>
</table>
</td>
</tr>
<!-- end tr -->
<tr>
<td valign="middle" class="hero bg_white" style="padding: 3em 0 2em 0">
<img
src="https://res.cloudinary.com/marielascloud/image/upload/v1626333882/email_v7pjtv.png"
alt=""
style="width: 300px; max-width: 600px; height: auto; margin: auto; display: block"
/>
</td>
</tr>
<!-- end tr -->
<tr>
<td valign="middle" class="hero bg_white" style="padding: 2em 0 4em 0">
<table>
<tr>
<td>
<div class="text" style="padding: 0 2.5em; text-align: center">
<h2 th:text="#{email.public.greeting(${user.login})}">¡Hola!</h2>
<h3 th:text="#{email.public.text1}">
Your JHipster account has been created, please click on the URL below to activate it:
</h3>
</div>
<div class="text" style="padding: 1em 2.5em; text-align: center">
<p>
<span th:text="#{email.public.text2}">Regards, </span>
<br />
<em th:text="#{email.signature}">JHipster.</em>
</p>
</div>
</td>
</tr>
</table>
</td>
</tr>
<!-- end tr -->
<!-- 1 Column Text + Button : END -->
</table>
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto">
<tr>
<td valign="middle" class="bg_light footer email-section">
<table>
<tr>
<td valign="top" width="33.333%" style="padding-top: 20px">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td style="text-align: left; padding-right: 10px">
<h3 class="heading">Acerca de</h3>
<p>DataSurvey es su compañero más cercano para poder recolectar información valiosa para usted</p>
</td>
</tr>
</table>
</td>
<td valign="top" width="33.333%" style="padding-top: 20px">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td style="text-align: left; padding-left: 5px; padding-right: 5px">
<h3 class="heading">Información de contacto</h3>
<ul>
<li><span href="mailto:datasurveyapp@gmail.com" class="text">datasurveyapp@gmail.com</span></li>
</ul>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<!-- end: tr -->
<tr>
<td class="bg_light" style="text-align: center">
<p><a href="https://datasurvey.org" style="color: rgba(0, 0, 0, 0.8)">DataSurvey.org</a></p>
</td>
</tr>
</table>
</div>
</center>
</body>
</html>

View File

@ -72,6 +72,7 @@ export class AccountService {
shareReplay()
);
}
return this.accountCache$;
}

View File

@ -19,12 +19,17 @@
</div>-->
<div>
<jhi-alert class="alert-success"></jhi-alert>
<div
*ngIf="success"
class="alert alert-success alert-dismissible fade show"
role="alert"
jhiTranslate="dataSurveyApp.categoria.delete.success"
>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="alert alert-success" *ngIf="success" jhiTranslate="dataSurveyApp.categoria.delete.success"></div>
<div class="alert alert-warning" id="no-result" *ngIf="categorias?.length === 0">
<span jhiTranslate="dataSurveyApp.categoria.home.notFound">No categorias found</span>
</div>

View File

@ -1,8 +1,8 @@
<form *ngIf="encuesta" name="deleteForm" (ngSubmit)="confirmDelete(encuesta)">
<form class="ds-form" *ngIf="encuesta" name="deleteForm" (ngSubmit)="confirmDelete(encuesta!)">
<div class="modal-header">
<h4 class="modal-title" data-cy="encuestaDeleteDialogHeading" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
<!-- <h2 class="ds-title" data-cy="encuestaDeleteDialogHeading" jhiTranslate="entity.delete.title">Confirm delete operation</h2>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" (click)="cancel()">&times;</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" (click)="cancel()">&times;</button>-->
</div>
<div class="modal-body">
@ -14,11 +14,11 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="cancel()">
<fa-icon icon="ban"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
<button type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal" (click)="cancel()">
<fa-icon icon="arrow-left"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
</button>
<button id="jhi-confirm-delete-encuesta" data-cy="entityConfirmDeleteButton" type="submit" class="btn btn-danger">
<button id="jhi-confirm-delete-encuesta" data-cy="entityConfirmDeleteButton" type="submit" class="ds-btn ds-btn--danger">
<fa-icon icon="times"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
</button>
</div>

View File

@ -1,9 +1,8 @@
import { Component } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { EstadoEncuesta } from 'app/entities/enumerations/estado-encuesta.model';
import { IEncuesta } from '../encuesta.model';
import { EncuestaService } from '../service/encuesta.service';
import { EstadoEncuesta } from 'app/entities/enumerations/estado-encuesta.model';
@Component({
templateUrl: './encuesta-delete-dialog.component.html',
@ -17,9 +16,9 @@ export class EncuestaDeleteDialogComponent {
this.activeModal.dismiss();
}
confirmDelete(encuesta: IEncuesta): void {
encuesta.estado = EstadoEncuesta.DELETED;
this.encuestaService.update(encuesta).subscribe(() => {
confirmDelete(encuest: IEncuesta): void {
encuest.estado = EstadoEncuesta.DELETED;
this.encuestaService.deleteEncuesta(encuest).subscribe(() => {
this.activeModal.close('deleted');
});
}

View File

@ -0,0 +1,25 @@
<form name="deleteForm" (ngSubmit)="confirmDelete()">
<div class="modal-header">
<h4 class="modal-title" data-cy="encuestaDeleteDialogHeading" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" (click)="cancel()">&times;</button>
</div>
<div class="modal-body">
<jhi-alert-error></jhi-alert-error>
<p id="jhi-delete-encuesta-heading" jhiTranslate="dataSurveyApp.encuesta.delete.deleteoption">
Are you sure you want to delete this option?
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="cancel()">
<fa-icon icon="ban"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
</button>
<button id="jhi-confirm-delete-encuesta" data-cy="entityConfirmDeleteButton" type="submit" class="btn btn-danger">
<fa-icon icon="times"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
</button>
</div>
</form>

View File

@ -0,0 +1,17 @@
import { Component } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
@Component({
templateUrl: './encuesta-delete-option-dialog.component.html',
})
export class EncuestaDeleteOptionDialogComponent {
constructor(protected activeModal: NgbActiveModal) {}
cancel(): void {
this.activeModal.dismiss();
}
confirmDelete(): void {
this.activeModal.close('confirm');
}
}

View File

@ -0,0 +1,25 @@
<form name="deleteForm" (ngSubmit)="confirmDelete()">
<div class="modal-header">
<h4 class="modal-title" data-cy="encuestaDeleteDialogHeading" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" (click)="cancel()">&times;</button>
</div>
<div class="modal-body">
<jhi-alert-error></jhi-alert-error>
<p id="jhi-delete-encuesta-heading" jhiTranslate="dataSurveyApp.encuesta.delete.deletequestion">
Are you sure you want to delete this question?
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="cancel()">
<fa-icon icon="ban"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
</button>
<button id="jhi-confirm-delete-encuesta" data-cy="entityConfirmDeleteButton" type="submit" class="btn btn-danger">
<fa-icon icon="times"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
</button>
</div>
</form>

View File

@ -0,0 +1,17 @@
import { Component } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
@Component({
templateUrl: './encuesta-delete-question-dialog.component.html',
})
export class EncuestaDeleteQuestionDialogComponent {
constructor(protected activeModal: NgbActiveModal) {}
cancel(): void {
this.activeModal.dismiss();
}
confirmDelete(): void {
this.activeModal.close('confirm');
}
}

View File

@ -3,6 +3,8 @@ import { IEncuesta } from '../encuesta.model';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { EncuestaService } from '../service/encuesta.service';
import { EstadoEncuesta } from '../../enumerations/estado-encuesta.model';
import { AccesoEncuesta } from '../../enumerations/acceso-encuesta.model';
import { passwordResetFinishRoute } from '../../../account/password-reset/finish/password-reset-finish.route';
@Component({
selector: 'jhi-encuesta-publish-dialog',
@ -24,10 +26,25 @@ export class EncuestaPublishDialogComponent implements OnInit {
encuesta.estado = EstadoEncuesta.ACTIVE;
}
if (encuesta.acceso === AccesoEncuesta.PRIVATE) {
encuesta.contrasenna = this.generatePassword();
}
this.encuestaService.update(encuesta).subscribe(() => {
this.activeModal.close('published');
});
}
generatePassword(): string {
debugger;
const alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
let password = '';
for (let i = 0; i < 5; i++) {
password += alpha.charAt(Math.floor(Math.random() * alpha.length));
}
return password;
}
ngOnInit(): void {}
}

View File

@ -7,6 +7,8 @@ import { EncuestaDeleteDialogComponent } from './delete/encuesta-delete-dialog.c
import { EncuestaRoutingModule } from './route/encuesta-routing.module';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { EncuestaPublishDialogComponent } from './encuesta-publish-dialog/encuesta-publish-dialog.component';
import { EncuestaDeleteQuestionDialogComponent } from './encuesta-delete-question-dialog/encuesta-delete-question-dialog.component';
import { EncuestaDeleteOptionDialogComponent } from './encuesta-delete-option-dialog/encuesta-delete-option-dialog.component';
@NgModule({
imports: [SharedModule, EncuestaRoutingModule, FontAwesomeModule],
@ -16,6 +18,8 @@ import { EncuestaPublishDialogComponent } from './encuesta-publish-dialog/encues
EncuestaUpdateComponent,
EncuestaDeleteDialogComponent,
EncuestaPublishDialogComponent,
EncuestaDeleteQuestionDialogComponent,
EncuestaDeleteOptionDialogComponent,
],
entryComponents: [EncuestaDeleteDialogComponent],
})

View File

@ -3,7 +3,7 @@
<div class="d-flex flex-sm-row flex-column justify-content-between align-items-center">
<div>
<span class="ds-title" jhiTranslate="dataSurveyApp.encuesta.home.title">Encuestas</span>
<p class="ds-subtitle">Cree encuestas y publiquelas mundialmente.</p>
<p class="ds-subtitle">Cree encuestas y publiquelas mundialmente</p>
</div>
<div>
@ -27,7 +27,7 @@
</div>
</h2>
<jhi-alert-error></jhi-alert-error>
<!-- <jhi-alert-error></jhi-alert-error> -->
<div *ngIf="successPublished" class="alert alert-success alert-dismissible fade show" role="alert">
Su encuesta fue publicada exitosamente
@ -42,8 +42,40 @@
<form class="ds-form">
<div class="input-group">
<div class="ds-filter">
<div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
<input type="text" name="searchString" placeholder="Buscar..." [(ngModel)]="searchString" />
<input type="text" name="searchString" placeholder="Buscar por nombre..." [(ngModel)]="searchString" />
</div>
<div class="ds-filter">
<div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
<select name="accesoEncuestas" id="accesoEncuesta" [(ngModel)]="accesoEncuesta" style="width: 200px">
<option value="" selected="selected" disabled="disabled">Filtrar por acceso</option>
<option value="">Todos Accesos</option>
<option value="Public">Públicas</option>
<option value="Private">Privadas</option>
</select>
</div>
<div class="ds-filter">
<div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
<select name="estadoEncuesta" id="estadoEncuesta" [(ngModel)]="estadoEncuesta" style="width: 200px">
<option value="" selected="selected" disabled="disabled">Filtrar por estado</option>
<option value="">Todos Estados</option>
<option value="Draft">Borradores</option>
<option value="Active">Activadas</option>
<option value="Finished">Finalizadas</option>
</select>
</div>
<!--<div class="col-3">
<div class="input-group-addon "><i class="glyphicon glyphicon-search"></i></div>
<select id="categoriaEncuesta" name="categoriaEncuesta" [(ngModel)]="categoriaEncuesta">
<option [ngValue]="null" selected>Filtre por categoría</option>
<option
*ngFor="let categoriaOption of categoriasSharedCollection; trackBy: trackCategoriaById"
[ngValue]="categoriaOption.nombre" >
{{ categoriaOption.nombre }}
</option>
</select>
</div>-->
</div>
</form>
@ -94,17 +126,22 @@
</div>
<div class="ds-contextmenu__divider" id="contextmenu-delete--separator">
<li>
<button type="button"><fa-icon class="contextmenu__icon" [icon]="faTrashAlt"></fa-icon>Eliminar</button>
<button type="button" (click)="deleteSurvey()">
<fa-icon class="contextmenu__icon" [icon]="faTrashAlt"></fa-icon>Eliminar
</button>
</li>
</div>
</ul>
</div>
<div
class="ds-list--entity"
*ngFor="let encuesta of encuestas! | filter: 'nombre':searchString; trackBy: trackId"
*ngFor="
let encuesta of encuestas! | filter: 'nombre':searchString | filter: 'acceso':accesoEncuesta | filter: 'estado':estadoEncuesta;
trackBy: trackId
"
(dblclick)="openSurvey($event)"
(click)="selectSurvey($event)"
[hidden]="encuesta.estado == 'DELETED'"
[attr.data-id]="encuesta.id"
>
<div class="entity-header">
@ -218,6 +255,40 @@
<span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
</button>
<button type="submit" (click)="delete(encuesta)" class="btn btn-danger btn-sm" data-cy="entityDeleteButton">
<fa-icon icon="times"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
</button>
</div>
</div>
</div>
<div>
<div *ngIf="encuesta.usuarioExtra">
<a [routerLink]="['/usuario-extra', encuesta.usuarioExtra?.id, 'view']">{{ encuesta.usuarioExtra?.id }}</a>
</div>
</div>
<div class="text-right">
<div class="btn-group">
<button
type="submit"
[routerLink]="['/encuesta', encuesta.id, 'view']"
class="btn btn-info btn-sm"
data-cy="entityDetailsButton"
>
<fa-icon icon="eye"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
</button>
<button
type="submit"
[routerLink]="['/encuesta', encuesta.id, 'edit']"
class="btn btn-primary btn-sm"
data-cy="entityEditButton"
>
<fa-icon icon="pencil-alt"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
</button>
<button type="submit" (click)="delete(encuesta)" class="btn btn-danger btn-sm" data-cy="entityDeleteButton">
<fa-icon icon="times"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
@ -227,7 +298,6 @@
</div>
</div>
</div>
<div class="table-responsive" id="entities" *ngIf="isAdmin() && encuestas && encuestas.length > 0">
<table class="table table-striped" aria-describedby="page-heading">
<thead>
@ -242,9 +312,15 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let encuesta of encuestas | filter: 'nombre':searchString; trackBy: trackId" data-cy="entityTable">
<tr
*ngFor="
let encuesta of encuestas | filter: 'nombre':searchString | filter: 'acceso':accesoEncuesta | filter: 'estado':estadoEncuesta;
trackBy: trackId
"
data-cy="entityTable"
>
<td>{{ encuesta.nombre }}</td>
<td>{{ encuesta.fechaCreacion | formatMediumDatetime }}</td>
<td>{{ encuesta.fechaCreacion | formatShortDatetime | titlecase }}</td>
<td jhiTranslate="{{ 'dataSurveyApp.AccesoEncuesta.' + encuesta.acceso }}">{{ encuesta.acceso }}</td>
<td jhiTranslate="{{ 'dataSurveyApp.EstadoEncuesta.' + encuesta.estado }}">{{ encuesta.estado }}</td>
<td>
@ -254,9 +330,7 @@
</td>
<td>
<div *ngIf="encuesta.usuarioExtra">
<a [routerLink]="['/usuario-extra', encuesta.usuarioExtra?.nombre, 'view']">
{{ encuesta.usuarioExtra?.nombre }}
</a>
{{ encuesta.usuarioExtra?.user?.login }}
</div>
</td>
<td class="text-right">

View File

@ -22,6 +22,8 @@ import { EstadoEncuesta } from 'app/entities/enumerations/estado-encuesta.model'
import { AccountService } from 'app/core/auth/account.service';
import { Account } from 'app/core/auth/account.model';
import { Router } from '@angular/router';
import { EncuestaPublishDialogComponent } from '../encuesta-publish-dialog/encuesta-publish-dialog.component';
import { IUser } from '../../user/user.model';
import {
faShareAlt,
@ -39,7 +41,6 @@ import {
} from '@fortawesome/free-solid-svg-icons';
import * as $ from 'jquery';
import { EncuestaPublishDialogComponent } from '../encuesta-publish-dialog/encuesta-publish-dialog.component';
@Component({
selector: 'jhi-encuesta',
@ -64,7 +65,6 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
account: Account | null = null;
usuarioExtra: UsuarioExtra | null = null;
estadoDeleted = EstadoEncuesta.DELETED;
public searchString: string;
encuestas?: IEncuesta[];
isLoading = false;
@ -74,6 +74,15 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
categoriasSharedCollection: ICategoria[] = [];
usuarioExtrasSharedCollection: IUsuarioExtra[] = [];
userSharedCollection: IUser[] = [];
selectedIdSurvey: number | null = null;
encuestaencontrada: IEncuesta | null = null;
public searchString: string;
public accesoEncuesta: string;
//public categoriaEncuesta: string;
public estadoEncuesta: string;
editForm = this.fb.group({
id: [],
@ -105,6 +114,8 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
protected router: Router
) {
this.searchString = '';
this.accesoEncuesta = '';
this.estadoEncuesta = '';
}
resetForm(): void {
@ -114,12 +125,38 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
loadAll(): void {
this.isLoading = true;
this.usuarioExtraService
.retrieveAllPublicUsers()
.pipe(finalize(() => this.loadUserExtras()))
.subscribe(res => {
this.userSharedCollection = res;
});
}
loadPublicUser(): void {
this.usuarioExtraService
.retrieveAllPublicUsers()
.pipe(finalize(() => this.loadUserExtras()))
.subscribe(res => {
this.userSharedCollection = res;
});
}
loadUserExtras() {
this.usuarioExtraService
.query()
.pipe(
finalize(() =>
this.encuestaService.query().subscribe(
(res: HttpResponse<IEncuesta[]>) => {
this.isLoading = false;
const tmpEncuestas = res.body ?? [];
if (this.isAdmin()) {
this.encuestas = tmpEncuestas;
this.encuestas = tmpEncuestas.filter(e => e.estado !== EstadoEncuesta.DELETED);
this.encuestas.forEach(e => {
e.usuarioExtra = this.usuarioExtrasSharedCollection?.find(pU => pU.id == e.usuarioExtra?.id);
});
} else {
this.encuestas = tmpEncuestas
.filter(e => e.usuarioExtra?.id === this.usuarioExtra?.id)
@ -129,10 +166,29 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
() => {
this.isLoading = false;
}
)
)
)
.subscribe(
(res: HttpResponse<IUsuarioExtra[]>) => {
this.isLoading = false;
this.usuarioExtrasSharedCollection = res.body ?? [];
this.usuarioExtrasSharedCollection.forEach(uE => {
uE.user = this.userSharedCollection?.find(pU => pU.id == uE.user?.id);
});
},
() => {
this.isLoading = false;
}
);
}
ngOnInit(): void {
this.searchString = '';
this.accesoEncuesta = '';
//this.categoriaEncuesta = '';
this.estadoEncuesta = '';
document.body.addEventListener('click', e => {
document.getElementById('contextmenu')!.classList.add('ds-contextmenu--closed');
document.getElementById('contextmenu')!.classList.remove('ds-contextmenu--open');
@ -165,6 +221,7 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
this.usuarioExtraService.find(account.id).subscribe(usuarioExtra => {
this.usuarioExtra = usuarioExtra.body;
this.loadAll();
this.loadRelationshipsOptions();
if (this.usuarioExtra !== null) {
if (this.usuarioExtra.id === undefined) {
@ -196,6 +253,48 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
});
}
deleteSurvey(): void {
if (this.selectedIdSurvey != null) {
this.getEncuesta(this.selectedIdSurvey)
.pipe(
finalize(() => {
const modalRef = this.modalService.open(EncuestaDeleteDialogComponent, { size: 'lg', backdrop: 'static' });
modalRef.componentInstance.encuesta = this.encuestaencontrada;
modalRef.closed.subscribe(reason => {
if (reason === 'deleted') {
this.loadAll();
}
});
})
)
.subscribe(data => {
this.encuestaencontrada = data;
});
/*const modalRef = this.modalService.open(EncuestaDeleteDialogComponent, { size: 'lg', backdrop: 'static' });
modalRef.componentInstance.encuesta = this.getEncuesta(this.selectedSurvey)
.pipe(finalize(() =>
modalRef.closed.subscribe(reason => {
if (reason === 'deleted') {
this.loadAll();
}
})
))
.subscribe(data=> {
console.log(data);
//this.encuestaencontrada = data;
});
*/
// unsubscribe not needed because closed completes on modal close
}
}
getEncuesta(id: number) {
return this.encuestaService.findEncuesta(id);
}
previousState(): void {
window.history.back();
}
@ -358,13 +457,8 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
if (event.type === 'contextmenu') {
event.preventDefault();
debugger;
this.selectedSurveyId = event.target.dataset.id;
console.log(this.selectedSurveyId);
debugger;
let res = await this.encuestaService.find(this.selectedSurveyId).toPromise();
this.selectedSurvey = res.body;
this.isPublished = this.selectedSurvey!.estado === 'DRAFT'; // QUE SE LE MUESTRE CUANDO ESTE EN DRAFT
@ -387,6 +481,9 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
document.getElementById('contextmenu-create--separator')!.style.display = 'none';
this.selectedSurvey = Number(event.target.dataset.id);
this.selectedIdSurvey = Number(event.target.dataset.id);
//this.selectedSurvey = event.target.dataset.encuesta;
}
document.getElementById('contextmenu')!.style.top = event.layerY + 'px';
@ -397,9 +494,7 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
}
}
publish() {
debugger;
publish(): void {
const modalRef = this.modalService.open(EncuestaPublishDialogComponent, { size: 'lg', backdrop: 'static' });
modalRef.componentInstance.encuesta = this.selectedSurvey;
// unsubscribe not needed because closed completes on modal close

View File

@ -61,6 +61,15 @@ export class EncuestaService {
.pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
}
findEncuesta(id: number): Observable<IEncuesta> {
return this.http.get<IEncuesta>(`${this.resourceUrl}/${id}`);
}
deleteEncuesta(encuesta: IEncuesta): Observable<EntityResponseType> {
//const copy = this.convertDateFromClient(encuesta);
return this.http.put<IEncuesta>(`${this.resourceUrl}/${getEncuestaIdentifier(encuesta) as number}`, encuesta, { observe: 'response' });
}
query(req?: any): Observable<EntityArrayResponseType> {
const options = createRequestOption(req);
return this.http

View File

@ -31,7 +31,7 @@
<jhi-alert-error></jhi-alert-error>
<jhi-alert></jhi-alert>
<!-- <jhi-alert></jhi-alert> -->
<div class="alert alert-warning" id="no-result" *ngIf="ePreguntas?.length === 0">
<span>No se encontraron preguntas</span>
@ -59,12 +59,16 @@
</div>
<div>
<span *ngIf="ePregunta.tipo === 'SINGLE'" class="ds-subtitle"
>Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.SINGLE' | translate | lowercase }}</span
>Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.SINGLE' | translate | lowercase }}
{{ ePregunta.opcional ? '(opcional)' : '' }}</span
>
<span *ngIf="ePregunta.tipo === 'MULTIPLE'" class="ds-subtitle"
>Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.MULTIPLE' | translate | lowercase }}</span
>Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.MULTIPLE' | translate | lowercase }}
{{ ePregunta.opcional ? '(opcional)' : '' }}</span
>
<span *ngIf="!ePregunta.tipo" class="ds-subtitle"
>Pregunta de respuesta abierta {{ ePregunta.opcional ? '(opcional)' : '' }}</span
>
<span *ngIf="!ePregunta.tipo" class="ds-subtitle">Pregunta de respuesta abierta</span>
</div>
<ng-container *ngIf="ePregunta.tipo">
<ng-container *ngFor="let ePreguntaOpcion of ePreguntasOpciones; let j = index; trackBy: trackId">
@ -172,7 +176,7 @@
</div>
</div>
<!-- Modal -->
<!-- Create Option Modal -->
<div class="modal fade ds-modal" id="crearOpcion" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
@ -239,7 +243,7 @@
<!-- ------------------------------------------------------------------------------------------------- -->
<!-- Modal -->
<!-- Create Question Modal -->
<div
class="modal fade ds-modal"
id="crearPregunta"
@ -301,6 +305,71 @@
</small>
</div>
</div>
<!-- Custom Form Group (Closed & Open Question Validation) -->
<div class="form-group">
<label class="form-control-label" for="field_tipo">Tipo de pregunta</label>
<select class="form-control" name="tipopregunta" formControlName="tipopregunta" id="field_tipo" data-cy="tipopregunta">
<option selected value="CLOSED">Opción multiple</option>
<option value="OPEN">Respuesta abierta</option>
</select>
<div
*ngIf="
editFormQuestion.get('tipopregunta')!.invalid &&
(editFormQuestion.get('tipopregunta')!.dirty || editFormQuestion.get('tipopregunta')!.touched)
"
>
<small
class="form-text text-danger"
*ngIf="editFormQuestion.get('tipopregunta')?.errors?.required"
jhiTranslate="entity.validation.required"
>
This field is required.
</small>
</div>
</div>
<ng-container *ngIf="editFormQuestion.get('tipopregunta')!.value === 'CLOSED'">
<div class="form-group">
<label class="form-control-label" jhiTranslate="dataSurveyApp.ePreguntaCerrada.tiporespuesta" for="field_tipo">Tipo</label>
<select class="form-control" name="tipo" formControlName="tipo" id="field_tipo" data-cy="tipo">
<option selected value="SINGLE">{{ 'dataSurveyApp.PreguntaCerradaTipo.SINGLE' | translate }}</option>
<option value="MULTIPLE">{{ 'dataSurveyApp.PreguntaCerradaTipo.MULTIPLE' | translate }}</option>
</select>
<div
*ngIf="
editFormQuestion.get('tipo')!.invalid && (editFormQuestion.get('tipo')!.dirty || editFormQuestion.get('tipo')!.touched)
"
>
<small
class="form-text text-danger"
*ngIf="editFormQuestion.get('tipo')?.errors?.required"
jhiTranslate="entity.validation.required"
>
This field is required.
</small>
</div>
</div>
</ng-container>
<div class="form-group">
<label class="form-control-label" for="field_opcional">Opcional</label>
<input type="checkbox" class="form-check" name="opcional" id="field_opcional" data-cy="opcional" formControlName="opcional" />
<div
*ngIf="
editFormQuestion.get('opcional')!.invalid &&
(editFormQuestion.get('opcional')!.dirty || editFormQuestion.get('opcional')!.touched)
"
>
<small
class="form-text text-danger"
*ngIf="editFormQuestion.get('opcional')?.errors?.required"
jhiTranslate="entity.validation.required"
>
This field is required.
</small>
</div>
</div>
</div>
</div>
<div class="modal-footer">

View File

@ -1,3 +1,4 @@
import { IEPreguntaAbierta } from './../../e-pregunta-abierta/e-pregunta-abierta.model';
import { EPreguntaCerrada } from './../../e-pregunta-cerrada/e-pregunta-cerrada.model';
import { EPreguntaCerradaOpcion, IEPreguntaCerradaOpcion } from './../../e-pregunta-cerrada-opcion/e-pregunta-cerrada-opcion.model';
import { EPreguntaAbiertaService } from './../../e-pregunta-abierta/service/e-pregunta-abierta.service';
@ -26,6 +27,8 @@ import { EPreguntaCerradaDeleteDialogComponent } from 'app/entities/e-pregunta-c
import { faTimes, faPlus } from '@fortawesome/free-solid-svg-icons';
import { PreguntaCerradaTipo } from 'app/entities/enumerations/pregunta-cerrada-tipo.model';
import { EncuestaDeleteQuestionDialogComponent } from '../encuesta-delete-question-dialog/encuesta-delete-question-dialog.component';
import { EncuestaDeleteOptionDialogComponent } from '../encuesta-delete-option-dialog/encuesta-delete-option-dialog.component';
@Component({
selector: 'jhi-encuesta-update',
@ -68,6 +71,9 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
editFormQuestion = this.fb.group({
id: [],
nombre: [null, [Validators.required, Validators.minLength(1), Validators.maxLength(500)]],
tipo: [PreguntaCerradaTipo.SINGLE],
opcional: [false],
tipopregunta: ['CLOSED'],
});
ePreguntas?: any[];
@ -99,6 +105,7 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
(res: any) => {
this.isLoading = false;
this.ePreguntas = res.body ?? [];
console.log(this.ePreguntas);
},
() => {
this.isLoading = false;
@ -188,6 +195,9 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
}
deleteQuestion(event: any) {
const modalRef = this.modalService.open(EncuestaDeleteQuestionDialogComponent, { size: 'lg', backdrop: 'static' });
modalRef.closed.subscribe(reason => {
if (reason === 'confirm') {
const id = event.target.dataset.id;
if (event.target.dataset.type) {
// Delete closed question
@ -224,8 +234,13 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
});
}
}
});
}
deleteOption(event: any): void {
const modalRef = this.modalService.open(EncuestaDeleteOptionDialogComponent, { size: 'lg', backdrop: 'static' });
modalRef.closed.subscribe(reason => {
if (reason === 'confirm') {
const id = event.target.dataset.optionid;
this.ePreguntaCerradaOpcionService.delete(id).subscribe(e => {
this.ePreguntas = [];
@ -233,6 +248,8 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
this.loadAll();
});
}
});
}
save(): void {
this.isSaving = true;
@ -296,13 +313,24 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
console.log(surveyId);
}
protected createFromFormQuestion(): IEPreguntaCerrada {
protected createFromFormClosedQuestion(): IEPreguntaCerrada {
return {
// ...new EPreguntaCerrada(),
id: undefined,
nombre: this.editFormQuestion.get(['nombre'])!.value,
tipo: PreguntaCerradaTipo.SINGLE,
opcional: false,
tipo: this.editFormQuestion.get(['tipo'])!.value,
opcional: this.editFormQuestion.get(['opcional'])!.value,
orden: 10,
encuesta: this.encuesta,
};
}
protected createFromFormOpenQuestion(): IEPreguntaAbierta {
return {
// ...new EPreguntaAbierta(),
id: undefined,
nombre: this.editFormQuestion.get(['nombre'])!.value,
opcional: this.editFormQuestion.get(['opcional'])!.value,
orden: 10,
encuesta: this.encuesta,
};
@ -314,15 +342,33 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
saveQuestion(): void {
this.isSavingQuestion = true;
const ePreguntaCerrada = this.createFromFormQuestion();
const tipoPregunta = this.editFormQuestion.get(['tipopregunta'])!.value;
if (tipoPregunta === 'CLOSED') {
const ePreguntaCerrada = this.createFromFormClosedQuestion();
if (ePreguntaCerrada.id !== undefined) {
this.subscribeToSaveResponseQuestion(this.ePreguntaCerradaService.update(ePreguntaCerrada));
this.subscribeToSaveResponseQuestionClosed(this.ePreguntaCerradaService.update(ePreguntaCerrada));
} else {
this.subscribeToSaveResponseQuestion(this.ePreguntaCerradaService.create(ePreguntaCerrada));
this.subscribeToSaveResponseQuestionClosed(this.ePreguntaCerradaService.create(ePreguntaCerrada));
}
} else if (tipoPregunta === 'OPEN') {
const ePreguntaAbierta = this.createFromFormOpenQuestion();
if (ePreguntaAbierta.id !== undefined) {
this.subscribeToSaveResponseQuestionOpen(this.ePreguntaAbiertaService.update(ePreguntaAbierta));
} else {
this.subscribeToSaveResponseQuestionOpen(this.ePreguntaAbiertaService.create(ePreguntaAbierta));
}
}
}
protected subscribeToSaveResponseQuestion(result: Observable<HttpResponse<IEPreguntaCerrada>>): void {
protected subscribeToSaveResponseQuestionClosed(result: Observable<HttpResponse<IEPreguntaCerrada>>): void {
result.pipe(finalize(() => this.onSaveFinalizeQuestion())).subscribe(
() => this.onSaveSuccessQuestion(),
() => this.onSaveErrorQuestion()
);
}
protected subscribeToSaveResponseQuestionOpen(result: Observable<HttpResponse<IEPreguntaAbierta>>): void {
result.pipe(finalize(() => this.onSaveFinalizeQuestion())).subscribe(
() => this.onSaveSuccessQuestion(),
() => this.onSaveErrorQuestion()
@ -330,7 +376,8 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
}
protected onSaveSuccessQuestion(): void {
this.editFormQuestion.reset();
this.editFormQuestion.reset({ tipo: PreguntaCerradaTipo.SINGLE, tipopregunta: 'CLOSED', opcional: false });
this.editForm.reset();
this.ePreguntas = [];
this.ePreguntasOpciones = [];
this.loadAll();
@ -361,13 +408,13 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
// }
// }
// trackCategoriaById(index: number, item: ICategoria): number {
// return item.id!;
// }
trackCategoriaById(index: number, item: ICategoria): number {
return item.id!;
}
// trackUsuarioExtraById(index: number, item: IUsuarioExtra): number {
// return item.id!;
// }
trackUsuarioExtraById(index: number, item: IUsuarioExtra): number {
return item.id!;
}
// protected subscribeToSaveResponse(result: Observable<HttpResponse<IEncuesta>>): void {
// result.pipe(finalize(() => this.onSaveFinalize())).subscribe(

View File

@ -12,12 +12,33 @@
<jhi-alert-error></jhi-alert-error>
<jhi-alert></jhi-alert>
<div *ngIf="successChange" class="alert alert-success alert-dismissible fade show" role="alert">
El estado del usuario fue modificado correctamente
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="alert alert-warning" id="no-result" *ngIf="usuarioExtras?.length === 0">
<span jhiTranslate="dataSurveyApp.usuarioExtra.home.notFound">No usuarioExtras found</span>
</div>
<form class="ds-form d-inline">
<div class="input-group">
<div class="col-3">
<div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
<input type="text" name="searchNombreUsuario" placeholder="Buscar por nombre..." [(ngModel)]="searchNombreUsuario" />
</div>
<div class="col-3">
<div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
<select name="searchEstadoUsuario" id="searchEstadoUsuario" [(ngModel)]="searchEstadoUsuario" style="width: 200px">
<option value="" selected="selected" disabled="disabled">Filtrar por estado</option>
<option value="">Todos Estados</option>
<option value="Active">Activos</option>
<option value="Suspended">Bloqueados</option>
</select>
</div>
</div>
</form>
<div class="table-responsive" id="entities" *ngIf="usuarioExtras && usuarioExtras.length > 0">
<table class="table table-striped" aria-describedby="page-heading">
<thead>
@ -32,7 +53,13 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let usuarioExtra of usuarioExtras; trackBy: trackId" data-cy="entityTable">
<tr
*ngFor="
let usuarioExtra of usuarioExtras | filter: 'nombre':searchNombreUsuario | filter: 'estado':searchEstadoUsuario;
trackBy: trackId
"
data-cy="entityTable"
>
<td *ngIf="usuarioExtra.user">
<ul class="listRoles">
<li *ngFor="let userRole of usuarioExtra.user.authorities">

View File

@ -17,8 +17,14 @@ export class UsuarioExtraComponent implements OnInit {
usuarioExtras?: IUsuarioExtra[];
publicUsers?: IUser[];
isLoading = false;
successChange = false;
public searchNombreUsuario: string;
public searchEstadoUsuario: string;
constructor(protected usuarioExtraService: UsuarioExtraService, protected modalService: NgbModal) {}
constructor(protected usuarioExtraService: UsuarioExtraService, protected modalService: NgbModal) {
this.searchNombreUsuario = '';
this.searchEstadoUsuario = '';
}
loadPublicUser(): void {
this.usuarioExtraService
@ -60,6 +66,8 @@ export class UsuarioExtraComponent implements OnInit {
}
ngOnInit(): void {
this.searchNombreUsuario = '';
this.searchEstadoUsuario = '';
this.loadAll();
}
@ -73,6 +81,7 @@ export class UsuarioExtraComponent implements OnInit {
// unsubscribe not needed because closed completes on modal close
modalRef.closed.subscribe(reason => {
if (reason === 'deleted') {
this.successChange = true;
this.loadAll();
}
});

View File

@ -1,78 +1,275 @@
<div class="row">
<div class="col-md-3">
<span class="hipster img-fluid rounded"></span>
<div class="col">
<div class="container-fluid navbar navbar-marketing navbar-expand-lg bg-white navbar-light">
<div class="container px-5 py-4">
<a class="text-dark" href="index.html"
><img src="http://datasurvey.org/content/img_datasurvey/datasurvey-logo-text-black.svg" width="300" alt=""
/></a>
<div class="col-6" style="text-align: end">
<!--<a href="#">
<button class="ds-btn ds-btn&#45;&#45;primary fw-500 ms-lg-4">Encuestas</button>
</a>-->
<a href="login" [hidden]="!notAccount">
<button class="ds-btn ds-btn--primary fw-500 ms-lg-4">Iniciar Sesión</button>
</a>
<!--<a href="account/register" [hidden]="!notAccount">
<button class="ds-btn ds-btn&#45;&#45;primary fw-500 ms-lg-4">Registrarse</button>
</a>-->
</div>
<div class="col-md-9">
<h1 class="display-4"><span jhiTranslate="home.title">Welcome, Java Hipster!</span> (Data Survey)</h1>
<p class="lead" jhiTranslate="home.subtitle">This is your homepage</p>
<div [ngSwitch]="account !== null">
<div class="alert alert-success" *ngSwitchCase="true">
<span id="home-logged-message" *ngIf="account" jhiTranslate="home.logged.message" [translateValues]="{ username: account.login }"
>You are logged in as user "{{ account.login }}".</span
</div>
</div>
<!-- Page Header-->
<div
class="page-header-ui page-header-ui-dark bg-img-cover overlay overlay-40"
style="background-image: url('../../content/img_datasurvey/banner2.png')"
>
<div class="page-header-ui-content py-5 position-relative">
<div class="container px-5">
<div class="row gx-5 justify-content-center">
<div class="col-xl-8 col-lg-10 text-center">
<div data-aos="fade-up">
<h1 class="page-header-ui-title">¡Le damos la bienvenida a DataSurvey!</h1>
<h5 class="page-header-ui-text">
Somos su mejor aliado para la recolección de información, a través de nuestra plataforma
</h5>
<div class="row" [hidden]="!notAccount">
<div class="col">
<a routerLink="/login">
<button class="ds-btn ds-btn--primary fw-500 ms-lg-4">Comenzar</button>
</a>
</div>
</div>
</div>
<!--<div class="row">
<div class="col">
<a routerLink="/login">
<button class="ds-btn ds-btn--primary fw-500 ms-lg-4">Iniciar Sesión</button>
</a>
<a routerLink="/account/register">
<button class="ds-btn ds-btn--primary fw-500 ms-lg-4">Registrarse</button>
</a>
</div>
</div>-->
</div>
</div>
</div>
</div>
<div class="svg-border-rounded text-white">
<!-- Rounded SVG Border-->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 144.54 17.34" preserveAspectRatio="none" fill="currentColor">
<path d="M144.54,17.34H0V0H144.54ZM0,0S32.36,17.34,72.27,17.34,144.54,0,144.54,0"></path>
</svg>
</div>
</div>
<div class="bg-white py-10" id="get-started">
<div class="container px-5">
<div class="row gx-5 text-center">
<div class="col-lg-4 mb-5 mb-lg-0">
<div class="icon-stack icon-stack-xl bg-gradient-primary-to-secondary text-white mb-4"><i class="fa fa-droplet"></i></div>
<h2>Diseño amigable</h2>
<hr />
<p class="mb-0">Contamos con una interfaz fácil de utilizar</p>
</div>
<div class="col-lg-4 mb-5 mb-lg-0">
<div class="icon-stack icon-stack-xl bg-gradient-primary-to-secondary text-white mb-4"><i class="fa fa-code"></i></div>
<h2>Fácil uso</h2>
<hr />
<p class="mb-0">Contamos con una plataforma muy sencilla de usar</p>
</div>
<div class="col-lg-4">
<div class="icon-stack icon-stack-xl bg-gradient-primary-to-secondary text-white mb-4"><i class="fa fa-truck"></i></div>
<h2>Diverso contenido</h2>
<hr />
<p class="mb-0">Podrá encontrar y crear encuestas de diferentes categorías</p>
</div>
</div>
</div>
<div class="svg-border-rounded text-light">
<!-- Rounded SVG Border-->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 144.54 17.34" preserveAspectRatio="none" fill="currentColor">
<path d="M144.54,17.34H0V0H144.54ZM0,0S32.36,17.34,72.27,17.34,144.54,0,144.54,0"></path>
</svg>
</div>
</div>
<div class="bg-light py-10 container-encuestas">
<div class="container px-0">
<h1 class="text-center mb-4">Encuestas</h1>
<div class="row gx-5" *ngIf="encuestas && encuestas.length > 0">
<div class="col-xl-4 col-lg-4 col-md-6 mb-5" *ngFor="let encuesta of encuestasMostradas; trackBy: trackId">
<div
class="card-encuesta lift h-100"
(dblclick)="openSurvey($event)"
(click)="selectSurvey($event)"
[attr.data-id]="encuesta.id"
>
<div class="card-body p-3">
<div class="card-title mb-0">{{ encuesta.nombre }}</div>
<div class="entity-body--row m-2">
<span class="tag mt-2">{{ encuesta.categoria?.nombre | lowercase }}</span>
</div>
<div class="entity-body--row m-2">
<span class="subtitle mt-2">{{ encuesta.descripcion | titlecase }}</span>
</div>
<div class="text-xs text-gray-500">
<div class="entity-body">
<div class="entity-body--row m-2">
<span class="mt-2"
>Fecha Publicada&nbsp;&nbsp;<fa-icon class="entity-icon--access" [icon]="faCalendarAlt"></fa-icon>&nbsp;&nbsp;{{
encuesta.fechaPublicacion | formatShortDatetime | titlecase
}}</span
>
</div>
<div class="alert alert-warning" *ngSwitchCase="false">
<span jhiTranslate="global.messages.info.authenticated.prefix">If you want to </span>
<a class="alert-link" (click)="login()" jhiTranslate="global.messages.info.authenticated.link">sign in</a
><span jhiTranslate="global.messages.info.authenticated.suffix"
>, you can try the default accounts:<br />- Administrator (login="admin" and password="admin") <br />- User (login="user" and
password="user").</span
<div class="entity-body--row m-2">
<span class="mt-2"
>Fecha de Finalización &nbsp;&nbsp;<fa-icon class="entity-icon--access" [icon]="faCalendarAlt"></fa-icon
>&nbsp;&nbsp;{{ encuesta.fechaFinalizar | formatShortDatetime | titlecase }}</span
>
</div>
<div class="alert alert-warning" *ngSwitchCase="false">
<span jhiTranslate="global.messages.info.register.noaccount">You don't have an account yet?</span>&nbsp;
<a class="alert-link" routerLink="account/register" jhiTranslate="global.messages.info.register.link">Register a new account</a>
<div class="entity-body--row m-2">
<p>Calificacion</p>
<fa-icon *ngFor="let i of [].constructor(encuesta.calificacion)" class="entity-icon--star" [icon]="faStar"></fa-icon>
<fa-icon
*ngFor="let i of [].constructor(5 - encuesta.calificacion!)"
class="entity-icon--star--off"
[icon]="faStar"
></fa-icon>
</div>
<div class="entity-body--row m-2">
<button class="ds-btn btn-card"><fa-icon [icon]="faPollH"></fa-icon>&nbsp;&nbsp;Completar encuesta</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<a routerLink="#">
<button class="ds-btn ds-btn--primary fw-500 ms-lg-4 mb-4">Ver todas las encuestas</button>
</a>
</div>
</div>
</div>
</div>
</div>
<div class="container my-5">
<div class="text-center mb-4">
<h1>Preguntas frecuentes</h1>
</div>
<p jhiTranslate="home.question">If you have any question on JHipster:</p>
<ul>
<li>
<a href="https://www.jhipster.tech/" target="_blank" rel="noopener noreferrer" jhiTranslate="home.link.homepage"
>JHipster homepage</a
>
</li>
<li>
<!--Accordion wrapper-->
<div class="accordion md-accordion" id="accordionEx" role="tablist" aria-multiselectable="true">
<!-- Accordion card -->
<div class="card accordion-item">
<!-- Card header -->
<div class="card-header" role="tab" id="headingOne1">
<a
href="https://stackoverflow.com/tags/jhipster/info"
target="_blank"
rel="noopener noreferrer"
jhiTranslate="home.link.stackoverflow"
>JHipster on Stack Overflow</a
data-toggle="collapse"
data-parent="#accordionEx"
href="#collapseOne1"
aria-expanded="true"
aria-controls="collapseOne1"
class="accordion-header"
>
</li>
<li>
<a
href="https://github.com/jhipster/generator-jhipster/issues?state=open"
target="_blank"
rel="noopener noreferrer"
jhiTranslate="home.link.bugtracker"
>JHipster bug tracker</a
<h2 class="mb-0">
<button
class="accordion-button py-4 collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#collapseOne1"
aria-expanded="true"
aria-controls="collapseOne"
>
</li>
<li>
<a href="https://gitter.im/jhipster/generator-jhipster" target="_blank" rel="noopener noreferrer" jhiTranslate="home.link.chat"
>JHipster public chat room</a
>
</li>
<li>
<a href="https://twitter.com/jhipster" target="_blank" rel="noopener noreferrer" jhiTranslate="home.link.follow"
>follow @jhipster on Twitter</a
>
</li>
</ul>
¿Qué métodos de pago están disponibles en DataSurvey?
</button>
</h2>
</a>
</div>
<p>
<span jhiTranslate="home.like">If you like JHipster, don't forget to give us a star on</span>
<a href="https://github.com/jhipster/generator-jhipster" target="_blank" rel="noopener noreferrer" jhiTranslate="home.github"
>GitHub</a
>!
</p>
<!-- Card body -->
<div id="collapseOne1" class="collapse show" role="tabpanel" aria-labelledby="headingOne1" data-parent="#accordionEx">
<div class="card-body">DataSurvey utiliza PayPal como método de pago para la compra de plantillas</div>
</div>
</div>
<!-- Accordion card -->
<!-- Accordion card -->
<div class="card accordion-item">
<!-- Card header -->
<div class="card-header" role="tab" id="headingTwo2">
<a
data-toggle="collapse"
data-parent="#accordionEx"
href="#collapseTwo2"
aria-expanded="true"
aria-controls="collapseTwo2"
class="accordion-header"
>
<h2 class="mb-0">
<button
class="accordion-button py-4 collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#collapseTwo2"
aria-expanded="true"
aria-controls="collapseTwo"
>
¿Debo iniciar sesión o registrarme para poder completar encuestas?
</button>
</h2>
</a>
</div>
<!-- Card body -->
<div id="collapseTwo2" class="collapse" role="tabpanel" aria-labelledby="headingTwo2" data-parent="#accordionEx">
<div class="card-body">
Uno de los objetivos de DataSurvey es que se puedan compartir las encuestas con todos los usuarios, sin necesidad de tener una
cuenta en la plataforma
</div>
</div>
</div>
<!-- Accordion card -->
<!-- Accordion card -->
<div class="card">
<!-- Card header -->
<!-- Card header -->
<div class="card-header" role="tab" id="headingThree3">
<a
data-toggle="collapse"
data-parent="#accordionEx"
href="#collapseThree3"
aria-expanded="true"
aria-controls="collapseThree3"
class="accordion-header"
>
<h2 class="mb-0">
<button
class="accordion-button py-4 collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#collapseThree3"
aria-expanded="true"
aria-controls="collapseThree"
>
¿Cómo comparto una encuesta?
</button>
</h2>
</a>
</div>
<!-- Card body -->
<div id="collapseThree3" class="collapse" role="tabpanel" aria-labelledby="headingThree3" data-parent="#accordionEx">
<div class="card-body">
La plataforma tiene dos tipos de encuestas: públicas y privadas. Las públicas pueden ser compartidas con todo tipo de usuario,
sin ninguna excepción, mientras que las encuestas privadas, necesitan de una clave para poder ser accesadas
</div>
</div>
</div>
<!-- Accordion card -->
</div>
<!-- Accordion wrapper -->
</div>
</div>
</div>

View File

@ -10,6 +10,201 @@ Main page styles
background-size: contain;
}
.bg-img-cover {
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
.overlay {
position: relative;
}
.overlay:before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #000;
opacity: 0.5;
}
.overlay-10:before {
opacity: 0.1;
}
.overlay-20:before {
opacity: 0.2;
}
.overlay-30:before {
opacity: 0.3;
}
.overlay-40:before {
opacity: 0.4;
}
.overlay-50:before {
opacity: 0.5;
}
.overlay-60:before {
opacity: 0.6;
}
.overlay-70:before {
opacity: 0.7;
}
.overlay-80:before {
opacity: 0.8;
}
.overlay-90:before {
opacity: 0.9;
}
.fixed-top,
.page-header-ui.navbar-fixed .navbar {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 1030;
}
.text-white-75,
.page-header-ui-dark .page-header-ui-text a {
color: rgba(255, 255, 255, 0.75) !important;
}
.page-header-ui {
position: relative;
padding-top: 8rem;
padding-bottom: 8rem;
}
.page-header-ui .page-header-ui-content .page-header-ui-title {
font-size: 2.5rem;
}
.page-header-ui .page-header-ui-content .page-header-ui-text {
font-size: 1.15rem;
}
.page-header-ui .page-header-ui-content .page-header-ui-text.small {
font-size: 0.9rem;
}
.page-header-ui-dark {
color: #fff;
background-color: #212832;
}
.svg-border-rounded svg {
position: absolute;
bottom: 0;
left: 0;
height: 1rem;
width: 100%;
}
@media (min-width: 576px) {
.svg-border-rounded svg {
height: 1.5rem;
}
}
@media (min-width: 768px) {
.svg-border-rounded svg {
height: 2rem;
}
}
@media (min-width: 992px) {
.svg-border-rounded svg {
height: 2.5rem;
}
}
@media (min-width: 1200px) {
.svg-border-rounded svg {
height: 3rem;
}
}
/**
Cards
**/
.lift {
box-shadow: 0 0.15rem 1.75rem 0 rgba(33, 40, 50, 0.15);
transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.lift:hover {
transform: translateY(-0.3333333333rem);
box-shadow: 0 0.5rem 2rem 0 rgba(33, 40, 50, 0.25);
}
.lift:active {
transform: none;
box-shadow: 0 0.15rem 1.75rem 0 rgba(33, 40, 50, 0.15);
}
.lift-sm {
box-shadow: 0 0.125rem 0.25rem 0 rgba(33, 40, 50, 0.2);
}
.lift-sm:hover {
transform: translateY(-0.1666666667rem);
box-shadow: 0 0.25rem 1rem 0 rgba(33, 40, 50, 0.25);
}
.lift-sm:active {
transform: none;
box-shadow: 0 0.125rem 0.25rem 0 rgba(33, 40, 50, 0.2);
}
/*.card.lift {
text-decoration: none;
color: inherit;
}
.card-flag {
position: absolute;
font-size: 0.7rem;
padding: 0.3rem 0.5rem;
line-height: 1;
}
.card-flag-dark {
background-color: rgba(33, 40, 50, 0.7);
color: #fff;
}
.card-flag-light {
background-color: rgba(255, 255, 255, 0.7);
color: #69707a;
}
.card-flag-lg {
font-size: 0.9rem;
padding: 0.5rem 0.65rem;
}
.card-flag-top-right {
border-top-left-radius: 0.25rem;
border-bottom-left-radius: 0.25rem;
top: 0.5rem;
right: 0;
}
.card-flag-top-left {
border-top-right-radius: 0.25rem;
border-bottom-right-radius: 0.25rem;
top: 0.5rem;
left: 0;
}*/
.border-cyan {
border-color: #00cfd5 !important;
}
.py-10 {
padding-top: 6rem !important;
padding-bottom: 6rem !important;
}
/* wait autoprefixer update to allow simple generation of high pixel density media query */
@media only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (-moz-min-device-pixel-ratio: 2),
@ -21,3 +216,199 @@ Main page styles
background-size: contain;
}
}
.icon-stack {
display: inline-flex;
justify-content: center;
align-items: center;
border-radius: 100%;
height: 2.5rem;
width: 2.5rem;
font-size: 1rem;
background-color: #f2f6fc;
flex-shrink: 0;
}
.icon-stack svg {
height: 1rem;
width: 1rem;
}
.icon-stack-sm {
height: 2rem;
width: 2rem;
}
.icon-stack-lg {
height: 4rem;
width: 4rem;
font-size: 1.5rem;
}
.icon-stack-lg svg {
height: 1.5rem;
width: 1.5rem;
}
.icon-stack-xl {
height: 5rem;
width: 5rem;
font-size: 1.75rem;
}
.icon-stack-xl svg {
height: 1.75rem;
width: 1.75rem;
}
.container-encuestas {
background-image: url('../../content/img_datasurvey/background encuestas landing.png');
max-height: 1536px;
overflow-y: auto;
}
.bg-gradient-primary-to-secondary {
background-color: #1c44b2 !important;
background-image: linear-gradient(135deg, #1c44b2 0%, #00b88d 100%) !important;
}
/*.card .entity-icon--star {
color: #ffcc47;
margin-right: 0.2rem;
}
.card .card-title {
font-size: 2em;
}
.card .tag {
font-size: 0.8rem;
color: #f8f8f8;
margin-top: 0.5rem;
padding: 0.2rem 1.5rem;
background-color: #2962ff94;
border-radius: 15px;
}
.card .subtitle {
color: rgba(0, 0, 0, 0.54);
font-size: 0.9rem;
}
.card .btn-card {
padding: 11px 10px !important;
}*/
.accordion-button {
position: relative;
display: flex;
align-items: center;
width: 100%;
padding: 1rem 1.25rem;
font-size: 1rem;
color: #69707a;
text-align: left;
background-color: #fff;
border: 0;
border-radius: 0;
overflow-anchor: none;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out,
border-radius 0.15s ease;
}
@media (prefers-reduced-motion: reduce) {
.accordion-button {
transition: none;
}
}
.accordion-button:not(.collapsed) {
color: #0057da;
background-color: #e6effe;
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.125);
}
.accordion-button:not(.collapsed)::after {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230057da'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
transform: rotate(-180deg);
}
.accordion-button::after {
flex-shrink: 0;
width: 1.25rem;
height: 1.25rem;
margin-left: auto;
content: '';
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2369707a'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
background-repeat: no-repeat;
background-size: 1.25rem;
transition: transform 0.2s ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
.accordion-button::after {
transition: none;
}
}
.accordion-button:hover {
z-index: 2;
}
.accordion-button:focus {
z-index: 3;
border-color: transparent;
outline: 0;
box-shadow: 0 0 0 0.25rem #00b88d3a;
}
.accordion-header {
margin-bottom: 0;
}
.accordion-item {
background-color: #fff;
border: 1px solid rgba(0, 0, 0, 0.125);
}
.accordion-item:first-of-type {
border-top-left-radius: 0.35rem;
border-top-right-radius: 0.35rem;
}
.accordion-item:first-of-type .accordion-button {
border-top-left-radius: calc(0.35rem - 1px);
border-top-right-radius: calc(0.35rem - 1px);
}
.accordion-item:not(:first-of-type) {
border-top: 0;
}
.accordion-item:last-of-type {
border-bottom-right-radius: 0.35rem;
border-bottom-left-radius: 0.35rem;
}
.accordion-item:last-of-type .accordion-button.collapsed {
border-bottom-right-radius: calc(0.35rem - 1px);
border-bottom-left-radius: calc(0.35rem - 1px);
}
.accordion-item:last-of-type .accordion-collapse {
border-bottom-right-radius: 0.35rem;
border-bottom-left-radius: 0.35rem;
}
.accordion-body {
padding: 1rem 1.25rem;
}
.accordion-flush .accordion-collapse {
border-width: 0;
}
.accordion-flush .accordion-item {
border-right: 0;
border-left: 0;
border-radius: 0;
}
.accordion-flush .accordion-item:first-child {
border-top: 0;
}
.accordion-flush .accordion-item:last-child {
border-bottom: 0;
}
.accordion-flush .accordion-item .accordion-button {
border-radius: 0;
}
.card-header {
padding: 0;
}
.card-header .collapsed {
background-color: #e6effe;
}

View File

@ -1,11 +1,26 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { HttpResponse } from '@angular/common/http';
import { Router } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { IEncuesta } from 'app/entities/encuesta/encuesta.model';
import { EncuestaService } from 'app/entities/encuesta/service/encuesta.service';
import { FormBuilder } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
import { ICategoria } from 'app/entities/categoria/categoria.model';
import { CategoriaService } from 'app/entities/categoria/service/categoria.service';
import { IUsuarioExtra, UsuarioExtra } from 'app/entities/usuario-extra/usuario-extra.model';
import { UsuarioExtraService } from 'app/entities/usuario-extra/service/usuario-extra.service';
import { AccountService } from 'app/core/auth/account.service';
import { Account } from 'app/core/auth/account.model';
import { faPollH, faCalendarAlt, faStar } from '@fortawesome/free-solid-svg-icons';
import * as $ from 'jquery';
@Component({
selector: 'jhi-home',
templateUrl: './home.component.html',
@ -13,16 +28,48 @@ import { Account } from 'app/core/auth/account.model';
})
export class HomeComponent implements OnInit, OnDestroy {
account: Account | null = null;
private readonly destroy$ = new Subject<void>();
constructor(private accountService: AccountService, private router: Router) {}
usuarioExtra: UsuarioExtra | null = null;
encuestas?: IEncuesta[];
encuestasMostradas: IEncuesta[] = new Array(3);
isLoading = false;
faStar = faStar;
faCalendarAlt = faCalendarAlt;
faPollH = faPollH;
notAccount: boolean = true;
public searchEncuestaPublica: string;
constructor(
protected encuestaService: EncuestaService,
protected modalService: NgbModal,
protected categoriaService: CategoriaService,
protected usuarioExtraService: UsuarioExtraService,
protected activatedRoute: ActivatedRoute,
protected fb: FormBuilder,
protected accountService: AccountService,
protected router: Router
) {
this.searchEncuestaPublica = '';
}
ngOnInit(): void {
this.searchEncuestaPublica = '';
this.accountService
.getAuthenticationState()
.pipe(takeUntil(this.destroy$))
.subscribe(account => (this.account = account));
.subscribe(account => {
if (account !== null) {
this.account = account;
this.notAccount = false;
} else {
this.notAccount = true;
}
});
this.loadAll();
}
login(): void {
@ -33,4 +80,44 @@ export class HomeComponent implements OnInit, OnDestroy {
this.destroy$.next();
this.destroy$.complete();
}
ngAfterViewInit(): void {}
trackId(index: number, item: IEncuesta): number {
return item.id!;
}
loadAll(): void {
this.isLoading = true;
this.encuestaService.query().subscribe(
(res: HttpResponse<IEncuesta[]>) => {
this.isLoading = false;
const tmpEncuestas = res.body ?? [];
this.encuestas = tmpEncuestas.filter(e => e.estado === 'ACTIVE' && e.acceso === 'PUBLIC');
this.encuestasMostradas = this.encuestas.reverse().slice(0, 3);
},
() => {
this.isLoading = false;
}
);
}
openSurvey(event: any): void {
const surveyId = event.target.getAttribute('data-id');
this.router.navigate(['/encuesta', surveyId, 'edit']);
}
selectSurvey(event: any): void {
document.querySelectorAll('.ds-list--entity').forEach(e => {
e.classList.remove('active');
});
if (event.target.classList.contains('ds-list--entity')) {
event.target.classList.add('active');
}
}
counter(i: number) {
return new Array(i);
}
}

View File

@ -4,9 +4,10 @@ import { RouterModule } from '@angular/router';
import { SharedModule } from 'app/shared/shared.module';
import { HOME_ROUTE } from './home.route';
import { HomeComponent } from './home.component';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
@NgModule({
imports: [SharedModule, RouterModule.forChild([HOME_ROUTE])],
imports: [SharedModule, RouterModule.forChild([HOME_ROUTE]), FontAwesomeModule],
declarations: [HomeComponent],
})
export class HomeModule {}

View File

@ -1,3 +1,8 @@
<div class="footer">
<p jhiTranslate="footer">This is your footer</p>
<div #footer class="footer">
<div>
<p>
Copyright © Derechos reservados - Desarrollado por
<a style="color: #00b88d" href="http://pablobonilla.io/quantum" target="_blank">Quantum</a>
</p>
</div>
</div>

View File

@ -0,0 +1,7 @@
.footer {
background: #192e4d;
color: white;
padding: 12px 0;
font-size: 0.8em;
text-align: center;
}

View File

@ -3,5 +3,6 @@ import { Component } from '@angular/core';
@Component({
selector: 'jhi-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.scss'],
})
export class FooterComponent {}

View File

@ -19,3 +19,4 @@
</div>
</div>
</ng-template>
<jhi-footer></jhi-footer>

View File

@ -74,13 +74,18 @@
<p class="mb-4" style="color: rgba(146, 146, 146, 0.664)">Ingrese su correo electrónico y contraseña</p>
</div>
<div class="alert alert-danger" *ngIf="error" jhiTranslate="login.messages.error.authentication" data-cy="loginError">
<div
class="alert alert-danger"
*ngIf="error && !userSuspended"
jhiTranslate="login.messages.error.authentication"
data-cy="loginError"
>
<strong>Failed to sign in!</strong> Please check your credentials and try again.
</div>
<div
class="alert alert-danger"
*ngIf="userSuspended"
*ngIf="userSuspended && !error"
jhiTranslate="login.messages.error.userSuspended"
data-cy="loginError"
></div>

View File

@ -81,6 +81,9 @@ export class LoginComponent implements OnInit, AfterViewInit {
}
authenticacionGoogle(): void {
this.error = false;
this.userSuspended = false;
this.loginService.login({ username: this.user.email, password: this.user.id, rememberMe: false }).subscribe(
() => {
this.authenticationError = false;
@ -123,6 +126,9 @@ export class LoginComponent implements OnInit, AfterViewInit {
}
activateGoogle(): void {
this.error = false;
this.userSuspended = false;
this.registerService
.save({
login: this.user.email,
@ -145,6 +151,8 @@ export class LoginComponent implements OnInit, AfterViewInit {
}
login(): void {
this.error = false;
this.userSuspended = false;
debugger;
this.loginService
.login({
@ -169,8 +177,14 @@ export class LoginComponent implements OnInit, AfterViewInit {
}
// }
},
response => this.processError(response)
response => {
debugger;
if (response.status == 401 && response.error.detail == 'Bad credentials') {
this.error = true;
} else {
this.processError(response);
}
}
);
}
}

View File

@ -0,0 +1,57 @@
.app-loading .container {
margin: auto auto;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.app-loading .tittle {
margin-bottom: 40px;
color: #44b9ff;
letter-spacing: 4px;
text-transform: uppercase;
}
.app-loading .square-container {
list-style-type: none;
display: flex;
position: relative;
}
.app-loading .square {
margin: 4px;
width: 30px;
height: 30px;
border-radius: 7px;
animation: rotating 2s ease infinite;
}
.app-loading .square1 {
background: #192e4d;
animation-delay: 0.2s;
}
.app-loading .square2 {
background: #018adf;
animation-delay: 0.4s;
}
.app-loading .square3 {
background: #20a9fe;
animation-delay: 0.6s;
}
.app-loading .square4 {
background: #00e0ac;
animation-delay: 0.8s;
}
.app-loading .square5 {
background: #70ffde;
animation-delay: 1s;
}
@keyframes rotating {
0% {
transform: rotate(0) scale(1);
}
50% {
transform: rotate(90deg) scale(0.6);
}
100% {
transform: rotate(90deg) scale(1);
}
}

View File

@ -0,0 +1,199 @@
.loader {
height: 100%;
width: 100%;
}
.loader .l_main {
position: absolute;
top: 20%;
left: 50%;
width: 172px;
height: 128px;
margin: 0;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
@media (max-width: 550px) {
.loader {
-webkit-transform: scale(0.75);
transform: scale(0.75);
}
}
@media (max-width: 440px) {
.loader {
-webkit-transform: scale(0.5);
transform: scale(0.5);
}
}
.l_square {
position: relative;
}
.l_square:nth-child(1) {
margin-left: 0px;
}
.l_square:nth-child(2) {
margin-left: 44px;
}
.l_square:nth-child(3) {
margin-left: 88px;
}
.l_square:nth-child(4) {
margin-left: 132px;
}
.l_square span {
position: absolute;
top: 0px;
left: 20px;
height: 36px;
width: 36px;
border-radius: 2px;
background-color: #1c44b2;
}
.l_square span:nth-child(1) {
top: 0px;
}
.l_square span:nth-child(2) {
top: 44px;
}
.l_square span:nth-child(3) {
top: 88px;
}
.l_square:nth-child(1) span {
-webkit-animation: animsquare1 2s infinite ease-in;
animation: animsquare1 2s infinite ease-in;
}
.l_square:nth-child(2) span {
-webkit-animation: animsquare2 2s infinite ease-in;
animation: animsquare2 2s infinite ease-in;
}
.l_square:nth-child(3) span {
-webkit-animation: animsquare3 2s infinite ease-in;
animation: animsquare3 2s infinite ease-in;
}
.l_square:nth-child(4) span {
-webkit-animation: animsquare4 2s infinite ease-in;
animation: animsquare4 2s infinite ease-in;
}
.l_square span:nth-child(1) {
-webkit-animation-delay: 0s;
animation-delay: 0s;
}
.l_square span:nth-child(2) {
-webkit-animation-delay: 0.15s;
animation-delay: 0.15s;
}
.l_square span:nth-child(3) {
-webkit-animation-delay: 0.3s;
animation-delay: 0.3s;
}
@-webkit-keyframes animsquare1 {
0%,
5%,
95%,
100% {
-webkit-transform: translate(0px, 0px) rotate(0deg);
transform: translate(0px, 0px) rotate(0deg);
}
30%,
70% {
-webkit-transform: translate(-40px, 0px) rotate(-90deg);
transform: translate(-40px, 0px) rotate(-90deg);
}
}
@keyframes animsquare1 {
0%,
5%,
95%,
100% {
-webkit-transform: translate(0px, 0px) rotate(0deg);
transform: translate(0px, 0px) rotate(0deg);
}
30%,
70% {
-webkit-transform: translate(-40px, 0px) rotate(-90deg);
transform: translate(-40px, 0px) rotate(-90deg);
}
}
@-webkit-keyframes animsquare2 {
0%,
10%,
90%,
100% {
-webkit-transform: translate(0px, 0px) rotate(0deg);
transform: translate(0px, 0px) rotate(0deg);
}
35%,
65% {
-webkit-transform: translate(-40px, 0px) rotate(-90deg);
transform: translate(-40px, 0px) rotate(-90deg);
}
}
@keyframes animsquare2 {
0%,
10%,
90%,
100% {
-webkit-transform: translate(0px, 0px) rotate(0deg);
transform: translate(0px, 0px) rotate(0deg);
}
35%,
65% {
-webkit-transform: translate(-40px, 0px) rotate(-90deg);
transform: translate(-40px, 0px) rotate(-90deg);
}
}
@-webkit-keyframes animsquare3 {
0%,
15%,
85%,
100% {
-webkit-transform: translate(0px, 0px) rotate(0deg);
transform: translate(0px, 0px) rotate(0deg);
}
40%,
60% {
-webkit-transform: translate(-40px, 0px) rotate(-90deg);
transform: translate(-40px, 0px) rotate(-90deg);
}
}
@keyframes animsquare3 {
0%,
15%,
85%,
100% {
-webkit-transform: translate(0px, 0px) rotate(0deg);
transform: translate(0px, 0px) rotate(0deg);
}
40%,
60% {
-webkit-transform: translate(-40px, 0px) rotate(-90deg);
transform: translate(-40px, 0px) rotate(-90deg);
}
}
@-webkit-keyframes animsquare4 {
0%,
20%,
80%,
100% {
-webkit-transform: translate(0px, 0px) rotate(0deg);
transform: translate(0px, 0px) rotate(0deg);
}
45%,
55% {
-webkit-transform: translate(-40px, 0px) rotate(-90deg);
transform: translate(-40px, 0px) rotate(-90deg);
}
}
@keyframes animsquare4 {
0%,
20%,
80%,
100% {
-webkit-transform: translate(0px, 0px) rotate(0deg);
transform: translate(0px, 0px) rotate(0deg);
}
45%,
55% {
-webkit-transform: translate(-40px, 0px) rotate(-90deg);
transform: translate(-40px, 0px) rotate(-90deg);
}
}

View File

@ -102,7 +102,7 @@
font-weight: normal;
}
.app-loading .lds-pacman {
/*.app-loading .lds-pacman {
position: relative;
margin: auto;
width: 200px !important;
@ -149,4 +149,4 @@
.app-loading .lds-pacman > div:nth-child(1) div:nth-child(3) {
-webkit-animation-delay: 0s;
animation-delay: 0s;
}
}*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 KiB

View File

@ -99,4 +99,6 @@
@import 'paper-dashboard/datasurvey-table';
@import 'paper-dashboard/datasurvey-contextmenu';
@import 'paper-dashboard/datasurvey-survey-update';
@import 'paper-dashboard/datasurvey-home';
@import 'paper-dashboard/datasurvey-filter';
@import 'paper-dashboard/datasurvey-survey';

View File

@ -0,0 +1,3 @@
.ds-filter:not(:first-of-type) {
margin-left: 2rem;
}

View File

@ -0,0 +1,112 @@
/**
Cards
**/
.lift {
box-shadow: 0 0.15rem 1.75rem 0 rgba(33, 40, 50, 0.15);
transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.lift:hover {
transform: translateY(-0.3333333333rem);
box-shadow: 0 0.5rem 2rem 0 rgba(33, 40, 50, 0.25);
}
.lift:active {
transform: none;
box-shadow: 0 0.15rem 1.75rem 0 rgba(33, 40, 50, 0.15);
}
.lift-sm {
box-shadow: 0 0.125rem 0.25rem 0 rgba(33, 40, 50, 0.2);
}
.lift-sm:hover {
transform: translateY(-0.1666666667rem);
box-shadow: 0 0.25rem 1rem 0 rgba(33, 40, 50, 0.25);
}
.lift-sm:active {
transform: none;
box-shadow: 0 0.125rem 0.25rem 0 rgba(33, 40, 50, 0.2);
}
.card-encuesta {
border-radius: 12px;
background-color: #ffffff;
margin-bottom: 20px;
position: relative;
border: 0 none;
}
.card-encuesta.lift {
text-decoration: none;
color: inherit;
}
.card-flag {
position: absolute;
font-size: 0.7rem;
padding: 0.3rem 0.5rem;
line-height: 1;
}
.card-flag-dark {
background-color: rgba(33, 40, 50, 0.7);
color: #fff;
}
.card-flag-light {
background-color: rgba(255, 255, 255, 0.7);
color: #69707a;
}
.card-flag-lg {
font-size: 0.9rem;
padding: 0.5rem 0.65rem;
}
.card-flag-top-right {
border-top-left-radius: 0.25rem;
border-bottom-left-radius: 0.25rem;
top: 0.5rem;
right: 0;
}
.card-flag-top-left {
border-top-right-radius: 0.25rem;
border-bottom-right-radius: 0.25rem;
top: 0.5rem;
left: 0;
}
.card-encuesta .entity-icon--star {
color: #ffcc47;
margin-right: 0.2rem;
}
.card-encuesta .card-title {
font-size: 2em;
}
.card-encuesta .tag {
font-size: 0.8rem;
color: #f8f8f8;
margin-top: 0.5rem;
padding: 0.2rem 1.5rem;
background-color: #2962ff94;
border-radius: 15px;
}
.card-encuesta .subtitle {
color: rgba(0, 0, 0, 0.54);
font-size: 0.9rem;
}
.card-encuesta .btn-card {
padding: 11px 10px !important;
}
.border-cyan {
border-color: #00cfd5 !important;
}
.py-10 {
padding-top: 6rem !important;
padding-bottom: 6rem !important;
}

View File

@ -31,6 +31,13 @@
padding: 0.5rem;
margin: 1rem;
word-wrap: break-word;
transition: all 0.1s ease-in-out;
&:hover {
// top: -3px;
// box-shadow: rgba(80, 80, 80, 0.15) 0px 5px 15px;
background-color: #f5f9fd;
}
* {
pointer-events: none;

View File

@ -23,7 +23,8 @@
"opcional": "Opcional",
"orden": "Orden",
"ePreguntaCerradaOpcion": "E Pregunta Cerrada Opcion",
"encuesta": "Encuesta"
"encuesta": "Encuesta",
"tiporespuesta": "Tipo de respuesta"
}
}
}

View File

@ -12,7 +12,9 @@
"updated": "Una encuesta ha sido actualizado con el identificador {{ param }}",
"deleted": "Una encuesta ha sido eliminada con el identificador {{ param }}",
"delete": {
"question": "¿Seguro que quiere eliminar la encuesta {{ id }}?"
"question": "¿Seguro que quiere eliminar la encuesta?",
"deletequestion": "¿Seguro que quiere eliminar esta pregunta?",
"deleteoption": "¿Seguro que quiere eliminar esta opción?"
},
"detail": {
"title": "Encuesta"

View File

@ -137,7 +137,7 @@
"value": "Valor"
},
"delete": {
"title": "Confirmar operación de borrado",
"title": "Confirmar de operación",
"status": "Confirmar cambio de estado"
},
"validation": {

View File

@ -12,6 +12,8 @@
<link rel="icon" href="favicon.ico" />
<link rel="manifest" href="manifest.webapp" />
<link rel="stylesheet" href="content/css/loading.css" />
<link rel="stylesheet" href="content/css/loading-2.css" />
<link rel="stylesheet" href="content/css/loading-boxes.css" />
<!-- jhipster-needle-add-resources-to-root - JHipster will add new resources here -->
</head>
<body>
@ -23,16 +25,23 @@
<![endif]-->
<jhi-main>
<div class="app-loading">
<div class="lds-pacman">
<div>
<div></div>
<div></div>
<div></div>
<div class="loader">
<div class="l_main">
<div class="l_square"><span></span><span></span><span></span></div>
<div class="l_square"><span></span><span></span><span></span></div>
<div class="l_square"><span></span><span></span><span></span></div>
<div class="l_square"><span></span><span></span><span></span></div>
</div>
<div>
<div></div>
<div></div>
<div></div>
</div>
<div class="container">
<div class="tittle"><h2>Cargando</h2></div>
<div class="square-container">
<div class="square square1">&nbsp;</div>
<div class="square square2">&nbsp;</div>
<div class="square square3">&nbsp;</div>
<div class="square square4">&nbsp;</div>
<div class="square square5">&nbsp;</div>
</div>
</div>
</div>