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