Um erro ocorreu enquanto processava o modelo.
The following has evaluated to null or missing: ==> themeDisplay.getURLCurrent()?split("/")[2] [in template "20102#20129#34563606" at line 344, column 41] ---- Tip: It's the final [] step that caused this error, not those before it. ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign friendlyURLTipoCurso = themeD... [in template "20102#20129#34563606" in function "getTipoCursoFirendlyUrl" at line 344, column 9] ----
1<#--
2Name: Unidade Página Modalidades
3Type: Asset Publisher Widget Template
4Path: ROOT/assets/unidades-tipos-de-curso/widget-templates/unidades_pagina_modalidades.html
5-->
6<#assign prefix = "ssp" />
7<#assign companyId = themeDisplay.getCompanyId() />
8<#assign siteGroupId = themeDisplay.getSiteGroupId() />
9<#assign friendlyUrlTipoCurso = getTipoCursoFirendlyUrl() />
10<#assign friendlyUrlUnidade = getUnidadeFirendlyUrl() />
11
12<#assign categoryId = 0 />
13
14<#if friendlyUrlTipoCurso?contains("livre")>
15 <#assign tipoCurso = "Livre" />
16 <#assign friendlyUrlTemaFirst = getTemaFirstLevelFriendly() />
17 <#assign friendlyUrlTemaSecond = getTemaSecondLevelFriendly() />
18 <#assign friendlyUrlTemaThird = getTemaThirdLevelFriendly() />
19
20<#-- cursos tecnicos nao tem 2o e 3o nivel de temas conforme prototipo GCR -->
21<#else>
22 <#assign tipoCurso = "Técnico" />
23 <#assign friendlyUrlTemaFirst = getTemaFirstLevelFriendly() />
24 <#assign friendlyUrlTemaSecond = "#erro#" />
25 <#assign friendlyUrlTemaThird = "#erro#" />
26</#if>
27
28<#assign groupService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService") />
29<#assign groupObj = groupService.fetchFriendlyURLGroup(companyId, "/"+friendlyUrlUnidade) />
30<#assign groupIdUnidade = groupObj.getGroupId() />
31
32 <#assign journal = getJournalArticle(groupIdUnidade) >
33 <#if !journal?contains("#erro#")>
34 <#assign groupIdUnidade = groupId />
35 <#assign journalArticleUnidade = journal>
36 <#assign document = saxReaderUtil.read(journalArticleUnidade.getContent()) />
37 <#assign rootElement = document.getRootElement() />
38
39 <#-- Get fields -->
40
41 <#-- Nome da unidade -->
42 <#assign xPathSelector_nomeUnidadeParaBreadCrumb = saxReaderUtil.createXPath("dynamic-element[@field-reference='nomeUnidade']")>
43 <#assign nomeUnidadeParaBreadCrumb = xPathSelector_nomeUnidadeParaBreadCrumb.selectSingleNode(rootElement).getStringValue()>
44
45 <#-- Nome da unidade -->
46 <#assign xPathSelector_nome = saxReaderUtil.createXPath("dynamic-element[@field-reference='nomeUsualUnidade']")>
47 <#assign nomeUnidade = xPathSelector_nome.selectSingleNode(rootElement).getStringValue()>
48
49 <#assign xPathSelector_codigoUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='codigoUnidade']")>
50 <#assign codigoUnidade = xPathSelector_codigoUnidade.selectSingleNode(rootElement).getStringValue()?trim>
51
52 <#if nomeUnidade?? >
53 <#assign nome = nomeUnidade >
54 <#else>
55 <#assign nome = "" >
56 </#if>
57
58 <#-- Endereço 1 -->
59
60 <#-- Rua -->
61 <#assign xPathSelector_enderecoUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='enderecoUnidade']")>
62 <#assign enderecoUnidade = xPathSelector_enderecoUnidade.selectSingleNode(rootElement).getStringValue()?trim>
63
64 <#if enderecoUnidade?? >
65 <#assign endereco = enderecoUnidade >
66 <#else>
67 <#assign endereco = "" >
68 </#if>
69
70 <#-- número -->
71 <#assign xPathSelector_numEnderecoUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='numEnderecoUnidade']")>
72 <#assign numeroUnidade = xPathSelector_numEnderecoUnidade.selectSingleNode(rootElement).getStringValue()?trim>
73
74 <#if numeroUnidade?? >
75 <#assign numero = numeroUnidade >
76 <#else>
77 <#assign numero = "" >
78 </#if>
79
80 <#-- Bairro -->
81 <#assign xPathSelector_bairroUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='bairroUnidade']")>
82 <#assign bairroUnidade = xPathSelector_bairroUnidade.selectSingleNode(rootElement).getStringValue()?trim>
83
84 <#if bairroUnidade?? >
85 <#assign bairro = bairroUnidade >
86 <#else>
87 <#assign bairro = "" >
88 </#if>
89
90 <#-- Cidade -->
91 <#assign xPathSelector_cidadeUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='cidadeUnidade']")>
92 <#assign cidadeUnidade = xPathSelector_cidadeUnidade.selectSingleNode(rootElement).getStringValue()?trim>
93
94 <#if cidadeUnidade?? >
95 <#assign cidade = cidadeUnidade >
96 <#else>
97 <#assign cidade = "" >
98 </#if>
99
100 <#-- Cep -->
101 <#assign xPathSelector_cepUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='cepUnidade']")>
102 <#assign cepUnidade = xPathSelector_cepUnidade.selectSingleNode(rootElement).getStringValue()?trim>
103
104 <#if cepUnidade?? >
105 <#assign cep = cepUnidade >
106 <#else>
107 <#assign cep = "" >
108 </#if>
109
110 <#-- Fim endereço 1 -->
111
112 <#-- Endereço 2 -->
113
114 <#-- Rua -->
115 <#assign xPathSelector_enderecoUnidade2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='enderecoUnidade2']")>
116 <#assign enderecoUnidade2 = xPathSelector_enderecoUnidade2.selectSingleNode(rootElement).getStringValue()?trim>
117
118 <#if enderecoUnidade2?? >
119 <#assign endereco2 = enderecoUnidade2 >
120 <#else>
121 <#assign endereco2 = "" >
122 </#if>
123
124 <#-- número -->
125 <#assign xPathSelector_numeroUnidade2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='numeroUnidade2']")>
126 <#assign numeroUnidade2 = xPathSelector_numeroUnidade2.selectSingleNode(rootElement).getStringValue()?trim>
127
128 <#if numeroUnidade2?? >
129 <#assign numero2 = numeroUnidade2 >
130 <#else>
131 <#assign numero2 = "" >
132 </#if>
133
134 <#-- Bairro -->
135 <#assign xPathSelector_bairroUnidade2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='bairroUnidade2']")>
136 <#assign bairroUnidade2 = xPathSelector_bairroUnidade2.selectSingleNode(rootElement).getStringValue()?trim>
137
138 <#if bairroUnidade2?? >
139 <#assign bairro2 = bairroUnidade2 >
140 <#else>
141 <#assign bairro2 = "" >
142 </#if>
143
144 <#-- Cidade -->
145 <#assign xPathSelector_cidadeUnidade2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='cidadeUnidade2']")>
146 <#assign cidadeUnidade2 = xPathSelector_cidadeUnidade2.selectSingleNode(rootElement).getStringValue()?trim>
147
148 <#if cidadeUnidade2?? >
149 <#assign cidade2 = cidadeUnidade2 >
150 <#else>
151 <#assign cidade2 = "" >
152 </#if>
153
154 <#-- Cep -->
155 <#assign xPathSelector_cepUnidade2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='cepUnidade2']")>
156 <#assign cepUnidade2 = xPathSelector_cepUnidade2.selectSingleNode(rootElement).getStringValue()?trim>
157
158 <#if cepUnidade2?? >
159 <#assign cep2 = cepUnidade2 >
160 <#else>
161 <#assign cep2 = "" >
162 </#if>
163
164 <#-- Fim endereço 2 -->
165
166
167
168 <#-- Horário -->
169 <#assign xPathSelector_horarioUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='horarioUnidade']")>
170 <#assign horarioUnidade = xPathSelector_horarioUnidade.selectSingleNode(rootElement).getStringValue()?trim>
171
172 <#if horarioUnidade?? >
173 <#assign horario = horarioUnidade >
174 <#else>
175 <#assign horario = "" >
176 </#if>
177
178 <#-- DDD -->
179 <#assign xPathSelector_dddUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='dddTelefoneUnidade']")>
180 <#assign dddUnidade = xPathSelector_dddUnidade.selectSingleNode(rootElement).getStringValue()?trim>
181
182 <#if dddUnidade?? >
183 <#assign ddd = dddUnidade >
184 <#else>
185 <#assign ddd = "" >
186 </#if>
187
188 <#-- telefone -->
189 <#assign xPathSelector_telefoneUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='telefoneUnidade']")>
190 <#assign telefoneUnidade = xPathSelector_telefoneUnidade.selectSingleNode(rootElement).getStringValue()?trim>
191
192 <#if telefoneUnidade?? >
193 <#assign telefone = telefoneUnidade >
194 <#else>
195 <#assign telefone = "" >
196 </#if>
197
198 <#-- UF -->
199 <#assign xPathSelector_ufUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='ufUnidade']")>
200 <#assign ufUnidade = xPathSelector_ufUnidade.selectSingleNode(rootElement).getStringValue()?trim>
201
202 <#if ufUnidade?? >
203 <#assign UF = ufUnidade >
204 <#else>
205 <#assign UF = "" >
206 </#if>
207
208 <#-- Estacionamento -->
209 <#assign xPathSelector_estacionamento = saxReaderUtil.createXPath("dynamic-element[@field-reference='estacionamentoUnidade']")>
210 <#assign estacionamentoUnidade = xPathSelector_estacionamento.selectSingleNode(rootElement).getStringValue()>
211
212 <#if estacionamentoUnidade?? >
213 <#assign estacionamento = estacionamentoUnidade >
214 <#else>
215 <#assign estacionamento = "" >
216 </#if>
217
218 <#-- Estacionamento Unidade 2 -->
219 <#assign xPathSelector_estacionamento2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='estacionamentoUnidade2']")>
220 <#assign estacionamentoUnidade2 = xPathSelector_estacionamento2.selectSingleNode(rootElement).getStringValue()>
221
222 <#if estacionamentoUnidade2?? >
223 <#assign estacionamento2 = estacionamentoUnidade2 >
224 <#else>
225 <#assign estacionamento2 = "" >
226 </#if>
227
228 <#-- Facebook -->
229 <#assign xPathSelector_facebookUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='facebookUnidade']")>
230 <#assign facebookUnidade = xPathSelector_facebookUnidade.selectSingleNode(rootElement).getStringValue()>
231
232 <#if facebookUnidade?? >
233 <#assign facebook = facebookUnidade >
234 <#else>
235 <#assign facebook = "" >
236 </#if>
237
238 <#-- Instagram -->
239 <#assign xPathSelector_instagramUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='instagramUnidade']")>
240 <#assign instagramUnidade = xPathSelector_instagramUnidade.selectSingleNode(rootElement).getStringValue()>
241
242 <#if instagramUnidade?? >
243 <#assign instagram = instagramUnidade >
244 <#else>
245 <#assign instagram = "" >
246 </#if>
247
248 <#-- Maps -->
249 <#assign xPathSelector_googlemapsUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='googlemapsUnidade']")>
250 <#assign googlemapsUnidade = xPathSelector_googlemapsUnidade.selectSingleNode(rootElement).getStringValue()?trim>
251
252 <#if googlemapsUnidade?? >
253 <#assign googlemaps = googlemapsUnidade >
254 <#else>
255 <#assign googlemaps = "" >
256 </#if>
257
258 <#assign hasMaps = (googlemaps?trim?length > 0) >
259
260
261
262 <#-- Waze -->
263 <#assign xPathSelector_wazeUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='wazeUnidade']")>
264 <#assign wazeUnidade = xPathSelector_wazeUnidade.selectSingleNode(rootElement).getStringValue()>
265
266 <#if wazeUnidade?? >
267 <#assign waze = wazeUnidade >
268 <#else>
269 <#assign waze = "" >
270 </#if>
271
272
273
274
275 <#-- Imagem -->
276
277 <#assign imagem = getImagemURL('imagemUnidade')>
278 <#assign imagem2 = getImagemURL('imagemUnidade2')>
279
280 <#-- Estação próxima -->
281 <#assign xPathSelector_estacaoProxima = saxReaderUtil.createXPath("dynamic-element[@field-reference='estacaoProxima']")>
282
283 <#assign estacaoProxima = xPathSelector_estacaoProxima.selectSingleNode(rootElement).getStringValue()>
284
285 <#assign hasEstacaoProxima = (estacaoProxima?trim?length > 0) >
286 </#if>
287
288 <#function getImagemURL fieldName>
289
290 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@field-reference='${fieldName}']")>
291
292 <#assign imagemStr = xPathSelector.selectSingleNode(rootElement).getStringValue()>
293
294 <#if imagemStr?contains("classPK") >
295 <#assign
296 imagemJson = jsonFactoryUtil.createJSONObject(imagemStr)
297 imagemId = getterUtil.getInteger(imagemJson.get('fileEntryId'))
298 dl = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppService")
299 dlURLHelper = serviceLocator.findService("com.liferay.document.library.util.DLURLHelper")
300 fileEntry = dl.getFileEntry(imagemId)
301 imagemURL = dlURLHelper.getImagePreviewURL(fileEntry, themeDisplay)
302 imagem = {
303 "alt" : imagemJson.get('alt'),
304 "url" : imagemURL
305 }
306 />
307 <#return imagem>
308 </#if>
309
310 <#return {"alt":"", "url":""}>
311
312 </#function>
313
314 <#function getJournalArticle groupId>
315 <#assign journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
316 <#assign friendlyURL = getUnidadeFirendlyUrl()>
317
318 <#attempt>
319
320 <#if !friendlyURL?contains("fragment_collections") >
321
322 <#return journalArticleService.getArticleByUrlTitle(groupId,friendlyURL)>
323
324 </#if>
325
326 <#recover>
327
328 <#return '#erro#'>
329 </#attempt>
330 </#function>
331
332 <#function getUnidadeFirendlyUrl >
333 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first />
334 <#if friendly?contains("web") >
335 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[3]?split("?")?first>
336 </#if>
337
338 <#return friendly />
339
340 </#function>
341
342 <#function getTipoCursoFirendlyUrl >
343
344 <#assign friendlyURLTipoCurso = themeDisplay.getURLCurrent()?split("/")[2]?split("?")?first />
345 <#if friendlyURLTipoCurso?contains("guest") >
346 <#assign friendlyURLTipoCurso = themeDisplay.getURLCurrent()?split("/")[4]?split("?")?first>
347 </#if>
348
349 <#return friendlyURLTipoCurso />
350
351 </#function>
352
353 <#function getTemaFirstLevelFriendly >
354 <#attempt>
355 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first />
356 <#if !friendly?contains("web") >
357 <#if themeDisplay.getURLCurrent()?split("/")?size gt 3 >
358 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[3]?split("?")?first />
359 <#else>
360 <#assign friendly = "" />
361 </#if>
362
363 <#else>
364 <#if themeDisplay.getURLCurrent()?split("/")?size gt 5 >
365 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[5]?split("?")?first>
366 <#else>
367 <#assign friendly = "" />
368 </#if>
369 </#if>
370
371 <#return friendly />
372 <#recover>
373 <#return '#erro#'>
374 </#attempt>
375
376</#function>
377
378 <#function getTemaSecondLevelFriendly >
379 <#attempt>
380 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first />
381
382 <#if !friendly?contains("web") >
383 <#if themeDisplay.getURLCurrent()?split("/")?size gt 4 >
384 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[4]?split("?")?first />
385 <#else>
386 <#assign friendly = "" />
387 </#if>
388 <#else>
389 <#if themeDisplay.getURLCurrent()?split("/")?size gt 6 >
390 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[6]?split("?")?first>
391 <#else>
392 <#assign friendly = "" />
393 </#if>
394 </#if>
395
396 <#return friendly />
397 <#recover>
398 <#return '#erro#'>
399 </#attempt>
400
401</#function>
402
403 <#function getTemaThirdLevelFriendly >
404 <#attempt>
405 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first />
406
407 <#if !friendly?contains("web") >
408 <#if themeDisplay.getURLCurrent()?split("/")?size gt 5 >
409 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[5]?split("?")?first />
410 <#else>
411 <#assign friendly = "" />
412 </#if>
413 <#else>
414 <#if themeDisplay.getURLCurrent()?split("/")?size gt 7 >
415 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[7]?split("?")?first>
416 <#else>
417 <#assign friendly = "" />
418 </#if>
419 </#if>
420 <#return friendly />
421 <#recover>
422 <#return '#erro#'>
423 </#attempt>
424
425</#function>
426
427<style>
428
429/*Header Unidade*/
430
431.ssp-header-unidade__content-info-body{
432 padding-top:30px;
433}
434
435.ssp-header-unidade__atendimento-container > p > a {
436 color:white!important;
437}
438
439.ssp-header-unidade__atendimento-container > p > a:hover {
440 color:white!important;
441 font-weight: normal!important;
442}
443
444.creditoFotoMob{
445
446 margin: 0 auto;
447 background: #FFF7D6;
448 font-family: 'Montserrat';
449 font-size: 14px;
450 line-height: 1.6em;
451 border-radius: 3px;
452 max-width: 240px;
453 height: auto;
454 color: #4F596F;
455 padding: 5px;
456 position: relative;
457 float: right;
458 top: 70%;
459 max-height: 40px;
460 font-weight: 500;
461 right: 15%;
462 flex-wrap: unset;
463}
464
465.creditoFotoMob:after{ /*Triangulo*/
466 content: "";
467 width: 0;
468 height: 0;
469 position: absolute;
470 border-left: 10px solid transparent;
471 border-right: 10px solid transparent;
472 /*Faz seta "apontar para baixo. Definir o valor como 'top' fará ela "apontar para cima" */
473 /*Aqui entra a cor da "aba" do balão */
474 border-bottom: 10px solid #FFF7D6;
475 top: -9px; /*localização. Experimente alterar para 'bottom'*/
476 left: 20%;
477}
478.tooltip-inner {
479 max-width: 230px;
480 padding: 0.75rem 0.75rem;
481 color: #4F596F;
482 text-align: center;
483 background-color: #FFF7D6;
484 border-radius: 0.3125rem;
485}
486.bs-tooltip-top .arrow::before, .bs-tooltip-auto[x-placement^="top"] .arrow::before {
487 top: 0;
488 border-width: 0.4rem 0.4rem 0;
489 border-top-color: #FFF7D6;
490}
491.ssp-header-title-bloco {
492 font-size: 20px;
493 font-weight: 600;
494}
495
496.ssp:not(.liferay-instance) .ssp-header-unidade__imagem-box-imagem{
497 height:100%;
498}
499/*#slider {
500 width: 80%;
501 max-width: 500px;
502 height: 25vw;
503 max-height: 150px;
504
505 position: relative;
506}*/
507
508#slider .ssp-header-unidade__imagem-box-imagem{
509 opacity: 0;
510 position: absolute;
511 /*width: 100%;
512 height: 100%;*/
513 object-fit: cover;
514 transition: opacity 2000ms;
515}
516
517#slider .ssp-header-unidade__imagem-box-imagem.selected {
518 opacity: 1;
519}
520
521@media only screen and (max-width: 1024px) {
522
523#slider .ssp-header-unidade__imagem-box-imagem{
524 margin-top: -240px;
525 height: 248px;
526
527 }
528 .ssp-header-unidade__container-info {
529 margin-top: 240px!important;
530 }
531
532}
533
534 @media only screen and (max-width: 768px){
535
536 .ssp:not(.liferay-instance) .ssp-header-unidade__imagem-box-imagem{
537 height:228px;
538 }
539 .ssp-header-title-bloco {
540 font-size: 14px;
541}
542
543 .creditoFotoMob{
544 font-size: 9px!important;
545 max-width: 161px!important;
546 max-height: 30px!important;
547 padding: 8.5px 9.5px!important;
548 line-height: 0.6em!important;
549
550 }
551}
552
553/* Final Header Unidade*/
554
555.btn-nivel-livre-ead{
556 background-color: #ff9057;
557 border-color: #ff9057;
558 box-shadow: none;
559 }
560
561 .icon-ao-vivo{
562 font-size:12px;
563 margin:0 3px;
564 }
565
566
567.subtema-ativo{
568
569 color:#fcc080!important;
570}
571
572.separador-subtemas{
573 width:100% !important;
574 margin-top: -1em !important;
575 margin-bottom: 2.25rem!important;
576}
577
578</style>
579
580<#if tipoCurso == "Livre">
581
582 <style>
583 .ssp:not(.liferay-instance) .ativo{
584 background-color: #FF9057!important;
585 color:white!important;
586 font-weight: 600!important;
587 }
588
589 .tema-ativo{
590 background-color: #FF9057!important;
591 color:white!important;
592 font-weight: 600!important;
593 }
594 </style>
595
596<#else>
597
598 <style>
599
600 .ssp:not(.liferay-instance) .ativo{
601 background-color: #F7BD23!important;
602 color: #454F63!important;
603 font-weight: 600!important;
604 }
605
606 .tema-ativo{
607 background-color: #F7BD23!important;
608 color: #454F63!important;
609 font-weight: 600!important;
610 }
611
612 .ssp:not(.liferay-instance) .ssp-section-tema__container-menu-item .tema:hover {
613 background-color: #F7BD23;
614 color: white;
615 font-weight: 600 !important;
616 }
617
618 .subtema.btn-nivel-3.subtema-ativo {
619 background: #F7BD23!important;
620 color: white!important;
621 border-color: #F7BD23!important;
622 }
623
624 </style>
625
626</#if>
627
628<style>
629
630/* css para link no nome da unidade */
631
632.ssp-header-unidade__title a{
633
634 text-decoration: none!important;
635 font-family: Montserrat;
636 font-size: 44px;
637 max-width: 440px;
638 font-weight: 600!important;
639 line-height: 1.23;
640 text-align: left;
641 color: white;
642}
643
644.ssp-section-tema__subtitle-curso-section {
645
646 margin-left: 40px!important;
647
648}
649
650.ssp-page-busca__section-resultado__ver-todos{
651 margin-right: 40px!important;
652}
653
654.submenu-tema-ativo{
655 background-color: #34495e!important;
656 color:white!important;
657 font-weight: 600!important;
658}
659
660.submenu-tema-ativo-hover{
661 background-color: #34495e!important;
662 color:white!important;
663 font-size:50px;
664 font-weight: 600!important;
665}
666
667.subtema.btn-nivel-3.subtema-ativo{
668 background:#a2acc3!important;
669 color:white!important;
670}
671
672.slider-curso>.slick-area__item{
673
674width:100%;
675
676}
677
678.custom-card-curso-tema{
679
680 height:288px!important;
681
682}
683
684@media only screen and (max-width: 768px){
685
686 .ssp:not(.liferay-instance) .custom-card-curso-tema {
687 width: 100% !important;
688 height:auto!important;
689 }
690
691
692 .ssp-page-busca__section-resultado__ver-todos {
693 display:none;
694 }
695
696 .filtroInscBolsa{
697 display:none!important;
698 }
699
700}
701
702.ssp:not(.liferay-instance) .ssp-container__cursos-sem-slick {
703 display: flex;
704 justify-content: center;
705 flex-wrap: wrap;
706}
707
708/*Novas funcionalidades*/
709 #filtro-temas-nivel-3{
710 padding-bottom: 2em;
711 }
712
713 .switch {
714 position: relative;
715 display: inline-block;
716 width: 63px;
717 height: 31.5px;
718 margin: 0;
719 }
720
721 .switch input {
722 opacity: 0;
723 width: 0;
724 height: 0;
725 }
726
727 .slider {
728 position: absolute;
729 cursor: pointer;
730 top: 0;
731 left: 0;
732 right: 0;
733 bottom: 0;
734 background-color: #ccc;
735 -webkit-transition: .4s;
736 transition: .4s;
737 }
738
739 .slider:before {
740 position: absolute;
741 content: "";
742 height: 21px;
743 width: 21px;
744 left: 7px;
745 bottom: 5.5px;
746 background-color: white;
747 -webkit-transition: .4s;
748 transition: .4s;
749 }
750
751 input:checked + .slider {
752 background-color: #5ACC75;
753 }
754
755 input:focus + .slider {
756 box-shadow: 0 0 1px #5ACC75;
757 }
758
759 input:checked + .slider:before {
760 -webkit-transform: translateX(26px);
761 -ms-transform: translateX(26px);
762 transform: translateX(26px);
763 }
764
765 /* Rounded sliders */
766 .slider.round {
767 border-radius: 35px;
768 }
769
770 .slider.round:before {
771 border-radius: 50%;
772 }
773
774 /* content filter */
775
776 .ssp-slider-check__container{
777
778 display: flex;
779 justify-content: flex-end;
780
781 }
782
783 .ssp-slider-check__content-itens{
784
785 display: flex;
786 width: 640px!important;
787 justify-content: space-between;
788
789 }
790
791 .ssp-slider-check__content-item{
792
793 display: flex;
794 align-items: center;
795
796 }
797
798 .ssp-slider-check__label{
799
800 font-family: Montserrat;
801 color: #78849E;
802 font-size: 16px;
803 padding-left: 10px;
804 font-weight: 600;
805
806 }
807
808 .ssp-section-tema__container-menu {
809 padding-bottom: 15px;
810 }
811
812 .ssp-section-tema__subtitle-desconto{
813 display: block;
814 font-size: 30px;
815 }
816
817 @media only screen and (max-width: 1024px) {
818
819 .ssp-section-tema__subtitle-desconto{
820 font-size: 19px;
821 }
822
823 .ssp-header-unidade__title a{
824
825 font-size: 24px;
826 }
827
828 .ssp-section-tema__subtitle-curso-section {
829
830 margin-left: 0px!important;
831
832 }
833
834 #filtro-ativo-nivel-2{
835 justify-content: center;
836 }
837
838 .ssp-slider-check__label{
839
840 font-size: 11px;
841
842 }
843
844 .tema-slick-area {
845
846 display: flex;
847 align-items: center;
848 justify-content: flex-start;
849 font-size: 0;
850 flex-wrap: wrap;
851 }
852
853 /* custom itens */
854
855
856 .ssp-unidade-temas__label-filtre-por{
857 font-size: 15px!important;
858 padding-left: 5px!important;
859 }
860
861
862 .ssp-section-tema__container-menu {
863 height: auto!important;
864 }
865
866 .tema-slick-area-mobile {
867 display: flex;
868 align-items: center;
869 justify-content: center;
870 font-size: 0;
871 flex-wrap: wrap;
872 }
873
874 .ssp-section-tema__container-submenu-nivel3 {
875
876 justify-content: center;
877 }
878
879 .ssp-slider-check__container{
880 padding-top:10px!important;
881 }
882 }
883</style>
884
885<#if tipoCurso == "Livre">
886
887 <style>
888 @media only screen and (max-width: 768px){
889 .tema-ativo::after{
890 font-family: "Font Awesome 5 Free";
891 font-weight: 900;
892 content: "\f00d";
893 font-size: 12px;
894 margin: 0 5px;
895 }
896 }
897 </style>
898</#if>
899<style>
900 @media only screen and (max-width: 768px){
901 .subtema-ativo::after{
902 font-family: "Font Awesome 5 Free";
903 font-weight: 900;
904 content: "\f00d";
905 font-size: 12px;
906 margin: 0 5px;
907 }
908
909 .ssp:not(.liferay-instance) .ssp-page-busca__section-resultado__ver-todos-mobile {
910 font-family: Montserrat;
911 font-size: 16px;
912 font-weight: 600;
913 line-height: 1.21;
914 color: #78849e;
915 text-decoration: none !important;
916 transition: 0.3s;
917 text-align: center !important;
918 padding-left: 7em;
919 }
920
921 .ssp:not(.liferay-instance) .ssp-page-busca__section-resultado__ver-todos-mobile::after {
922 font-family: FontAwesome;
923 font-weight: 900;
924 content: '\f054';
925 font-size: 12px;
926 margin-left: 5px;
927 }
928
929 }
930
931 /* Custom css para unidades */
932
933 .ssp-unidade-temas__label-filtre-por{
934
935 font-family: Montserrat;
936 font-size: 20px;
937 font-weight: 600;
938 padding: 15px;
939 padding-left: 30px;
940 color: #78849E;
941
942 }
943
944 .ssp-section-tema__container-submenu-nivel3 .btn-nivel-3 {
945 margin: 15px 10px;
946
947 }
948
949
950 .ssp-line-nivel-divisor {
951 width: 100%;
952 height: 1px;
953 background: #78849E;
954 margin: 15px 0;
955 }
956
957 .ssp-header-unidade__content-info{
958 z-index: 0!important;
959 }
960
961 .ssp-btn-tema-mobile--active{
962 background-color: #FE9057!important;
963 color: white!important;
964 }
965
966 .ssp-btn-tema-mobile--active::after{
967 font-family: "Font Awesome 5 Free";
968 font-weight: 900;
969 content: "\f00d";
970 font-size: 12px;
971 margin: 0 5px;
972 }
973
974 .ssp-btn-subtema-mobile--active{
975 background-color: #78849E!important;
976 color: white!important;
977 }
978
979
980
981 /* Botão Visualizar mais */
982
983 .ssp-btn__visualizar-mais-content{
984 display: flex;
985 flex-wrap: nowrap;
986 align-items: center;
987 justify-content: center;
988 }
989
990 .ssp-btn__visualizar-mais{
991 cursor: pointer;
992 font-size: 14px;
993 }
994
995 #visualizar-mais{
996 font-family:montserrat;
997 }
998
999 .tema{
1000 box-shadow: none !important;
1001 }
1002 .separador-subtemas{
1003 margin:10px 0px 30px 0px!important;
1004 }
1005
1006 .py-5{
1007 padding-bottom: 0px!important;
1008 padding-top: 5px!important;
1009 }
1010
1011 .ssp-section-tema__title{
1012 margin: 40px 0px 25px 0px!important;
1013 }
1014@media only screen and (min-width: 1025px){
1015 .ssp-section-tema__container-submenu-nivel3 .btn-nivel-3 {
1016 margin-bottom: 20px!important;
1017 }
1018
1019 .filtroTextoMobile{
1020 display: none;
1021 }
1022}
1023
1024.ssp-section-tema__title{
1025 margin: 40px 0px 25px 0px!important;
1026}
1027
1028.py-5{
1029 padding-bottom: 0px!important;
1030 padding-top: 5px!important;
1031}
1032
1033.ssp-slider-check__content-itens{
1034 display: flex;
1035 width: 800px!important;
1036 justify-content: flex-end!important;
1037}
1038
1039.ssp-slider-check__content-item{
1040 display: flex;
1041 align-items: center;
1042 padding: 0 20px;
1043}
1044
1045/* novo botao ver todos os cursos */
1046
1047.ver-todos-cursos-link{
1048 color: #78849E!important;
1049}
1050
1051.ver-todos-cursos-link:hover{
1052 color: #515A6B!important;
1053}
1054
1055.ver-todos-cursos-link:hover p{
1056 color: #515A6B!important;
1057}
1058
1059.custom-card-curso-tema{
1060
1061 height:282px!important;
1062
1063}
1064
1065.container-fluid .row{
1066 margin: 0 !important;
1067}
1068
1069
1070.container-fluid .col-md-12{
1071 padding: 0 !important;
1072}
1073
1074.ver-todos-no-click{
1075 text-decoration: none !important;
1076 pointer-events: none !important;
1077}
1078
1079.slick-area__item.card-curso-nivel-2 .custom-card-curso-tema__title{
1080 height: 70px;
1081}
1082
1083/*novo forma de exibir o menu de areas*/
1084
1085.ssp:not(.liferay-instance) .ativo {
1086 background-color: #F7BD23!important;
1087 color: #454F63!important;
1088 font-weight: 600 !important;
1089}
1090
1091.ssp:not(.liferay-instance) .ssp-section-tema__container-menu-item .tema {
1092 font-size: 15px;
1093 color: #454F63;
1094}
1095
1096.ssp:not(.liferay-instance) .ssp-section-tema__container-menu-item .tema:hover {
1097 background-color: #F7BD23;
1098 color: #454F63!important;
1099 font-weight: 600 !important;
1100}
1101
1102.ssp:not(.liferay-instance) .ssp-section-tema__container-menu {
1103 flex-wrap: wrap;
1104}
1105
1106.tema i{
1107 margin-right: 8px;
1108}
1109
1110.subtema.btn-nivel-3.subtema-ativo {
1111 background: #F7BD23!important;
1112 color: #454F63!important;
1113 border-color: #F7BD23!important;
1114}
1115
1116.ssp:not(.liferay-instance) .ssp-section-tema__container-submenu-nivel3 .btn-nivel-3 {
1117font-weight: 600;
1118color: #454F63;
1119}
1120
1121/* Transporte próximo */
1122
1123.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento {
1124 display:block;
1125 padding-top: 5px;
1126}
1127
1128.ssp:not(.liferay-instance) .ssp-header-unidade__endereco-container {
1129 display: flex;
1130 align-items: center;
1131 justify-content: space-between;
1132 flex-flow: column;
1133 align-items: flex-start;
1134 gap: 15px;
1135}
1136
1137.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento a{
1138 color:white;
1139}
1140
1141.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento a:hover{
1142 font-weight:normal!important;
1143}
1144
1145.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento p{
1146 display:inline-block;
1147 margin: 0;
1148}
1149
1150.ssp:not(.liferay-instance) .ssp-header-unidade__endereco {
1151 max-width: 100%;
1152}
1153
1154@media only screen and (max-width: 768px){
1155
1156 .ssp:not(.liferay-instance) .ssp-header-unidade__container-info .container {
1157 padding: 0;
1158 }
1159
1160 .ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento p{
1161 display:inline;
1162 font-size: 13px;
1163 }
1164}
1165
1166
1167
1168
1169
1170/* Alteracoes para 10019 */
1171#filtro-temas-nivel-2 .subtema.subtema-ativo:not(.todos){
1172 margin: 0 auto 30px auto!important;
1173}
1174#filtro-temas-nivel-2 .btn-nivel-3{
1175 display: inline-flex;
1176 height: 40.061px;
1177 padding: 16.868px;
1178 justify-content: center;
1179 align-items: center;
1180 gap: 16.868px;
1181 flex-shrink: 0;
1182 border-radius: 8px;
1183 border: 1.054px solid #C3CAD9;
1184}
1185.tema-ativo::after{
1186 font-family: "Font Awesome 5 Free";
1187 font-weight: 900;
1188 content: "\f00d";
1189 font-size: 12px;
1190 margin: 0 5px;
1191}
1192.subtema-ativo:not(.subtema-ativo.todos)::after{
1193 font-family: "Font Awesome 5 Free";
1194 font-weight: 900;
1195 content: "\f00d";
1196 font-size: 12px;
1197 margin: 0 5px;
1198}
1199#filtro-temas-nivel-3{
1200 margin-bottom: 20px;
1201}
1202#filtro-temas-nivel-3 a:not(.todos, .subtema-ativo)::after{
1203 content: "+";
1204 padding-left: 10px;
1205 font-size: 16px;
1206}
1207.ssp:not(.liferay-instance) .ssp-section-tema__title{
1208 color: #78849E;
1209 text-align: center;
1210 font-family: Montserrat;
1211 font-size: 32px;
1212 font-style: normal;
1213 font-weight: 600;
1214 line-height: normal;
1215}
1216.ssp:not(.liferay-instance) .ssp-section-tema__title.selected {
1217 font-size: 24px;
1218 font-weight: 400;
1219}
1220.ssp:not(.liferay-instance) .ssp-section-tema__title::after {
1221 display: none!important;
1222}
1223.ssp-title-filtrar-mais {
1224 color: #454F63;
1225 font-family: Montserrat;
1226 font-size: 20px;
1227 font-style: normal;
1228 font-weight: 600;
1229 line-height: normal;
1230 margin-top: 58px;
1231 margin-bottom: 24px;
1232 margin-left: 10px;
1233}
1234#filtro-temas-nivel-3 .subtema {
1235 border-radius: 32px;
1236 border: 1.054px solid #C3CAD9;
1237 display: flex;
1238 height: 32px;
1239 padding: 16.868px 16px;
1240 justify-content: center;
1241 align-items: center;
1242 gap: 12px;
1243 color: var(--boto, #636C7E);
1244 text-align: center;
1245 font-family: Montserrat;
1246 font-size: 16px;
1247 font-style: normal;
1248 font-weight: 600;
1249 line-height: normal;
1250}
1251.ssp-divider {
1252 content: " ";
1253 display: block;
1254 background-color: #78849E;
1255 width: 127px;
1256 height: 3px;
1257 margin: -25px auto 50px;
1258}
1259.ssp-section-tema__container-menu-item:has(.tema-ativo) {
1260 margin-left: auto;
1261 margin-right: auto;
1262}
1263
1264@media only screen and (max-width: 1024px) {
1265 .ssp-title-filtrar-mais {
1266 color: #454F63;
1267 font-family: Montserrat;
1268 font-size: 18px;
1269 font-style: normal;
1270 font-weight: 600;
1271 line-height: normal;
1272 margin-top: 48px;
1273 margin-bottom: 40px;
1274 margin-left: 0px;
1275 }
1276 .ssp:not(.liferay-instance) .ssp-section-tema__title {
1277 color: #78849E;
1278 text-align: center;
1279 font-family: Montserrat;
1280 font-size: 21px;
1281 font-style: normal;
1282 font-weight: 700;
1283 line-height: normal;
1284 }
1285
1286 .ssp:not(.liferay-instance) .ssp-section-tema__title.selected {
1287 font-size: 16px;
1288 font-weight: 400;
1289 }
1290
1291 .ssp-divider {
1292 margin: 0px auto 30px;
1293 }
1294}
1295
1296
1297/* novo style tags tipo de curso */
1298
1299section#section-links div.container.text-left {
1300 max-width: none!important;
1301 padding: 0 28px!important;
1302}
1303
1304
1305.btn-nivel-panelinha{
1306 background-color: #F9C5B5 !important;
1307 order: 12;
1308 color: black;
1309}
1310
1311.ssp:not(.liferay-instance) .ssp-btns-horizontal-area{
1312 max-width: 1090px;
1313 gap: 16px;
1314}
1315
1316.btn-nivel-panelinha:hover {
1317 background-color: #E56C5A !important;
1318}
1319
1320.btn-nivel-panelinha:active {
1321 background-color: #E1523D !important;
1322}
1323
1324.ssp:not(.liferay-instance) .ssp-btns-horizontal-area a.btn.btn-nivel{
1325 color: #000!important;
1326 border: none!important;
1327 font-size: 16px!important;
1328 padding-left: unset!important;
1329 padding-right: unset!important;
1330 padding-top: unset!important;
1331 padding-bottom: unset!important;
1332 padding: 16px!important;
1333 border-radius: 20px;
1334 margin: 0!important;
1335 max-height: 52px;
1336}
1337
1338.ssp:not(.liferay-instance) .ssp-btns-horizontal-area a.btn.btn-nivel[target=_blank]::after {
1339 font-family: "Font Awesome 6 Pro";
1340 content: "\f08e";
1341 font-size: 1rem;
1342 margin-left: 8px;
1343}
1344
1345.ssp-btns-horizontal-area .btn-nivel-especializacao-tecnica{
1346 background-color: #FDF2D7;
1347 order: 1;
1348}
1349.ssp-btns-horizontal-area .btn-nivel-especializacao-tecnica:hover{
1350 background-color: #FACA5C;
1351}
1352.ssp-btns-horizontal-area .btn-nivel-especializacao-tecnica:active{
1353 background-color: #F6BC39;
1354}
1355
1356
1357.ssp-btns-horizontal-area .btn-nivel-tecnico{
1358 background-color: #FDF2D7;
1359 order: 2;
1360}
1361.ssp-btns-horizontal-area .btn-nivel-tecnico:hover{
1362 background-color: #FACA5C;
1363}
1364.ssp-btns-horizontal-area .btn-nivel-tecnico:active{
1365 background-color: #F6BC39;
1366}
1367
1368
1369.ssp-btns-horizontal-area .btn-nivel-ensino-medio-tecnico{
1370 background-color: #F4E0F4;
1371 order: 3;
1372}
1373.ssp-btns-horizontal-area .btn-nivel-ensino-medio-tecnico:hover{
1374 background-color: #D281D5;
1375}
1376.ssp-btns-horizontal-area .btn-nivel-ensino-medio-tecnico:active{
1377 background-color: #C665C9;
1378}
1379
1380
1381.ssp-btns-horizontal-area .btn-nivel-livre{
1382 background-color: #FFE9DF;
1383 order: 4;
1384}
1385.ssp-btns-horizontal-area .btn-nivel-livre:hover{
1386 background-color: #FFA47B;
1387}
1388.ssp-btns-horizontal-area .btn-nivel-livre:active{
1389 background-color: #FD905E;
1390}
1391
1392
1393.ssp-btns-horizontal-area .btn-nivel-idiomas{
1394 background-color: #FFE9DF;
1395 order: 5;
1396}
1397.ssp-btns-horizontal-area .btn-nivel-idiomas:hover{
1398 background-color: #FFA47B;
1399}
1400.ssp-btns-horizontal-area .btn-nivel-idiomas:active{
1401 background-color: #FD905E;
1402}
1403
1404
1405.ssp-btns-horizontal-area .btn-nivel-graduacao{
1406 background-color: #DCEBF9;
1407 order: 6;
1408}
1409.ssp-btns-horizontal-area .btn-nivel-graduacao:hover{
1410 background-color: #6EACEA;
1411}
1412.ssp-btns-horizontal-area .btn-nivel-graduacao:active{
1413 background-color: #4E99E3;
1414}
1415.ssp-btns-horizontal-area .btn-nivel-graduacao-ead{
1416 background-color: #DCEBF9;
1417 order: 7;
1418}
1419.ssp-btns-horizontal-area .btn-nivel-graduacao-ead:hover{
1420 background-color: #6EACEA;
1421}
1422.ssp-btns-horizontal-area .btn-nivel-graduacao-ead:active{
1423 background-color: #4E99E3!important;
1424}
1425
1426
1427.ssp-btns-horizontal-area .btn-nivel-pos-graduacao{
1428 background-color: #E1E0FE;
1429 order: 8;
1430}
1431.ssp-btns-horizontal-area .btn-nivel-pos-graduacao:hover{
1432 background-color: #8280FE;
1433}
1434.ssp-btns-horizontal-area .btn-nivel-pos-graduacao:active{
1435 background-color: #6764FB;
1436}
1437.ssp-btns-horizontal-area .btn-nivel-pos-graduacao-ead{
1438 background-color: #E1E0FE;
1439 order: 9;
1440}
1441.ssp-btns-horizontal-area .btn-nivel-pos-graduacao-ead:hover{
1442 background-color: #8280FE;
1443}
1444.ssp-btns-horizontal-area .btn-nivel-pos-graduacao-ead:active{
1445 background-color: #6764FB;
1446}
1447
1448
1449.ssp-btns-horizontal-area .btn-nivel-extensao{
1450 background-color: #DAF5ED;
1451 order: 10!important;
1452}
1453.ssp-btns-horizontal-area .btn-nivel-extensao:hover{
1454 background-color: #68D7B8;
1455}
1456.ssp-btns-horizontal-area .btn-nivel-extensao:active{
1457 background-color: #47CBA7;
1458}
1459.ssp-btns-horizontal-area .btn-nivel-extensao-ead{
1460 background-color: #DAF5ED;
1461 order: 11;
1462}
1463.ssp-btns-horizontal-area .btn-nivel-extensao-ead:hover{
1464 background-color: #68D7B8;
1465}
1466.ssp-btns-horizontal-area .btn-nivel-extensao-ead:active{
1467 background-color: #47CBA7;
1468}
1469
1470.ssp-btns-horizontal-area .btn-nivel-jovem-aprendiz{
1471 background-color: #DAF5F9;
1472}
1473.ssp-btns-horizontal-area .btn-nivel-jovem-aprendiz:hover{
1474 background-color: #66D7E8;
1475}
1476.ssp-btns-horizontal-area .btn-nivel-jovem-aprendiz:active{
1477 background-color: #44CCE0;
1478}
1479
1480
1481</style>
1482
1483<#assign assetVocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")>
1484<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")>
1485<#assign groupId = themeDisplay.getSiteGroupId()>
1486
1487<#assign vocabularyTemaMercadologico = assetVocabularyLocalService.getGroupVocabulary(groupId, "Tema(Mercadológico)")>
1488
1489<input type="hidden" id="ssp-vocabulary-id-tema-mercadologico" value="${vocabularyTemaMercadologico.getVocabularyId()}">
1490
1491
1492<#-- Header da Unidade -->
1493
1494
1495<section style="position:relative;">
1496 <div class="ssp-header-unidade__imagem-box">
1497 <div class="ssp-header-unidade__imagem-box-box-linha"></div>
1498
1499 <div class="ssp-header-unidade__imagem-box-box-linha2"></div>
1500
1501 <div id="slider">
1502
1503 <div class="ssp-header-unidade__imagem-box-imagem selected" style="background-image: url(${imagem.url})">
1504
1505 </div>
1506
1507 <#if endereco2?length != 0>
1508
1509 <div class="ssp-header-unidade__imagem-box-imagem" style="background-image: url(${imagem2.url})"></div>
1510
1511 </#if>
1512
1513
1514
1515 </div>
1516 <!--div class="ssp-header-unidade__imagem-box-imagem" style="background-image: url(img/bg-fale-com-gente.jpg)"></div-->
1517
1518 <#-- dados de compartilhamento -->
1519 <@liferay_util["html-top"]>
1520 <meta name="image" property="og:image" content="${imagem.url}">
1521 <meta property="og:image:width" content="1024">
1522 </@>
1523 <#-- dados de compartilhamento -->
1524
1525 <#if tipoCurso == "Livre" >
1526 <div class="ssp-header-tema__tag-tipo-curso"></div>
1527 <#else>
1528 <!-- Tag de Tipo de Curso -->
1529 <div class="ssp-header-tema__tag-tipo-curso bg-nivel-tecnico"></div>
1530
1531 </#if>
1532 <div class="ssp-header-unidade__container-info">
1533
1534 <div class="container">
1535
1536 <div class="ssp-header-unidade__content-info" style="height: auto;">
1537
1538 <div class="ssp-header-unidade__content-info-container">
1539
1540 <div>
1541
1542 <div>
1543 <small class="ssp-header-unidade__subtitle">Senac</small>
1544 </div>
1545
1546 <div class="ssp-header-unidade__title-container">
1547
1548 <div>
1549
1550 <h1 class="ssp-header-unidade__title">
1551 <a href="https://www.sp.senac.br/${friendlyUrlUnidade}">
1552 ${nome}
1553 </a>
1554 </h1>
1555
1556
1557 </div>
1558
1559 <#-- o código da unidade é usado para referência de unidade no -->
1560 <span id="codUnidadeReferencia" class="d-none">${codigoUnidade}</span>
1561 <span id="friendlyUnidade" class="d-none">${friendlyUrlUnidade}</span>
1562 <span id="friendlyTipoCurso" class="d-none">${friendlyUrlTipoCurso}</span>
1563 <span id="nomeUnidadeParaBreadCrumb" class="d-none">${nomeUnidadeParaBreadCrumb}</span>
1564
1565 <#if friendlyUrlTipoCurso?contains("livre")>
1566 <span id="tipoCursoText" class="d-none">Livre</span>
1567 <#else>
1568 <span id="tipoCursoText" class="d-none">Técnico</span>
1569 </#if>
1570 <#if friendlyUrlTemaFirst?contains("#erro#")>
1571 <span id="friendlyTemaNv1" class="d-none"></span>
1572 <#else>
1573 <span id="friendlyTemaNv1" class="d-none">${friendlyUrlTemaFirst}</span>
1574 </#if>
1575 <#if friendlyUrlTemaSecond?contains("#erro#")>
1576 <span id="friendlyTemaNv2" class="d-none"></span>
1577 <#else>
1578 <span id="friendlyTemaNv2" class="d-none">${friendlyUrlTemaSecond}</span>
1579 </#if>
1580 <#if friendlyUrlTemaThird?contains("#erro#")>
1581 <span id="friendlyTemaNv3" class="d-none"></span>
1582 <#else>
1583 <span id="friendlyTemaNv3" class="d-none">${friendlyUrlTemaThird}</span>
1584 </#if>
1585
1586 </div>
1587
1588 </div>
1589
1590 <div class="ssp-header-unidade__endereco-container">
1591
1592 <div class="d-flex flex-wrap">
1593
1594 <div>
1595
1596 <#if endereco2?length != 0>
1597 <span class="ssp-header-title-bloco">Bloco I</span><br>
1598 </#if>
1599
1600 <address class="ssp-header-unidade__endereco">
1601 ${endereco}, ${numero}<br>
1602 ${bairro}, ${cidade} - ${UF}, ${cep}
1603 </address>
1604
1605 <span class="ssp-header-unidade__estacionamento">
1606
1607 <i class="fas fa-car"></i>
1608
1609 <#if estacionamento?contains("true")>
1610 <strong>Possui estacionamento?</strong> Sim
1611 <#else>
1612 <strong>Possui estacionamento?</strong> Não
1613 </#if>
1614
1615 </span>
1616 </div>
1617
1618 <#if endereco2?length != 0>
1619
1620 <div class="pt-5">
1621 <span class="ssp-header-title-bloco">Bloco II</span><br>
1622 <address class="ssp-header-unidade__endereco">
1623 ${endereco2}, ${numero2}<br>
1624 ${bairro2}, ${cidade2}, ${cep2}
1625 </address>
1626 <span class="ssp-header-unidade__estacionamento">
1627 <i class="fas fa-car"></i>
1628
1629 <#if estacionamento2?contains("true")>
1630 <strong>Possui estacionamento?</strong> Sim
1631 <#else>
1632 <strong>Possui estacionamento?</strong> Não
1633 </#if>
1634
1635 </span>
1636 </div>
1637
1638 </#if>
1639
1640 <#if hasEstacaoProxima>
1641
1642 <span class="ssp-header-unidade__estacionamento">
1643 <i class="fa-solid fa-train-subway" aria-hidden="true"></i>
1644 <strong>Estação mais próxima:</strong>
1645 ${estacaoProxima}
1646 </span>
1647
1648 </#if>
1649
1650 </div>
1651
1652 <div class="ssp-header-unidade__content-info-maps">
1653
1654
1655 <a class="btn btn-nivel border-white ssp-header-unidade__btn" href="${googlemaps}" target="_blank">
1656 <i class="fas fa-map-marker-alt mr-2 ssp-header-unidade__btn-icon"></i>Google Maps
1657 </a>
1658
1659 <a class="btn btn-nivel border-white ml-2 d-sm-inline-block d-md-none d-lg-none d-xl-none ssp-header-unidade__btn" href="${waze}" target="_blank">
1660 <i class="fab fa-waze mr-2 ssp-header-unidade__btn-icon"></i>Waze
1661 </a>
1662
1663 </div>
1664
1665 </div>
1666
1667 </div>
1668
1669 <div class="ssp-header-unidade__content-info-body">
1670
1671 <div class="ssp-header-unidade__atendimento-container">
1672 <p><strong>Atendimento:</strong></p>
1673 <p>${horario}</p>
1674 </div>
1675
1676 </div>
1677
1678
1679 </div>
1680
1681 </div>
1682
1683 </div>
1684
1685 </div>
1686
1687
1688<script>
1689
1690 if ( $.trim($('.ssp-header-unidade__title').html()) === 'Santo Amaro'){
1691
1692 $('.ssp-header-unidade__subtitle').html('Centro Universitário Senac')
1693
1694 } else if ( $.trim($('.ssp-header-unidade__title').html()) === 'Campos do Jordão'){
1695
1696 $('.ssp-header-unidade__subtitle').html('Centro Universitário Senac')
1697
1698 } else if ( $.trim($('.ssp-header-unidade__title').html()) === 'Águas de São Pedro'){
1699
1700 $('.ssp-header-unidade__subtitle').html('Centro Universitário Senac')
1701
1702 }
1703
1704//Animação de Crédito da imagem
1705
1706$(document).ready(function(){
1707 init()
1708
1709 let larguraTela = $(window).width();
1710
1711 if(larguraTela < 1024){
1712
1713 animateCreditImage()
1714
1715 $(window).scroll(function() {
1716 ScrollPagina()
1717 });
1718
1719 }else{
1720
1721 $(".ssp-header-unidade__imagem-box-imagem" ).mouseover(function() {
1722 $(".creditoFotoMob").removeClass('d-none')
1723
1724 });
1725
1726 $(".ssp-header-unidade__imagem-box-imagem" ).mouseout(function() {
1727 $(".creditoFotoMob").addClass('d-none')
1728
1729 });
1730
1731 }
1732
1733 //verifica posição do Top
1734
1735 function ScrollPagina(){
1736
1737 let scrollPage = $(window).scrollTop();
1738
1739 if(scrollPage == 0){
1740
1741 animateCreditImage()
1742
1743 }
1744 }
1745
1746 function animateCreditImage(){
1747
1748 $( ".creditoFotoMob" ).removeClass('d-none').fadeIn( 200 ).delay( 2500 ).fadeOut( 5000 );
1749
1750 }
1751
1752 //anima Slider fotos unidades de
1753
1754 let time = 5000,
1755 currentImageIndex = 0,
1756 images = document
1757 .querySelectorAll("#slider .ssp-header-unidade__imagem-box-imagem")
1758 max = images.length;
1759
1760 function nextImage() {
1761
1762 images[currentImageIndex]
1763 .classList.remove("selected")
1764
1765 currentImageIndex++
1766
1767 if(currentImageIndex >= max)
1768 currentImageIndex = 0
1769
1770 images[currentImageIndex]
1771 .classList.add("selected")
1772 }
1773
1774 function start() {
1775
1776 let enderecos = document.querySelectorAll('address');
1777
1778 if(enderecos.length >= 2){
1779
1780 setInterval(() => {
1781 // troca de image
1782 nextImage()
1783 }, time)
1784 }
1785
1786 }
1787
1788 window.addEventListener("load", start)
1789
1790 //Associa eventos
1791 $(document).on("click", ".ver-todos-cursos-link", verTodosCursos);
1792 $(document).on("click", ".card-ver-todos-cursos-link", verTodosCursos);
1793});
1794
1795</script>
1796
1797
1798
1799</section>
1800
1801<!-- Fim Header Unidade -->
1802
1803
1804
1805<#-- Conteúdo dinâmico que carrega os temas, subtemas e cursos -->
1806
1807<section>
1808
1809 <div>
1810
1811 <h2 class="ssp-section-tema__title" data-section="title">
1812 Qual a sua área de interesse?
1813 </h2>
1814
1815 <div class="ssp-divider"></div>
1816
1817 <div class="container">
1818
1819 <div id="temas" class="ssp-section-tema__container-menu">
1820
1821 <div class="ssp-section-tema__container-menu-item">
1822 <a href="#a" class="tema todos" data-nvl="0">
1823 <i class="fa-solid fa-dice-d6"></i>
1824 Todos
1825 </a>
1826 </div>
1827
1828 </div>
1829
1830 <!-- Botão Visualizar Mais -->
1831
1832 <div class="ssp-btn__visualizar-mais-content d-md-none d-lg-none d-xl-none">
1833
1834 <p id="visualizar-mais" class="ssp-btn__visualizar-mais">Visualizar mais</p>
1835
1836 <i class="fas fa-chevron-down mx-2 visualizar-mais-seta" style="font-size: 14px;"></i>
1837
1838 </div>
1839
1840 <!-- filtros ativos para Mobile -->
1841
1842 <div id="filtro-ativo" class="tema-slick-area-mobile py-2">
1843
1844 <!-- filtro nivel 1 -->
1845 <div id="filtro-ativo-nivel-1" class="ssp-section-tema__container-menu-item mega-menu">
1846
1847 </div>
1848
1849 <div id="filtro-ativo-nivel-2" class="container ssp-section-tema__container-submenu-nivel3">
1850
1851 </div>
1852
1853 </div>
1854
1855 </div>
1856
1857 </div>
1858
1859</section>
1860
1861<section id="tema-nivel2-container">
1862
1863 <div id="tema-atual">
1864 <h2 class="ssp-section-tema__title"></h2>
1865 <div class="ssp-divider"></div>
1866 </div>
1867
1868 <#--
1869 <div id="subtemas-lista-mobile"
1870 class="container d-none ssp-section-tema__container-submenu-nivel3"></div> -->
1871
1872 <div id="filtro-temas-nivel-2" class="container ssp-section-tema__container-submenu-nivel3 d-none"></div>
1873
1874 <div id="filtro-temas-nivel-3" class="container ssp-section-tema__container-submenu-nivel3 d-none"></div>
1875
1876</section>
1877
1878<section id="cursos-por-categoria-container"
1879 style="padding-bottom:30px">
1880
1881 <section class="py-5">
1882
1883 <div class="container">
1884 <!-- <hr class="filtroInscBolsa"> -->
1885 <div class="ssp-slider-check__container" style="padding: 20px 0px;" id="container-filtros">
1886 <div class="ssp-slider-check__content-itens">
1887
1888 <div class="ssp-slider-check__content-item">
1889
1890 <label id="inscricao-aberta" class="switch">
1891 <input id="chkInscricao" type="checkbox">
1892 <span class="slider round"></span>
1893 </label>
1894
1895 <span class="ssp-slider-check__label">Comprar agora</span>
1896
1897 </div>
1898
1899 <div class="ssp-slider-check__content-item">
1900
1901 <label id="bolsas-estudo" class="switch">
1902 <input id="chkBolsa" type="checkbox">
1903 <span class="slider azul round"></span>
1904 </label>
1905
1906 <span class="ssp-slider-check__label">Bolsas de estudo</span>
1907
1908 </div>
1909
1910 </div>
1911
1912 </div>
1913
1914 <!-- <hr class="filtroInscBolsa"> -->
1915 </div>
1916
1917 </section>
1918
1919 <div style="padding-bottom: 30px;">
1920
1921 <section id="cursos-por-subtema-container" class="container d-none">
1922
1923 <!--h2 id="subtema-atual" class="ssp-section-tema__title-subtema"></h2-->
1924
1925 <div id="subsubtemas-lista" class="ssp-section-tema__container-submenu-nivel3"></div>
1926
1927 <div id="curso-sem-slick" class="ssp-container__cursos-sem-slick"></div>
1928
1929
1930 </section>
1931
1932 </div>
1933
1934 <div id="filtroSemCurso" class="ssp-bolsa-formulario__card-aviso-atencao d-none container text-left" style="width: 100%;">
1935
1936 <i class="fas fa-exclamation-circle ssp-bolsa-formulario__card-aviso-atencao-icon" aria-hidden="true"></i>
1937
1938 <div class="ssp-bolsa-formulario__card-aviso-texto""><p>Sem cursos para o filtro selecionado</p>
1939 </div>
1940
1941 </div>
1942
1943
1944</section>
1945
1946
1947<#-- Template para card de cursos por categoria -->
1948<section id="cursos-por-categoria-template"
1949 class="cursos-por-categoria ssp-section container d-none">
1950
1951
1952 <div class="ssp-page-busca__section-resultado-container"
1953 id="container-slider-cursos-livres">
1954
1955 <a href="#a" data-nvl="" data-tema=""
1956 class="ver-todos-cursos-link d-none-mobile">
1957 <p
1958 class="ssp-page-busca__section-resultado__title-outros tema-nome ssp-section-tema__subtitle-curso-section"></p></a>
1959
1960 </div>
1961
1962 <div class="slider-curso" style="display: flex;"></div>
1963
1964</section>
1965
1966<#-- Section para o item de curso-->
1967<div id="curso-item-template" class="d-none slick-area__item">
1968
1969 <div class="ssp-card-curso custom-card-curso-tema">
1970
1971 <a class="ssp-absolute-link ck-curso" href="#a"></a>
1972
1973 <div class="ssp-card-curso__image custom-card-curso-tema__image">
1974
1975 <div class="ssp-image-container">
1976 <img src="" />
1977
1978 </div>
1979
1980 </div>
1981
1982 <div class="ssp-card-curso__body custom-card-curso-tema__body">
1983 <!-- Tag de Tipo de Curso -->
1984 <#if tipoCurso == "Livre" >
1985 <div class="ssp-card-curso__color-tag-modalidade bg-nivel-livre custom-card-curso-tema__color-tag-modalidade"></div>
1986 <#else>
1987 <div class="ssp-card-curso__color-tag-modalidade bg-nivel-tecnico custom-card-curso-tema__color-tag-modalidade"></div>
1988
1989 </#if>
1990
1991
1992 <div class="ssp-card-curso__tags custom-card-curso-tema__tags">
1993
1994 <span class="ssp-card-curso__tag-formato-title">${tipoCurso}</span>
1995
1996 <span class="tag-modalidade-title__senac-online d-none">Senac Online - ao vivo</span>
1997
1998 </div>
1999
2000 <h6 class="ssp-card-curso__title custom-card-curso-tema__title">
2001
2002 </h6>
2003
2004 <div class="ssp-card-curso__info custom-card-curso-tema__info">
2005
2006 <span
2007 class="ssp-tag bg-white border-nivel-extensao text-nivel-extensao mr-1 btn-inscricoes-abertas">Inscrições
2008 abertas</span> <span
2009 class="ssp-tag bg-white border-primary text-primary btn-bolsas">Bolsas</span>
2010
2011 </div>
2012
2013 </div>
2014
2015 </div>
2016
2017</div>
2018
2019<#-- Estrutura com botões de tipos de curso - os únicos que precisam ser dinâmicos são Livre e Técnico -->
2020
2021<section class="ssp-section ssp-section-lg-top">
2022
2023
2024 <div class="container text-left">
2025
2026 <h2 class="ssp-section-title">
2027 <lfr-editable id="title" type="rich-text">
2028 Cursos oferecidos
2029 </lfr-editable>
2030 </h2>
2031
2032 <div class="ssp-btns-horizontal-area">
2033
2034 <#function getCategorias primaryKey>
2035
2036 <#assign categoryService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") />
2037 <#attempt>
2038
2039 <#return categoryService.getCategories("com.liferay.journal.model.JournalArticle", primaryKey)>
2040
2041 <#recover>
2042
2043 <#return '#erro#'>
2044 </#attempt>
2045 </#function>
2046
2047 <#assign
2048
2049
2050 categoriesList = getCategorias(journal.getResourcePrimKey())
2051 normalizer = serviceLocator.findService("com.liferay.portal.kernel.util.FriendlyURLNormalizer")
2052 vocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")
2053 vocabularies = vocabularyLocalService.getAssetVocabularies(-1,-1)
2054
2055 />
2056
2057
2058 <#list vocabularies as vocabulary >
2059 <#if vocabulary.getName() == 'Unidades'>
2060
2061 <#assign
2062 xPathSelector_nomeUsualUnidade = saxReaderUtil.createXPath("dynamic-element[@name='nomeUsualUnidade']")
2063 nomeUsual = xPathSelector_nomeUsualUnidade.selectSingleNode(rootElement).getStringValue()
2064 categories = vocabulary.getCategories()
2065 >
2066 <#list categories as category>
2067 <#if category.getName()?trim == nomeUsual?trim>
2068
2069 <#assign categoryId = category.getCategoryId() >
2070 </#if>
2071 </#list>
2072 </#if>
2073 </#list>
2074
2075 <#list categoriesList![] as category>
2076
2077 <#assign vocabularyName = vocabularyLocalService.getVocabulary(category.getVocabularyId()).getTitle("pt-br")?trim />
2078
2079 <#if normalizer.normalize(vocabularyName) == "tipo-de-curso">
2080 <#assign normalizedCategoryName = normalizer.normalize(category.getName()) />
2081
2082
2083
2084 <#if normalizedCategoryName == "livre">
2085 <a href="/${friendlyUrlUnidade}/cursos-livres" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">
2086 ${category.getName()}
2087 </a>
2088
2089 <#elseif normalizedCategoryName == "tecnico">
2090 <a href="/${friendlyUrlUnidade}/cursos-tecnicos" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">
2091 ${category.getName()}
2092 </a>
2093
2094 <#elseif normalizedCategoryName == "extensao">
2095 <a href="/${friendlyUrlUnidade}/extensao-universitaria" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">
2096 ${category.getName()}
2097 </a>
2098
2099 <#elseif normalizedCategoryName == "extensao-ead">
2100 <a href="https://www.ead.senac.br/extensao-universitaria" target="_blank" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">
2101 ${category.getName()}
2102 </a>
2103
2104 <#elseif normalizedCategoryName == "graduacao-ead">
2105 <a href="https://www.ead.senac.br/graduacao" target="_blank" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">
2106 ${category.getName()}
2107 </a>
2108
2109 <#elseif normalizedCategoryName == "pos-graduacao-ead">
2110 <a href="https://www.ead.senac.br/pos-graduacao" target="_blank" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">
2111 ${category.getName()}
2112 </a>
2113 <#elseif normalizedCategoryName == "jovem-aprendiz">
2114 <a href="/jovem-aprendiz" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">
2115 ${category.getName()}
2116 </a>
2117
2118 <#else>
2119 <a href="/${friendlyUrlUnidade}/${normalizedCategoryName}" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">
2120 ${category.getName()}
2121 </a>
2122 </#if>
2123
2124
2125 </#if>
2126
2127 </#list>
2128
2129 <#-- Verifica se a unidade oferta curso de Idiomas-->
2130
2131 <#list categoriesList![] as category>
2132
2133 <#assign vocabularyName = vocabularyLocalService.getVocabulary(category.getVocabularyId()).getTitle("pt-br")?trim />
2134
2135 <#if normalizer.normalize(vocabularyName) == "tema-mercadologico-">
2136
2137 <#assign normalizedCategoryName = normalizer.normalize(category.getName()) />
2138
2139 <#if category.getName() == "Idiomas">
2140 <a href="/${friendlyUrlUnidade}/cursos-livres/${normalizedCategoryName}" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">${category.getName()}</a>
2141 <#else>
2142 </#if>
2143
2144 </#if>
2145
2146 </#list>
2147
2148 <#list categoriesList![] as category>
2149
2150 <#assign vocabularyName = vocabularyLocalService.getVocabulary(category.getVocabularyId()).getTitle("pt-br")?trim />
2151
2152 <#if normalizer.normalize(vocabularyName) == "modalidade">
2153
2154 <#assign normalizedCategoryName = normalizer.normalize(category.getName()) />
2155
2156 <#if normalizedCategoryName == "espec.-tecnica-de-nivel-medio">
2157 <a href="/${friendlyUrlUnidade}/especializacao-tecnica" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-especializacao-tecnica" style="order: 1">Especialização Técnica</a>
2158 </#if>
2159
2160 </#if>
2161
2162 </#list>
2163
2164 </div>
2165
2166 </div>
2167
2168
2169</section>
2170
2171 <script>
2172const isMobile = $(window).width() <= 1024
2173
2174var temas = [];
2175var subtemasStorage = new Map();
2176var activeCategory = 'all';
2177var activeCategoryLevel = 0;
2178var limit = 2;
2179var offset = 0;
2180var todosText = '';
2181var limitTodosCursos = 16;
2182var offsetTodosCursos = 0;
2183var groupId = 0;
2184var tipoCursoNome = "Técnico";
2185var tipoCursoNomeBreadCrumb = "Cursos Técnicos";
2186var categoryIdTipoCurso = 0;
2187var cookieName = "ck-cursos-tecnico";
2188var tam = $(window).width();
2189var urlUnidade = "";
2190var urlTipoCurso = "";
2191var urlTemasStorage = new Map();
2192var urlTemaNv1 = "";
2193var urlTemaNv2 = "";
2194var urlTemaNv3 = "";
2195var acessoDireto = 0;
2196var categoryIdTemaNv1 = "";
2197var categoryIdTemaNv2 = "";
2198var categoryIdTemaNv3 = "";
2199const HOST = window.location.origin;
2200var filtrarInscricoesAbertas = 0;
2201var filtrarBolsaEstudo = 0;
2202var activeModeloExibicao = 1;
2203var limitCursos = isMobile ? 4 : 11;
2204var cliqueFiltroMobile = 0;
2205var idModalidadeEspecTecnica = 0;
2206
2207const codModalidadeEspecTecnica = 10;
2208var urlSearchModalidadeEspecTecnica = '/o/senac-category-services/categoryByVocabularyNameAndProperty/{groupId}/Modalidade/codModalidade/' + codModalidadeEspecTecnica;
2209var urlSearchCursos = '/o/senac-unidade-services/cursosPorCategoriaETemaEUnidade/{groupId}/{categoryTemaId}/{categoriaId}/{unidadeCategoryId}/{filtrarInscricoesAbertas}/{filtrarBolsaEstudo}/{start}/{end}';
2210var urlCursosPorTipoCursoETemaComFiltrosBolsaECompra = "/o/senac-content-services/cursosPorCategoriasComFiltrosBolsaECompra/{groupId}/{filtrarInscricoesAbertas}/{filtrarBolsaEstudo}/{considerarUnidade}/{start}/{end}?categoryIds={categoryTemaId}&categoryIds={categoriaId}&categoryIds={unidadeCategoryId}"
2211var urlSearchTemas = '/o/senac-unidade-services/temasPorCategoriaEUnidade/{groupId}/{unidadeCategoryId}/{categoriaId}/{nivelTema}/{categoriaParentId}';
2212
2213var urlSearchTipoCurso = '/o/senac-content-services/idTipoCursoPorNome/{groupId}/{tipoCursoNome}';
2214let categorias = []
2215let categoryWithoutCourse = []
2216var urlSearchTipoCursoTecnico = '/o/senac-category-services/categoryByVocabularyNameAndProperty/{groupId}/Tipo%20de%20curso/sigla/T';
2217let friendlyUrlUnidade = ''
2218
2219
2220function montaBreadCrumb(){
2221 var breadCrumb = $(".breadcrumb");
2222 var nomeUnidade = $("#nomeUnidadeParaBreadCrumb").text().trim();
2223
2224 breadCrumb.empty();
2225
2226 //Home
2227 breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/" title="Home"><span class="breadcrumb-text-truncate">Home</span></a></li>');
2228
2229 //Unidades
2230 breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/unidades" title="Unidades"><span class="breadcrumb-text-truncate">Unidades</span></a></li>');
2231
2232 //Unidade
2233 breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/'+getFriendlyUrlUnidade()+'" title="'+nomeUnidade+'"><span class="breadcrumb-text-truncate">'+nomeUnidade+'</span></a></li>');
2234
2235 //Tipo de Curso
2236 breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/'+getFriendlyUrlUnidade()+'/'+getUrlTipoCurso()+'" title="'+tipoCursoNomeBreadCrumb+'"><span class="breadcrumb-text-truncate">'+tipoCursoNomeBreadCrumb+'</span></a></li>');
2237
2238}
2239
2240function carregaLinkBotoesLivreETecnico(){
2241
2242 urlUnidade = $("#friendlyUnidade").text().trim();
2243 urlTipoCurso = $("#friendlyTipoCurso").text().trim();
2244
2245 $.ajax({
2246
2247 url : '/o/senac-content-services/url-tipos-de-curso/'+groupId,
2248 type : 'get',
2249 dataType: 'json',
2250
2251 }).done(function(res) {
2252 $(res).each(function(key , value){
2253
2254 if(value.name == 'tecnico'){
2255 //botao livre
2256 $("#linkTecnico").attr('href', "/"+urlUnidade+"/"+value.friendlyURL);
2257
2258 }else
2259 if(value.name == 'livre'){
2260
2261 $("#linkLivre").attr('href', "/"+urlUnidade+"/"+ value.friendlyURL);
2262
2263 }
2264
2265
2266 });
2267
2268 });
2269
2270
2271
2272}
2273
2274
2275
2276
2277// Botao para filtro de cursos com inscricoes abertas e bolsas
2278$('#inscricao-aberta input, #bolsas-estudo input').click(function(){
2279
2280 //Atualiza as variaveis globais dos dois filtros
2281 $("#inscricao-aberta input").is(":checked") == true ? filtrarInscricoesAbertas = 1 : filtrarInscricoesAbertas = 0;
2282 $("#bolsas-estudo input").is(":checked") == true ? filtrarBolsaEstudo = 1 : filtrarBolsaEstudo = 0;
2283
2284 //Refaz a busca com os filtros atualizados
2285 switch(getCurrentLevel()){
2286 case 1:
2287 case 2:
2288 //Verifica se esta exibindo todos ou algum tema
2289 var botaoTodos = $('.todos');
2290
2291 if(botaoTodos.hasClass('ativo') || botaoTodos.hasClass('tema-ativo'))
2292 $('.todos:first').trigger('click');
2293
2294 //Se estiver ativo um tema, verifica se possui ativo um subtema
2295 else
2296 //Verifica o nivel do tema clicado
2297 $('.subtema-ativo:not(.todos)').length == 0 ? $('.subtema-ativo.todos').trigger('click') : $('.subtema-ativo:first').trigger('click', [$(this)]);
2298 break;
2299
2300 case 3:
2301 if($('#filtro-temas-nivel-3 .subtema-ativo:not(.todos)').length) {
2302 const preSelecteds = []
2303 document.querySelectorAll('#filtro-temas-nivel-3 .subtema-ativo:not(.todos)')
2304 .forEach(el => {
2305 preSelecteds.push(el)
2306 el.classList.remove('subtema-ativo')
2307 })
2308
2309 preSelecteds.forEach(async el => await clickTema(el.getAttribute('data-tema')))
2310 } else {
2311 const el = $('#filtro-temas-nivel-3 .todos')
2312 el.trigger('click')
2313 }
2314 break;
2315 }
2316})
2317
2318//carrega url com tema clicado
2319function atualizaUrlBrowser(urlTema,nivel){
2320 var path = window.location.pathname;
2321 var urlFinal = "";
2322
2323 if(path.indexOf('staging') > 1){
2324 urlFinal = "/web/guest-staging";
2325 }else
2326 if(path.indexOf('guest') > 1){
2327 urlFinal = "/web/guest";
2328 }
2329
2330 urlFinal += "/"+friendlyUrlUnidade+"/"+urlTipoCurso;
2331
2332 //se for todos os cursos a url fica so /unidade/tipo-curso
2333 if(nivel > 0){
2334
2335 switch(nivel){
2336
2337 case 1:
2338 urlTemaNv1 = urlTema;
2339 urlFinal += "/"+urlTemaNv1;
2340 break;
2341
2342 case 2:
2343 urlTemaNv2 = urlTema;
2344 if(tipoCursoNome == "Livre"){
2345 urlFinal += "/"+urlTemaNv1+"/"+urlTemaNv2;
2346 }else{
2347 urlFinal += "/"+urlTemaNv1;
2348 }
2349 break;
2350
2351 case 3:
2352 if(tipoCursoNome == "Livre"){
2353 urlTemaNv3 = urlTema;
2354 urlFinal += "/"+urlTemaNv1+"/"+urlTemaNv2+"/"+urlTemaNv3;
2355 }else{
2356 urlFinal += "/"+urlTemaNv1;
2357 }
2358 break;
2359
2360 }
2361
2362 }
2363
2364
2365 urlFinal = new URL(window.location.origin + urlFinal);
2366 if($("#inscricao-aberta input").is(":checked")){
2367 urlFinal.searchParams.set("inscricao", true);
2368 }
2369 if($("#bolsas-estudo input").is(":checked")){
2370 urlFinal.searchParams.set("bolsa", true);
2371 }
2372 window.history.pushState('', 'Categoria JavaScript', decodeURIComponent(urlFinal.toString()))
2373}
2374
2375function getUrlTipoCurso(){
2376 return $('#friendlyTipoCurso').text().trim();
2377}
2378
2379function buscaFriendlyUrlTemaEAtualizaBrowser(temaId, nivelClicado){
2380
2381 var friendlyUrlTema = urlTemasStorage.get(temaId);
2382
2383 if(typeof friendlyUrlTema === "undefined"){
2384 //se ainda nao tem no map, busco via ajax e armazeno no map a url do tema clicado para nao precisar buscar novamente
2385 $.ajax({
2386 url : '/o/senac-content-services/friendlyUrlPorCategoria/'+temaId,
2387 type : 'get',
2388 dataType: 'json',
2389 async: false
2390 }).done(function(res) {
2391
2392 urlTemasStorage.set(temaId,res.url);
2393 friendlyUrlTema = res.url
2394
2395 })
2396 }
2397
2398 if(nivelClicado == 3){
2399 let params = ''
2400
2401 document.querySelectorAll("#filtro-temas-nivel-3 a.subtema-ativo")
2402 .forEach(a => {
2403 const friendlyUrl = urlTemasStorage.get(parseInt(a.getAttribute('data-tema')))
2404 params = (params ? params + ',' : '') + friendlyUrl
2405 })
2406
2407 atualizaUrlBrowser(params,nivelClicado);
2408 } else {
2409 atualizaUrlBrowser(friendlyUrlTema,nivelClicado);
2410 }
2411
2412}
2413
2414let isAcessoDireto = false
2415//verifica se usuario acessou direto pelas urls dos temas e carrega os temas para dar sequencia
2416async function verificaAcessoDiretoELoadTema(){
2417 isAcessoDireto = true
2418 urlTemaNv1 = $("#friendlyTemaNv1").text().trim();
2419 urlTemaNv2 = $("#friendlyTemaNv2").text().trim();
2420 urlTemaNv3 = $("#friendlyTemaNv3").text().trim();
2421
2422 const urlParamsTemaNv3 = new URLSearchParams(window.location.search);
2423 urlParamTemaNv3 = urlParamsTemaNv3.get('q');
2424
2425 carregaTemas()
2426
2427 let nivel1CategoryId
2428 let nivel2CategoryId
2429 let nivel3CategoryId
2430
2431 if(urlTemaNv1) {
2432 getSubtemas(urlTemaNv1)
2433 .done(categories => {
2434 nivel1CategoryId = categories[0].categoryId
2435 clickTema(nivel1CategoryId)
2436 })
2437 }
2438
2439 if(urlTemaNv2){
2440 getSubtemas(urlTemaNv2, nivel1CategoryId)
2441 .done(categories => {
2442 nivel2CategoryId = categories[0].categoryId
2443 clickTema(nivel2CategoryId)
2444 })
2445 }
2446
2447 if(urlParamTemaNv3) {
2448 const params = urlParamTemaNv3.split(',')
2449
2450 for (let index = 0; index < params.length; index++) {
2451 const url = params[index];
2452
2453 const categories = await getSubtemas(url, nivel2CategoryId)
2454
2455 await clickTema(categories[0].categoryId)
2456 }
2457 }
2458
2459 isAcessoDireto = false
2460}
2461
2462function getFriendlyUrlUnidade() {
2463 return $("#friendlyUnidade").text().trim()
2464}
2465
2466/* Prepara a montagem inicial da página */
2467async function init() {
2468 var tipoCursoText = $('#tipoCursoText').text().trim();
2469
2470 if(tipoCursoText == "Livre"){
2471 tipoCursoNomeBreadCrumb = "Cursos Livres";
2472 tipoCursoNome = "Livre";
2473 cookieName = "ck-cursos-livre";
2474 cardVerTodosTipoCursoClass = "livre"
2475
2476 }else if(tipoCursoText == "Técnico"){
2477 tipoCursoNomeBreadCrumb = "Cursos Técnicos";
2478 tipoCursoNome = "Técnico";
2479 cookieName = "ck-cursos-tecnico";
2480 cardVerTodosTipoCursoClass = "tecnico"
2481
2482 }else if(tipoCursoText == "Extensão"){
2483 tipoCursoNomeBreadCrumb = "Extensão Universitária";
2484 tipoCursoNome = "Extensão";
2485 cookieName = "ck-cursos-extensao";
2486 cardVerTodosTipoCursoClass = "extensao"
2487 }
2488
2489 montaBreadCrumb()
2490
2491 friendlyUrlUnidade = getFriendlyUrlUnidade()
2492
2493 const categories = await getSubtemas(friendlyUrlUnidade)
2494 unidadeCategoryId = categories[0].categoryId
2495
2496 urlTipoCurso = getUrlTipoCurso();
2497
2498 groupId = Liferay.ThemeDisplay.getScopeGroupId();
2499
2500 $('#tema-atual h2').text("");
2501 $('#tema-atual').hide();
2502
2503 todosText = $('#tema-atual h2').text();
2504
2505 //Preenche o id do tipo de curso e a modalidade
2506 var url = urlSearchTipoCurso
2507 .replace('{groupId}', groupId)
2508 .replace('{tipoCursoNome}', tipoCursoNome);
2509
2510 $.ajax({
2511 url : url,
2512 type : 'get',
2513 async: false
2514 }).done(function(categoryIdTipoCursoResponse) {
2515
2516 categoryIdTipoCurso = categoryIdTipoCursoResponse;
2517
2518 });
2519
2520 setCategoryIds()
2521 carregarCategorias()
2522 verificaFiltroInscricaoBolsaEToggle()
2523 verificaAcessoDiretoELoadTema()
2524 visualizarMais()
2525 hideVisualizarMais()
2526
2527 if(isMobile) {
2528 visualizarMenos()
2529 showVisualizarMais()
2530 }
2531}
2532
2533function setCategoryIds(){
2534
2535 //Obter o id da modalidade espec tecnica
2536 var url = urlSearchModalidadeEspecTecnica
2537 .replace('{groupId}', groupId);
2538
2539 $.ajax({
2540 url : url,
2541 type : 'get',
2542 async: false
2543 }).done(function(categoryIdModalidade) {
2544 try{
2545 idModalidadeEspecTecnica = JSON.parse(categoryIdModalidade).categoryId;
2546 }catch(err){
2547 console.error('idModalidadeEspecTecnica nao obtido ' + err.message);
2548 }
2549
2550 //Obter o id do tipo curso tecnico
2551 var url = urlSearchTipoCursoTecnico
2552 .replace('{groupId}', groupId);
2553
2554 $.ajax({
2555 url : url,
2556 type : 'get',
2557 async: false
2558 }).done(function(categoryIdTipoCursoResponse) {
2559 try{
2560 idTipoCursoTecnico = JSON.parse(categoryIdTipoCursoResponse).categoryId;
2561 categoryIdTipoCurso = idTipoCursoTecnico;
2562 }catch(err){
2563 console.error('idTipoCursoTecnico nao obtido ' + err.message);
2564 }
2565 // verificaAcessoDiretoELoadTema();
2566 });
2567
2568 });
2569
2570}
2571
2572function verificaFiltroInscricaoBolsaEToggle() {
2573 const urlParams = new URLSearchParams(window.location.search)
2574 $('#chkInscricao').prop("checked", urlParams.get('inscricao') == 'true')
2575 $('#chkInscricao').prop("checked") ? filtrarInscricoesAbertas = 1 : filtrarInscricoesAbertas = 0
2576 $('#chkInscricao').change(ev => selectFilter('inscricao', $('#chkInscricao')) )
2577
2578 if($('#chkBolsa').length) {
2579 $('#chkBolsa').prop("checked", urlParams.get('bolsa') == 'true')
2580 $('#chkBolsa').prop("checked") ? filtrarBolsaEstudo = 1 : filtrarBolsaEstudo = 0
2581 $('#chkBolsa').change(ev => selectFilter('bolsa', $('#chkBolsa')) )
2582 }
2583}
2584
2585function carregarCategorias() {
2586 if(!categorias.length) {
2587 const searchParams = new URLSearchParams({
2588 companyId: themeDisplay.getCompanyId(),
2589 groupIds: themeDisplay.getScopeGroupId(),
2590 parentCategoryIds: 0,
2591 vocabularyIds: document.querySelector('#ssp-vocabulary-id-tema-mercadologico').value
2592 })
2593
2594 $.ajax({
2595 url : '/o/senac-category-services/categories?' + searchParams.toString(),
2596 method : 'get',
2597 async: false
2598 })
2599 .done(data => categorias = data)
2600 .fail(err => console.error(err))
2601 }
2602}
2603
2604function selectFilter(paramkey, el) {
2605 setUrlParam(paramkey, el.prop("checked"))
2606}
2607
2608function setUrlParam(key, value) {
2609 const url = new URL(window.location.href)
2610 if(value)
2611 url.searchParams.set(key, value);
2612 else
2613 url.searchParams.set(key, false)
2614 window.history.pushState({}, '', decodeURIComponent(url.toString()))
2615}
2616
2617$(document).on("click", '.ssp-btn__visualizar-mais-content', toggleVisualizarMais)
2618
2619function visualizarMenos() {
2620 const itensTema = $('#temas').children();
2621 const itensExibidos = 6;
2622
2623 if(isMobile)
2624 itensTema.slice(itensExibidos).hide();
2625
2626 $('#visualizar-mais').text('Visualizar mais');
2627 $('#visualizar-mais').parent().find('i').removeClass('fa-chevron-up');
2628 $('#visualizar-mais').parent().find('i').addClass('fa-chevron-down');
2629}
2630
2631function visualizarMais() {
2632 const itensTema = $('#temas').children();
2633 const itensExibidos = 6;
2634
2635 if(isMobile)
2636 itensTema.slice(itensExibidos).show();
2637
2638 $('#visualizar-mais').text('Visualizar menos');
2639 $('#visualizar-mais').parent().find('i').removeClass('fa-chevron-down');
2640 $('#visualizar-mais').parent().find('i').addClass('fa-chevron-up');
2641}
2642
2643function toggleVisualizarMais(){
2644 if( $('#visualizar-mais').text() === "Visualizar mais" )
2645 visualizarMais()
2646 else
2647 visualizarMenos()
2648}
2649
2650function showVisualizarMais() {
2651 const itensTema = $('#temas').children();
2652 const itensExibidos = 6;
2653
2654 if($('#temas').children().length <= itensExibidos)
2655 hideVisualizarMais()
2656 else
2657 $('.ssp-btn__visualizar-mais-content').show()
2658}
2659
2660function hideVisualizarMais() {
2661 $('.ssp-btn__visualizar-mais-content').hide()
2662}
2663
2664/* Carrega os subtemas ou cursos ao clicar no tema */
2665let lastClicked
2666$(".container").on(
2667 "click",
2668 ".tema",
2669 function() {
2670 const categoriaId = $(this).data('tema');
2671 const isEqualTema = lastClicked == categoriaId
2672 lastClicked = categoriaId
2673
2674 const isTodos = this.classList.contains('todos')
2675
2676 activeCategoryLevel = $(this).data('nvl');
2677 limit = 2;
2678 offset = 0;
2679 limitTodosCursos = 16;
2680 offsetTodosCursos = 0;
2681
2682 $('#filtro-temas-nivel-2').empty()
2683 $('#filtro-temas-nivel-3').empty()
2684
2685 hideVisualizarMais()
2686 $('.tema').removeClass('ativo');
2687 $('.tema').removeClass('tema-ativo')
2688 $('.ssp-section-tema__container-menu-item').show()
2689
2690 document.querySelector('.ssp-divider').classList.add('d-none')
2691
2692 document.querySelector('[data-section="title"]').classList.remove('selected')
2693
2694 if(isTodos){
2695 document.querySelector('[data-section="title"]').innerHTML = 'Qual a sua área de interesse?'
2696 document.querySelector('.ssp-divider').classList.remove('d-none')
2697
2698 showVisualizarMais()
2699 atualizaUrlBrowser(0,0);
2700 $('.todos').addClass('ativo');
2701
2702 if(isMobile) {
2703 visualizarMenos()
2704 showVisualizarMais()
2705 }
2706 } else {
2707 document.querySelector('[data-section="title"]').innerHTML = 'Você selecionou:'
2708 $('.ssp-section-tema__container-menu-item').hide()
2709 $('.ssp-section-tema__container-menu-item').has(this).show()
2710
2711 if(isEqualTema) {
2712 removeFiltersLevel1()
2713 return
2714 } else
2715 $(this).addClass('tema-ativo')
2716
2717 $.ajax(
2718 {
2719 url : '/o/senac-content-services/category/'
2720 + $(this).data('tema'),
2721 type : 'get'
2722 }).done(function(category) {
2723
2724 activeCategory = JSON.parse(category);
2725
2726 cleanElements();
2727
2728 displayCursosPorTema();
2729
2730 displaySubTemasLista();
2731
2732 buscaFriendlyUrlTemaEAtualizaBrowser(categoriaId,1);
2733 });
2734
2735 if(!this.classList.contains('todos')) {
2736 hideOthersLevel1(this)
2737 }
2738 }
2739 }
2740);
2741
2742/* Quando clica em Ver Todos cursos de um tema */
2743function verTodosCursos(){
2744
2745 //Scrool top
2746 $('html, body').animate({
2747 scrollTop: $("#temas").offset().top
2748 }, -1000);
2749
2750
2751 var tema = $(this).data('tema');
2752 activeCategoryLevel = $(this).data('nvl');
2753
2754 if(activeCategoryLevel == 1)
2755 buscaFriendlyUrlTemaEAtualizaBrowser(tema,activeCategoryLevel);
2756
2757 // Verifica o elemento, adiciona a classe ativo e remove dos seus primos
2758 $('.todos').removeClass('ativo');
2759
2760 limit = 2;
2761 offset = 0;
2762
2763 $.ajax({
2764 url : '/o/senac-content-services/category/'+ tema,
2765 type : 'get'
2766 }).done(function(category) {
2767
2768 activeCategory = JSON.parse(category);
2769
2770 switch(activeCategoryLevel){
2771 case 1:
2772 $('.tema').removeClass('tema-ativo');
2773 $('.tema[data-tema="'+activeCategory.categoryId+'"]').not('.slick-cloned').each(function(){
2774 if(!$(this).parent().hasClass('slick-cloned')){
2775 var botaoTemaVerTodos = $(this);
2776 botaoTemaVerTodos.trigger('click');
2777 }
2778 });
2779
2780 break;
2781 case 2:
2782
2783 var botaoTemaVerTodosNv2 = $('.subtema[data-tema="'+activeCategory.categoryId+'"]');
2784 botaoTemaVerTodosNv2.trigger('click');
2785
2786 break;
2787 case 3:
2788 var botaoTemaVerTodosNv3 = $('.subtema[data-tema="'+activeCategory.categoryId+'"]');
2789 botaoTemaVerTodosNv3.trigger('click');
2790
2791 break;
2792 }
2793
2794
2795 });
2796}
2797
2798function defaultSubtema(el, temaIds) {
2799 limit = 2;
2800 offset = 0;
2801 limitTodosCursos = 16;
2802 offsetTodosCursos = 0;
2803
2804 $('#cursos-por-subtema-container').find('#curso-sem-slick').empty();
2805
2806 activeCategoryLevel = $(el).data('nvl');
2807
2808 if(!acessoDireto)
2809 buscaFriendlyUrlTemaEAtualizaBrowser($(el).data('tema'),activeCategoryLevel);
2810
2811 cleanElements();
2812
2813 const categories = []
2814 temaIds.forEach(id => {
2815 $.ajax({
2816 url : '/o/senac-content-services/category/' + id,
2817 type : 'get',
2818 async: false
2819 })
2820 .done((category) => {
2821 activeCategory = JSON.parse(category)
2822 categories.push(activeCategory)
2823 })
2824 });
2825
2826 displayCursosPorTema(categories)
2827}
2828
2829// evento de click nos subtemas
2830$("#filtro-temas-nivel-2")
2831.on("click", ".subtema", function(ev, trigger) {
2832
2833 $(this).siblings('.todos').removeClass("subtema-ativo")
2834
2835 if(this.classList.contains('todos') || (this.classList.contains('subtema-ativo') && !trigger)) {
2836 removeFiltersLevel2()
2837 return
2838 } else {
2839 hideOthersLevel2(this)
2840 this.classList.add('subtema-ativo')
2841 }
2842
2843 defaultSubtema(this, [$(this).data('tema')])
2844})
2845
2846$("#filtro-temas-nivel-3")
2847.on("click", ".subtema", function(ev) {
2848
2849 $(this).siblings('.todos').removeClass("subtema-ativo")
2850
2851 if(this.classList.contains('todos')) {
2852 removeFiltersLevel3()
2853 return
2854 }
2855
2856 const isActived = this.classList.contains('subtema-ativo')
2857 if(isActived)
2858 this.classList.remove('subtema-ativo')
2859 else
2860 this.classList.add('subtema-ativo')
2861
2862
2863 const anyActive = !!document.querySelector("#filtro-temas-nivel-3 a.subtema-ativo")
2864 if(!anyActive)
2865 removeFiltersLevel3()
2866
2867 const temaIds = []
2868 document.querySelectorAll("#filtro-temas-nivel-3 a.subtema-ativo:not(.todos)")
2869 .forEach(a => temaIds.push(a.getAttribute('data-tema')))
2870
2871 defaultSubtema(this, temaIds)
2872})
2873
2874/* Click no botao todos */
2875$(".container").on("click", ".todos:not(.subtema.todos)", function() {
2876
2877 atualizaUrlBrowser(0);
2878
2879 activeCategory = 'all';
2880 activeCategoryLevel = $(this).data('nvl');
2881 offset = 0;
2882
2883 /* Limpa dados de subtemas que possam ter sido criados na navegação */
2884 cleanElements();
2885
2886 $('#tema-atual').show()
2887 $('#tema-atual h2').text(todosText);
2888
2889 // Esconde a div com subtemas
2890 $('#filtro-temas-nivel-2').empty();
2891 $('#filtro-temas-nivel-2').addClass('d-none');
2892
2893 displayCursosPorTema();
2894
2895});
2896
2897/* Limpa a tela para exibição de novos cursos */
2898function cleanElements() {
2899
2900 $('#subtemas-lista').empty();
2901
2902 $('#cursos-por-categoria-container .cursos-por-categoria').remove();
2903 $('#subtema-atual').empty();
2904 $('#cursos-por-subtema-container #subsubtemas-lista').empty();
2905 $('#cursos-por-subtema-container .ssp-card-curso').remove();
2906
2907 $('#cursos-por-categoria-container').removeClass('d-none');
2908 $('#cursos-por-subtema-container').addClass('d-none');
2909}
2910
2911/*
2912 * Armazena a navegação em cookies, se habilitado
2913 */
2914$(document).on("click", ".ck-curso", function() {
2915
2916 //Verifica se os alternadores estao selecionados e manipula o link do curso de acordo a eles.
2917 urlFinal = new URL(window.location.origin + $(this).attr('href'));
2918 let filtroInscricaoBolsa = false;
2919
2920 if($("#inscricao-aberta input").is(":checked")){
2921 urlFinal.searchParams.set("inscricao", true);
2922 filtroInscricaoBolsa = true;
2923 }
2924 if($("#bolsas-estudo input").is(":checked")){
2925 urlFinal.searchParams.set("bolsa", true);
2926 filtroInscricaoBolsa = true;
2927 }
2928 $(this).attr('href', urlFinal.pathname + (filtroInscricaoBolsa ? "?"+urlFinal.searchParams : ""))
2929
2930
2931 //Verifica se o cookie está habilitado
2932 if(getCookie('portalSenacCookie') != null){
2933
2934 var articleId = $(this).data('ck');
2935 manageCookieArray(cookieName, articleId);
2936 manageCookieArray('ck-cursos', articleId);
2937 }
2938
2939});
2940
2941/*
2942 * Exibe os cursos por tema, dependendo do nivel
2943 */
2944function displayCursosPorTema(categories) {
2945 hideMensagemSemCurso();
2946
2947 // Verifica o nivel
2948 switch (activeCategoryLevel) {
2949
2950 case 0: // exibe todos
2951 $('#tema-atual').hide()
2952 limit = 2;
2953
2954 $.each(temas.slice(offset, limit + offset), function(k, t) {
2955
2956 if($('#cursos-por-categoria-'+t.categoryId).length == 0){
2957 var template = $('#cursos-por-categoria-template').clone();
2958 template.prop('id', 'cursos-por-categoria-'+t.categoryId);
2959 template.removeClass('d-none');
2960 $('#cursos-por-categoria-container').append(template);
2961 }
2962
2963 $.ajax(
2964 {
2965 url : '/o/senac-content-services/category/'
2966 + t.categoryId,
2967 type : 'get',
2968 async: false
2969 }).done(function(category) {
2970
2971 var dadosCategoria = JSON.parse(category);
2972
2973 //monta as divs para cada tcategoria
2974 var templatePorCategoria = $('#cursos-por-categoria-'+dadosCategoria.categoryId);
2975 templatePorCategoria.find('.tema-nome').text(dadosCategoria.name);
2976 templatePorCategoria.find('.ver-todos-cursos-link').attr('data-nvl', 1);
2977 templatePorCategoria.find('.ver-todos-cursos-link').attr('data-tema', dadosCategoria.categoryId);
2978 templatePorCategoria.removeClass('d-none');
2979
2980 cursosPorCategoriaModelo1(dadosCategoria);
2981
2982 });
2983 });
2984
2985 // Esconde botao carregar mais, se necessário
2986
2987 $('.section-carregar-mais').remove();
2988
2989 if (temas.length > limit + offset)
2990 $('#cursos-por-categoria-container').append('<section style="padding: 30px 0; width:100%" class="section-carregar-mais"><div class="container"><a href="#a" class="ssp-section-tema__btn-ver-mais" id="carregar-mais" style="visibility:hidden"> Carregar mais unidades </a></div></section>');
2991
2992 break;
2993
2994 case 1:
2995 limit = 2;
2996
2997 $('#tema-atual h2').text("O que você quer aprender nessa área?");
2998 $('#tema-atual').show()
2999
3000 // Exibe os cursos dos subtemas do tema clicado percorrendo a lista de
3001 // subtemas do tema clicado
3002 if(subtemasStorage.get(activeCategory.categoryId) && subtemasStorage.get(activeCategory.categoryId).length > 0){
3003
3004 $.each(subtemasStorage.get(activeCategory.categoryId).slice(offset,
3005 limit + offset), function(k, t) {
3006
3007 if($('#cursos-por-categoria-'+t.categoryId).length == 0){
3008 var template = $('#cursos-por-categoria-template').clone();
3009 template.prop('id', 'cursos-por-categoria-'+t.categoryId);
3010
3011 template.removeClass('d-none');
3012
3013 $('#cursos-por-categoria-container').append(template);
3014 }
3015
3016 $.ajax(
3017 {
3018 url : '/o/senac-content-services/category/'
3019 + t.categoryId,
3020 type : 'get',
3021 async: false
3022 }).done(function(category) {
3023
3024 var dadosCategoria = JSON.parse(category);
3025
3026 //monta as divs para cada tcategoria
3027 var templatePorCategoria = $('#cursos-por-categoria-'+dadosCategoria.categoryId);
3028 templatePorCategoria.find('.tema-nome').text(dadosCategoria.name);
3029 templatePorCategoria.find('.ver-todos-cursos-link').attr('data-nvl', 2);
3030 templatePorCategoria.find('.ver-todos-cursos-link').attr('data-tema', dadosCategoria.categoryId);
3031 templatePorCategoria.removeClass('d-none');
3032
3033 cursosPorCategoriaModelo1(dadosCategoria);
3034
3035 });
3036 });
3037
3038 // Esconde botao carregar mais, se necessário
3039 $('.section-carregar-mais').remove();
3040
3041 if (subtemasStorage.get(activeCategory.categoryId).length > limit + offset)
3042 $('#cursos-por-categoria-container').append('<section style="padding: 30px 0; width:100%" class="section-carregar-mais"><div class="container"><a href="#a" class="ssp-section-tema__btn-ver-mais" id="carregar-mais" style="visibility:hidden"> Carregar mais unidades </a></div></section>');
3043
3044 }else{
3045 //Se nao tiver subtema, exibe o modelo 2
3046 cursosPorCategoriaModelo2();
3047 }
3048
3049 break;
3050
3051 case 2: // exibe cursos do nivel 2
3052 limitTodosCursos = 16;
3053 cursosPorCategoriaModelo2();
3054 break;
3055
3056 case 3:
3057 // subtemas de nivel 3 nao devem ter limite
3058 limitTodosCursos = ($('#filtro-temas-nivel-3 .subtema-ativo:not(.todos)').length) ? -1 : 16;
3059 cursosPorCategoriaModelo3(categories);
3060 break;
3061 }
3062
3063}
3064
3065/*
3066 * Faz a exibição dos cursos quando se carrega a tela ou clica em 'Todos'
3067 */
3068function cursosPorCategoriaModelo1(category) {
3069
3070 activeModeloExibicao = 1;
3071 categoryWithoutCourse = []
3072 hideMensagemSemCurso()
3073
3074 var urlFinal = urlCursosPorTipoCursoETemaComFiltrosBolsaECompra
3075 .replace('{groupId}', groupId)
3076 .replace('{unidadeCategoryId}', unidadeCategoryId)
3077 .replace('{categoryTemaId}', category.categoryId)
3078 .replace('{categoriaId}', idModalidadeEspecTecnica)
3079 .replace('{filtrarInscricoesAbertas}', filtrarInscricoesAbertas)
3080 .replace('{filtrarBolsaEstudo}', filtrarBolsaEstudo)
3081 .replace('{considerarUnidade}', 1)
3082 .replace('{start}', 0)
3083 .replace('{end}', limitCursos);
3084
3085
3086
3087
3088 $
3089 .ajax(
3090 {
3091 url : urlFinal,
3092 type : 'get',
3093 beforeSend: function () {
3094 loading('#cursos-por-categoria-'+category.categoryId+' .slider-curso');
3095 }
3096 })
3097 .done(
3098 function(cursosPorCategoria) {
3099
3100 enableScroll(true);
3101
3102 cursosPorCategoria = JSON.parse(cursosPorCategoria);
3103
3104 var totalCursos = cursosPorCategoria.total;
3105
3106 //Se nao retornou cursos, deve esconder a div da categoria
3107 if(totalCursos == 0){
3108 $('#cursos-por-categoria-'+category.categoryId).html('');
3109
3110 //essa classe tirar todo o padding da div, escondendo ela
3111 $('#cursos-por-categoria-'+category.categoryId).removeClass('ssp-section');
3112
3113 if(isMobile){
3114 var $element = document.getElementById('cursos-por-categoria-container');
3115 var _elementPos = $element.offsetTop + 100;
3116 var _scrollDown = _elementPos + (filtrarInscricoesAbertas == 1 || filtrarBolsaEstudo == 1 ? 300 : 1);
3117 window.scrollTo(window.scrollX || window.pageXOffset, _scrollDown);//carrega os cursos
3118 setTimeout(()=> window.scrollTo(window.scrollX || window.pageXOffset, _elementPos), 500);//mostra o primeiro
3119
3120 }else{
3121 var _scrollDown = (window.scrollY || window.pageYOffset) + (filtrarInscricoesAbertas == 1 || filtrarBolsaEstudo == 1 ? 20 : 1);
3122 window.scrollTo(window.scrollX || window.pageXOffset, _scrollDown);
3123 }
3124 updateMensagemSemCurso();
3125 return;
3126 }else{
3127
3128 if(!$('#cursos-por-categoria-'+category.categoryId).hasClass('ssp-section'))
3129 $('#cursos-por-categoria-'+category.categoryId).addClass('ssp-section');
3130
3131 }
3132
3133 var articles = [];
3134
3135 $.each(cursosPorCategoria.cursos, function(k, c){
3136 articles.push(c.articleId);
3137 });
3138
3139
3140 //Verifica a situação dos botoes de inscrições e bolsa
3141 $.ajax({
3142 url : '/o/senac-content-services/verificaBotoesInscricaoEBolsaPorUnidade/'+groupId+'/'+articles.join(',')+'/'+unidadeCategoryId,
3143 type : 'get',
3144 async: false
3145 })
3146 .done(function(infoBotoes){
3147
3148 enableScroll(true);
3149
3150 if(infoBotoes.length > 0) {
3151
3152 infoBotoes = JSON.parse(infoBotoes);
3153
3154 var template = $('#cursos-por-categoria-'+category.categoryId);
3155
3156 $('#cursos-por-categoria-'+category.categoryId+' .slider-curso').empty();
3157
3158 $.each(cursosPorCategoria.cursos, async function(k, curso) {
3159
3160 var itemCurso = buildCardCurso(curso, infoBotoes, isMobile)
3161
3162 template.append(itemCurso);
3163
3164 template.find('.slider-curso').append(itemCurso);
3165
3166 });
3167
3168 updateMensagemSemCurso();
3169
3170 // chama o slider por categoria
3171 if (isMobile){
3172 template.find('.slider-curso').css({"flex-wrap":"wrap"});
3173
3174 if($('.ssp-page-busca__section-resultado__ver-todos-mobile[data-tema="'+category.categoryId+'"]').length == 0){
3175
3176 //Exibe o link ver todos
3177 //Adicionava o botão ver todos. Possível adição do código do card novo!
3178 if(totalCursos > 4){
3179 template.find('.slider-curso').append('<a data-nvl="'+(activeCategoryLevel+1)+'" data-tema="'+category.categoryId+'" class="ssp-card-todos-cursos especializacao-tecnica card-ver-todos-cursos-link" ><p>Conferir todos <br>os <span>cursos</span></p><i class="far fa-arrow-right"></i></a>')
3180 } else {
3181 $(".ver-todos-cursos-link[data-tema='"+category.categoryId+"']").addClass("ver-todos-no-click");
3182 }
3183 }
3184 }else{
3185 template.find('.slider-curso').addClass(
3186 'slick-area slick-area--md-bleed slider-container slider-id-'
3187 + category.categoryId);
3188 if(totalCursos > 11){
3189 template.find('.slider-curso').append('<a data-nvl="'+(activeCategoryLevel+1)+'" data-tema="'+category.categoryId+'" class="ssp-card-todos-cursos especializacao-tecnica card-ver-todos-cursos-link" ><p>Conferir todos <br>os <span>cursos</span></p><i class="far fa-arrow-right"></i></a>')
3190 } else {
3191 $(".ver-todos-cursos-link[data-tema='"+category.categoryId+"']").addClass("ver-todos-no-click");
3192 }
3193
3194 $('.slider-id-' + category.categoryId).removeClass('slick-initialized')
3195 sliderCurso('.slider-id-' + category.categoryId);
3196 }
3197 }
3198 })
3199 })
3200
3201 .fail(function(jqXHR, textStatus, msg) {
3202 // alert(msg);
3203 })
3204}
3205
3206/*
3207 * Faz a exibição dos cursos quando se clica em temas nivel 2
3208 */
3209function cursosPorCategoriaModelo2() {
3210
3211 activeModeloExibicao = 2;
3212 categoryWithoutCourse = []
3213 hideMensagemSemCurso()
3214
3215 $('#tema-atual').hide()
3216 $("#tema-atual h2").html('');
3217
3218 var url = urlSearchTemas
3219 .replace('{groupId}', groupId)
3220 .replace('{unidadeCategoryId}', unidadeCategoryId)
3221 .replace('{categoriaId}', idModalidadeEspecTecnica)
3222 .replace('{nivelTema}', 2)
3223 .replace('{categoriaParentId}', activeCategory.categoryId);
3224
3225 // Busca os filhos (3 nivel)
3226 $.ajax({
3227 url : url,
3228 type : 'get',
3229 data : {}
3230 }).done(function(subtemas) {
3231
3232 enableScroll(true);
3233
3234 subtemas = JSON.parse(subtemas);
3235
3236 let subsubtemaLista = '' ;
3237
3238 if(subtemas.length > 0) {
3239 subsubtemaLista = '<h3 class="ssp-title-filtrar-mais">Filtrar mais:</h3>';
3240 const btnTodos = '<a href="#a" '
3241 + ' class="subtema btn-nivel-3 subtema-ativo todos" '
3242 + '" data-nvl="2" >'
3243 + 'Todos'
3244 + '</a>'
3245
3246 subsubtemaLista += btnTodos
3247 }
3248
3249 $.each(subtemas, function(k, v) {
3250 subsubtemaLista += '<a href="#a" class="subtema btn-nivel-3" data-tema="'
3251 + v.categoryId
3252 + '" data-nvl="3" >'
3253 + v.name
3254 + '</a>';
3255 });
3256
3257 const containerSubTemaLista = document.createElement('div')
3258 containerSubTemaLista.classList.add('row')
3259 containerSubTemaLista.innerHTML = subsubtemaLista
3260 $('#filtro-temas-nivel-3').html(containerSubTemaLista.outerHTML);
3261
3262 if(subtemas.length > 0) $('#filtro-temas-nivel-3').removeClass('d-none');
3263
3264 cursosPorCategoriaModelo3();
3265
3266 })
3267
3268}
3269
3270async function getCursosByCategory(category) {
3271 if(activeCategory == 'all')
3272 return []
3273
3274 var urlFinal = urlCursosPorTipoCursoETemaComFiltrosBolsaECompra
3275 .replace('{groupId}', groupId)
3276 .replace('{unidadeCategoryId}', unidadeCategoryId)
3277 .replace('{categoryTemaId}', category.categoryId)
3278 .replace('{categoriaId}', idModalidadeEspecTecnica)
3279 .replace('{filtrarInscricoesAbertas}', filtrarInscricoesAbertas)
3280 .replace('{filtrarBolsaEstudo}', filtrarBolsaEstudo)
3281 .replace('{considerarUnidade}', 1)
3282 .replace('{start}', offsetTodosCursos)
3283 .replace('{end}', (limitTodosCursos + offsetTodosCursos));
3284
3285
3286 return new Promise((resolve) => {
3287 $.ajax({
3288 url : urlFinal,
3289 type : 'get',
3290 data : {},
3291 async: false,
3292 beforeSend: function () {
3293 var totalItens = $('#curso-sem-slick .slick-area__item').length;
3294 if(totalItens > 0){
3295 $('#curso-sem-slick .slick-area__item').each(function(){
3296 if(!$.trim($(this).html()).length)
3297 $(this).remove();
3298 })
3299 }
3300 }
3301 })
3302 .done((data) => resolve(JSON.parse(data)))
3303 })
3304}
3305/*
3306 * Faz a exibição dos cursos quando se clica em temas nivel 3
3307 */
3308async function cursosPorCategoriaModelo3(categories) {
3309 activeModeloExibicao = 3;
3310 categoryWithoutCourse = []
3311 hideMensagemSemCurso()
3312
3313 //Se já estiver carregando não deixa juntar várias chamadas
3314 if($('#loading-todos-cursos').length > 0) return;
3315
3316 //Loading
3317 $('#cursos-por-categoria-container').append('<div id="loading-todos-cursos" style="width:100%; text-align:center">'+
3318 '<div class="ssp-loader-content">'+
3319 '<div class="ssp-loader"></div>'+
3320 '<p class="ssp-loader-text">Carregando...</p>'+
3321 '</div>'+
3322 '</div>');
3323 $("#tema-atual").hide()
3324 $("#tema-atual h2").html('');
3325
3326 categories = categories && categories.length ? categories : [activeCategory]
3327
3328 const cursosPorSubtema = []
3329 var totalCursos = 0;
3330 var templateContainer = $('#cursos-por-subtema-container');
3331 if(offsetTodosCursos == 0) templateContainer.find('#curso-sem-slick').empty();
3332
3333 for (let index = 0; index < categories.length; index++) {
3334 const category = categories[index];
3335
3336 const cursosEncontrados = await getCursosByCategory(category)
3337
3338 if(!cursosEncontrados || !cursosEncontrados.cursos || !cursosEncontrados.length)
3339 categoryWithoutCourse.push(category)
3340
3341 totalCursos += cursosEncontrados.total;
3342
3343 cursosEncontrados.cursos.forEach(cEncontrado => {
3344 if(!cursosPorSubtema.filter(c => c.articleId == cEncontrado.articleId).length)
3345 cursosPorSubtema.push(cEncontrado)
3346 })
3347 }
3348
3349 $('.ssp-loader-content').parent().remove();
3350
3351 if(!cursosPorSubtema.length) {
3352 updateMensagemSemCurso()
3353 enableScroll(true)
3354 return
3355 }
3356
3357 var articles = [];
3358
3359 $.each(cursosPorSubtema, function(k, c){
3360 articles.push(c.articleId);
3361 });
3362
3363 //Verifica a situação dos botoes de inscrições e bolsa
3364 $.ajax({
3365 url : '/o/senac-content-services/verificaBotoesInscricaoEBolsaPorUnidade/'+groupId+'/'+articles.join(',')+'/'+unidadeCategoryId,
3366 type : 'get',
3367 async: false
3368 })
3369 .done(async function(infoBotoes){
3370
3371 if(infoBotoes.length > 0) {
3372
3373 infoBotoes = JSON.parse(infoBotoes);
3374
3375 for (let index = 0; index < cursosPorSubtema.length; index++) {
3376 const curso = cursosPorSubtema[index];
3377
3378 var itemCurso = buildCardCurso(curso, infoBotoes, isMobile)
3379
3380 itemCurso.addClass('card-curso-nivel-2');
3381
3382 // procura a div criada e adiciona os cursos
3383 templateContainer.find('#curso-sem-slick').append(itemCurso);
3384 }
3385
3386 templateContainer.removeClass('d-none');
3387
3388 var totalCursosExibicao = $('#curso-sem-slick .slick-area__item').length;
3389
3390 // Esconde botao carregar mais, se necessário
3391 $('.section-carregar-mais').remove();
3392
3393 if (totalCursosExibicao < totalCursos)
3394 $('#cursos-por-subtema-container').append('<section style="padding: 30px 0; width:100%" class="section-carregar-mais"><div class="container"><a href="#a" class="ssp-section-tema__btn-ver-mais" id="carregar-mais" style="visibility:hidden"> Carregar mais unidades </a></div></section>');
3395 }
3396
3397 updateMensagemSemCurso();
3398
3399 })
3400
3401 enableScroll(true)
3402}
3403
3404function montaTextoTipoCursoParaCard(curso){
3405
3406 var tipoCursoNomeFinal = curso.tipoCursoNome + " ¿ " + curso.formatos[0].name;
3407
3408 if(curso.tipoCursoNome == "Livre")
3409 tipoCursoNomeFinal = "Livre";
3410 //tipoCursoNomeFinal = "Curso " + curso.tipoCursoNome + " ¿ " + curso.formatos[0].name;
3411
3412 return tipoCursoNomeFinal;
3413}
3414
3415//ao final de todos os ajax, se não houver curso na pag por causa dos filtros, exibimos mensagem de nenhum curso
3416$(document).ajaxStop(function () {
3417 $(".card-curso-nivel-2").each(function () {
3418 if($(this).children().length == 0)
3419 $(this).remove()
3420 });
3421});
3422
3423function hideMensagemSemCurso() {
3424 const $msg = $("#filtroSemCurso");
3425 if(!$msg.hasClass('d-none')) $msg.addClass('d-none');
3426}
3427function updateMensagemSemCurso() {
3428
3429 if($(".slick-area__item").not('.cursos-recentes-card').not('.d-none').length > 0 || $('#curso-sem-slick .slick-area__item').length > 0){
3430 hideMensagemSemCurso();
3431 return;
3432 }
3433
3434 let htmlSemCurso = ''
3435
3436 switch (getCurrentLevel()) {
3437 case 1:
3438 case 2:
3439 htmlSemCurso = getTextoSemCurso(filtrarBolsaEstudo,filtrarInscricoesAbertas,activeCategory.name)
3440 $(".ssp-bolsa-formulario__card-aviso-texto").html(htmlSemCurso);
3441 break;
3442
3443 case 3:
3444 categoryWithoutCourse
3445 .forEach(category => {
3446 const el = document.querySelector('[data-tema="' + category.categoryId + '"]')
3447 if(el) {
3448 const temaName = el.text
3449 htmlSemCurso += getTextoSemCurso(filtrarBolsaEstudo, filtrarInscricoesAbertas, temaName)
3450 }
3451 })
3452 if(!htmlSemCurso)
3453 htmlSemCurso = getTextoSemCurso(filtrarBolsaEstudo,filtrarInscricoesAbertas,activeCategory.name)
3454
3455 $(".ssp-bolsa-formulario__card-aviso-texto").html(htmlSemCurso);
3456 break;
3457
3458 default:
3459 break;
3460 }
3461
3462 if(htmlSemCurso){
3463 $("#filtroSemCurso").removeClass("d-none");
3464 }
3465}
3466
3467function getTextoSemCurso(filtroBolsa,filtroInsc,temaNome){
3468
3469 temaNome = typeof temaNome === "undefined" ? '' : 'de '+temaNome;
3470
3471 if(filtroBolsa && filtroInsc)
3472 return "<p>No momento, estamos sem cursos <strong><span id='nomeTemaSemCurso'>"+temaNome+"</span></strong> disponíveis para compra e com bolsas de estudo.<br>Selecione outras áreas para consultar bolsas ou <a href='https://www.sp.senac.br/bolsas-de-estudo'>confira bolsas disponíveis em diferentes cursos.</a></p>";
3473 else if(filtroBolsa)
3474 return "<p>No momento, estamos sem cursos <strong><span id='nomeTemaSemCurso'>"+temaNome+"</span></strong> com bolsas de estudo.<br>Selecione outras áreas para consultar bolsas ou <a href='https://www.sp.senac.br/bolsas-de-estudo'>confira bolsas disponíveis em diferentes cursos.</a></p>";
3475 else if(filtroInsc)
3476 return "<p>No momento, estamos sem cursos <strong><span id='nomeTemaSemCurso'>"+temaNome+"</span></strong> disponíveis para compra.";
3477
3478 return ''
3479}
3480
3481/*
3482 * Monta a lista de temas de curso livre no header da página
3483 */
3484
3485function carregaTemas() {
3486
3487 const url = urlSearchTemas
3488 .replace('{groupId}', groupId)
3489 .replace('{unidadeCategoryId}', unidadeCategoryId)
3490 .replace('{categoriaId}', idModalidadeEspecTecnica)
3491 .replace('{nivelTema}', 0)
3492 .replace('{categoriaParentId}', 0);
3493
3494 $
3495 .ajax(
3496 {
3497 url : url,
3498 type : 'get',
3499 async: false
3500 })
3501 .done(
3502 function(temasLista) {
3503 if(typeof temasLista != 'object')
3504 temasLista = JSON.parse(temasLista);
3505
3506 var temasObj = $('#temas');
3507
3508 $
3509 .each(
3510 temasLista,
3511 function(k, tema) {
3512 const icon = (categorias.filter(cat => cat.categoryId == tema.categoryId)[0] || {properties: {}}).properties.icon
3513 temasObj
3514 .append('<div class="ssp-section-tema__container-menu-item mega-menu"><a href="#a" class="tema" data-nvl="1" data-tema="'
3515 + tema.categoryId
3516 + '">'
3517 + '<i class="' + icon + '"></i>'
3518 + tema.name
3519 + '</a></div>');
3520
3521 const urlSubTema = urlSearchTemas
3522 .replace('{groupId}', groupId)
3523 .replace('{unidadeCategoryId}', unidadeCategoryId)
3524 .replace('{categoriaId}', idModalidadeEspecTecnica)
3525 .replace('{nivelTema}', 2)
3526 .replace('{categoriaParentId}', tema.categoryId);
3527
3528 // Armazena os subtemas deste tema
3529 $
3530 .ajax(
3531 {
3532 url : urlSubTema,
3533 type : 'get',
3534 data : {},
3535 async: false
3536 })
3537 .done(
3538 function(subtemas) {
3539 subtemasStorage
3540 .set(
3541 tema.categoryId,
3542 JSON
3543 .parse(subtemas));
3544
3545 });
3546 });
3547
3548 temas = temasLista;
3549
3550 displayCursosPorTema();
3551
3552 $('.todos').addClass('ativo');
3553
3554 }).fail(function(jqXHR, textStatus, msg) {
3555 // alert(msg);
3556 });
3557}
3558
3559/*
3560 * Exibe a lista de subtemas no mouse over do tema
3561 */
3562function displaySubTemasLista(categoryId) {
3563 $('#filtro-temas-nivel-2').empty();
3564 $('#filtro-temas-nivel-2').removeClass('d-none');
3565
3566 const btnTodos = $('<a href="#a" '
3567 + ' class="subtema btn-nivel-3 subtema-ativo todos" '
3568 + '" data-nvl="2" >'
3569 + 'Todos'
3570 + '</a>')
3571
3572 $('#filtro-temas-nivel-2').append(btnTodos);
3573
3574 if(!subtemasStorage.get(activeCategory.categoryId) || !subtemasStorage.get(activeCategory.categoryId).length)
3575 $('#filtro-temas-nivel-2 .subtema-ativo.todos').hide()
3576
3577 $.each(subtemasStorage.get(activeCategory.categoryId), function(k, t) {
3578 $('#filtro-temas-nivel-2').append('<a href="#a" class="subtema btn-nivel-3" data-tema="'
3579 + t.categoryId
3580 + '" data-nvl="2" >'
3581 + t.name
3582 + '</a>');
3583 });
3584}
3585
3586//Carregar mais
3587$(window).scroll(function() {
3588
3589 var element = document.querySelector('#carregar-mais');
3590
3591 if(element != null && !carregandoMais){
3592 var position = element.getBoundingClientRect();
3593
3594 // carregar maios
3595 if(position.top >= 0 && position.bottom <= window.innerHeight) {
3596 // enableScroll(false);
3597 var qtCardsSubTema = $('#cursos-por-subtema-container .ssp-card-curso').not('.d-none').length;
3598 if(qtCardsSubTema > 0){
3599 offsetTodosCursos = qtCardsSubTema;
3600 $('.section-carregar-mais').remove();
3601 }else{
3602 offset = $('.cursos-por-categoria').not('.d-none').length;
3603 }
3604
3605 const urlParamsTemaNv3 = new URLSearchParams(window.location.search);
3606 urlParamTemaNv3 = urlParamsTemaNv3.get('q');
3607
3608 if(!urlParamTemaNv3)
3609 displayCursosPorTema();
3610 }
3611 }
3612
3613});
3614
3615function enableScroll(enable) {
3616 if(enable === false) document.body.classList.add("stop-scrolling")
3617 else document.body.classList.remove("stop-scrolling");
3618 carregandoMais = !enable;
3619}
3620
3621function hideOthersLevel1(elementShow){
3622 document.querySelectorAll('#temas .ssp-section-tema__container-menu-item a')
3623 .forEach(a => a != elementShow ? a.classList.add('d-none') : undefined)
3624}
3625
3626function hideOthersLevel2(elementShow){
3627 document.querySelectorAll('#filtro-temas-nivel-2 a')
3628 .forEach(a => a != elementShow ? a.classList.add('d-none') : undefined)
3629}
3630
3631function hideOthersLevel3(elementShow){
3632 document.querySelectorAll('#filtro-temas-nivel-3 a')
3633 .forEach(a => a != elementShow ? a.classList.add('d-none') : undefined)
3634}
3635
3636function showAllLevel1(){
3637 document.querySelectorAll('#temas .ssp-section-tema__container-menu-item a')
3638 .forEach(btn => {
3639 btn.classList.remove('d-none')
3640 btn.classList.remove('ativo')
3641 btn.classList.remove('tema-ativo')
3642 })
3643}
3644
3645function showAllLevel2(){
3646 document.querySelectorAll('#filtro-temas-nivel-2 a')
3647 .forEach(btn => {
3648 btn.classList.remove('d-none')
3649 btn.classList.remove('subtema-ativo')
3650 })
3651}
3652
3653function showAllLevel3(){
3654 document.querySelectorAll('#filtro-temas-nivel-3 a')
3655 .forEach(btn => {
3656 btn.classList.remove('d-none')
3657 btn.classList.remove('subtema-ativo')
3658 })
3659}
3660
3661function removeFiltersLevel1() {
3662 showAllLevel1()
3663
3664 const btnActived = document.querySelector('#temas .ssp-section-tema__container-menu-item .todos')
3665 btnActived.click()
3666}
3667
3668function removeFiltersLevel2() {
3669 const btnActived = document.querySelector('#temas .tema-ativo')
3670 btnActived.click()
3671
3672 new Promise(() => btnActived.click())
3673}
3674
3675function removeFiltersLevel3() {
3676 const btnActivedNivel2 = document.querySelector('#filtro-temas-nivel-2 .subtema-ativo:not(.todos)')
3677 const temaNivel2 = btnActivedNivel2.getAttribute('data-tema')
3678
3679 removeFiltersLevel2()
3680
3681 const intervalNível2 = setInterval(() => {
3682 const btn = document.querySelector('[data-tema="' + temaNivel2 + '"]')
3683
3684 if(btn) {
3685 btn.click()
3686 $('.ssp-loader-content').parent().remove();
3687 clearInterval(intervalNível2)
3688 }
3689 }, 200);
3690}
3691
3692function clickTema(categoryId) {
3693 return new Promise(resolve => {
3694 const interval = setInterval(() => {
3695 const el = document.querySelector('[data-tema="' + categoryId + '"]')
3696
3697 if(el) {
3698 el.click()
3699 clearInterval(interval)
3700 resolve()
3701 }
3702 }, 200);
3703 })
3704}
3705
3706function getSubtemas(categoryFriendlyUrl, parentCategoryId) {
3707 return $.ajax({
3708 url : '/o/senac-unidade-services/categoriaPorFriendlyURL/'+categoryFriendlyUrl+"/"+(parentCategoryId || 0),
3709 type : 'get',
3710 dataType: 'json',
3711 async: false
3712 })
3713}
3714
3715function getCategoriesIdNivel3Actived() {
3716 const categories = []
3717
3718 document.querySelectorAll("#filtro-temas-nivel-3 a.subtema-ativo")
3719 .forEach(a => categories.push(parseInt(a.getAttribute('data-tema'))))
3720
3721 return categories
3722}
3723
3724function getCurrentLevel() {
3725 let level = 1
3726
3727 if(document.querySelector('#temas .tema-ativo'))
3728 level = 1
3729
3730 if(document.querySelector('#filtro-temas-nivel-2 .subtema-ativo'))
3731 level = 2
3732
3733 if(document.querySelector('#filtro-temas-nivel-3 .subtema-ativo'))
3734 level = 3
3735
3736 return level
3737}
3738
3739
3740</script>