Teste 15/02
Organização
Teste 15/02
Java method "com.sun.proxy.$Proxy136.getOrganization(long)" threw an exception when invoked on com.sun.proxy.$Proxy136 object "com.liferay.portal.service.impl.OrganizationLocalServiceImpl@51e5b32a"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: organization = OrganizationLocalServi... [in template "34764#34807#null" at line 14, column 17] ----
1<#assign
2 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
3/>
4
5<#assign
6 viewerHasPrivileges = false
7 userId = themeDisplay.getUserId()
8/>
9
10<#if userId?? >
11 <#assign
12 orgId = _CUSTOM_FIELD_organization.getData()?number
13 viewerHasPrivileges = OrganizationLocalService.hasUserOrganization(userId, orgId)
14 organization = OrganizationLocalService.getOrganization(orgId)
15 />
16</#if>
17
18<#assign
19 nome = organization.getName()!""
20 imagem = (viewerHasPrivileges || DDMStructure_Field84114755.getData()!="0")?string(DDMStructure_CampoDeTexto18329557.getData()!"","")
21 tipo = (viewerHasPrivileges || DDMStructure_Numrico28474992.getData()!="0")?string(DDMStructure_Text61401294.getData()!"","")
22 tipo = tipo?replace("\n", "")
23 tipo = tipo?replace("\t", "")
24 tipo = tipo?replace("\r", "")
25 pais = (viewerHasPrivileges || DDMStructure_Field45654872.getData()!="0")?string(DDMStructure_Text47038833.getData()!"","")
26 cidade = (viewerHasPrivileges || DDMStructure_Field81614178.getData()!="0")?string(DDMStructure_Text38119908.getData()!"","")
27 estado = (viewerHasPrivileges || DDMStructure_Field89862022.getData()!="0")?string(DDMStructure_Text87845472.getData()!"","")!""
28
29 site = (viewerHasPrivileges || DDMStructure_Field62760436.getData()!="0")?string(DDMStructure_Text98734375.getData()!"","")
30 instagram = ""
31 linkedin = (viewerHasPrivileges || DDMStructure_Field18557678.getData()!="0")?string(DDMStructure_Text82629110.getData()!"","")
32 facebook = ""
33
34 sobre = (DDMStructure_Field80037203.getData()!="0")?string(DDMStructure_Text54730891.getData()!"","")
35 competencias = (DDMStructure_Numrico42321087.getData()!="0")?string(DDMStructure_Text51537691.getData()!"","")
36 setores = (DDMStructure_Field04200031.getData()!="0")?string("yes","")
37
38 instituicao = (viewerHasPrivileges || DDMStructure_Numrico42321087.getData()!="0")?string(DDMStructure_Text31001996.getData()!"","")
39 tipoDeEntidade = (viewerHasPrivileges || DDMStructure_Numrico28474992.getData()!="0")?string(DDMStructure_Text53411607.getData()!"","")
40
41
42>
43
44<div class="bioec_org_info_container">
45
46 <#if viewerHasPrivileges>
47 <!--<div class="botoesSidebarMobile mb-5">
48 <button class="bioec_secondary_button" data-toggle="modal" data-target="#bioec-org-delete-modal">
49 EXCLUIR ORGANIZAÇÃO
50 </button>
51 <button class="bioec_primary_button" data-toggle="modal" data-target="#bioec-org-edit-modal">
52 EDITAR
53 </button>
54 </div> -->
55 </#if>
56
57 <div id="profilePic">
58 <#if imagem?trim == "">
59 <div class="profilePic-container">
60 <i class="fa fa-user"></i>
61 <a id="btnEditOrgModal" type="button" data-toggle="modal" data-target="#bioec-org-edit-modal">
62 <i class="fa fa-edit"></i>
63 </a>
64 </div>
65 <#else>
66 <div id="ProfilePic_Frame">
67 <img src="${imagem}" />
68 <a id="btnEditOrgModal" type="button" data-toggle="modal" data-target="#bioec-org-edit-modal">
69 <i class="fa fa-edit"></i>
70 </a>
71 </div>
72 </#if>
73
74 </div>
75
76 <#if nome!="">
77 <label class="bioec_org_info_label">Nome da Organização</label>
78 <div class="bioec_org_info_content">${nome}</div>
79 </#if>
80
81 <#if tipo!="">
82 <label class="bioec_org_info_label">Tipo de Organização</label>
83 <div class="bioec_org_info_content">${tipo}</div>
84 </#if>
85
86 <#if instituicao!="" && tipo == "Grupo de Pesquisa/Universidade">
87 <label class="bioec_org_info_label">Instituição</label>
88 <div class="bioec_org_info_content">${instituicao}</div>
89 </#if>
90
91 <#if tipoDeEntidade!="" && tipo == "Investidor/Agência de Fomento">
92 <label class="bioec_org_info_label">Tipo de Entidade</label>
93 <div class="bioec_org_info_content">${tipoDeEntidade}</div>
94 </#if>
95
96 <#if cidade!="">
97 <label class="bioec_org_info_label">Cidade</label>
98 <div class="bioec_org_info_content">${cidade}</div>
99 </#if>
100
101 <#if estado!="">
102 <label class="bioec_org_info_label">Estado</label>
103 <div class="bioec_org_info_content">${estado}</div>
104 </#if>
105
106 <#if pais!="">
107 <label class="bioec_org_info_label">País</label>
108 <div class="bioec_org_info_content">${pais}</div>
109 </#if>
110
111 <div class="bioec_org_info_social_container">
112 <#if site != "">
113 <a href="${site}" target="_blank" rel="noopener noreferrer">
114 <i class="fa-solid fa-laptop"></i>
115 </a>
116 </#if>
117
118 <#if instagram != "">
119 <a href="${instagram}" target="_blank" rel="noopener noreferrer">
120 <i class="fa-brands fa-instagram"></i>
121 </a>
122 </#if>
123
124 <#if linkedin != "">
125 <a href="${linkedin}" target="_blank" rel="noopener noreferrer">
126 <i class="fa-brands fa-linkedin-in"></i>
127 </a>
128 </#if>
129
130 <#if facebook != "">
131 <a href="${facebook}" target="_blank" rel="noopener noreferrer">
132 <i class="fa-brands fa-facebook"></i>
133 </a>
134 </#if>
135
136 </div>
137
138 <#if false && viewerHasPrivileges>
139 <button data-toggle="modal" data-target="#privacyModal" class="bioec_primary_button">
140 CONFIGURAÇÕES DE PRIVACIDADE
141 </button>
142 </#if>
143</div>
144
145<style>
146.bioec_org_info_container {
147 display: flex;
148 flex-direction: column;
149 background-color: #E8ECEF;
150 height: 100%;
151 padding: 40px 24px 40px 0;
152}
153
154.bioec_org_info_img_placeholder {
155 align-self: center;
156 height: 120px;
157 width: 120px;
158 background-color: #595A5F;
159 border-radius: 50%;
160 display: flex;
161 align-items: center;
162 justify-content: center;
163 color: var(--white-1);
164 font-size: 72px;
165 cursor: default;
166}
167
168.bioec_org_info_label {
169 display: block;
170 font-weight: 700;
171 font-size: 20px;
172 line-height: 150%;
173 color: #5B5C61;
174 margin-bottom: 8px;
175 margin-top: 24px;
176 cursor: text;
177}
178
179.bioec_org_info_content {
180 display: block;
181 font-weight: 400;
182 font-size: 16px;
183 line-height: 150%;
184 color: #5B5C61;
185 border-bottom: 1px solid #BEBEBE;
186 padding-bottom: 4px;
187}
188
189.bioec_org_info_social_container {
190 display: flex;
191 flex-direction: row;
192 align-items: center;
193 justify-content: center;
194 margin: 40px 0;
195}
196
197.bioec_org_info_social_container a {
198 font-size: 35px;
199 color: #5B5C61;
200 margin: 0 15px;
201}
202
203.botoesSidebarMobile{
204display: none;
205justify-content: flex-end;
206gap: 20px;
207}
208#profilePic {
209 display: flex;
210 justify-content: center;
211 width: 120px;
212 height: 120px;
213 margin: auto;
214 position: relative;
215}
216
217#profilePic a:hover {
218 text-decoration: none;
219}
220
221#profilePic a#btnEditOrgModal {
222 text-decoration: none;
223 position: absolute;
224 right: 0;
225 bottom: 0;
226 color: var(--white);
227 background-color: var(--color-3);
228 height: 40px;
229 width: 40px;
230 border-radius: 50%;
231 border: none;
232 outline: none;
233 display: flex;
234 align-items: center;
235 justify-content: center;
236 padding: 0;
237 font-size: 18px;
238
239}
240
241#ProfilePic_Frame {
242 border-radius: 50%;
243 width: 100%;
244 height: 100%;
245 overflow: hidden;
246}
247 #ProfilePic_Frame img {
248 width: 100%;
249 height: 100%;
250 object-fit: cover;
251}
252
253.profilePic-container {
254 color: #FFF;
255 background-color: #595A5F;
256 border-radius: 50%;
257 position: relative;
258 display: flex;
259 align-items: center;
260 justify-content: center;
261 padding: 35px;
262 width: 100%;
263 height: 100%;
264 font-size: 70px;
265}
266
267
268@media (max-width: 1200px) {
269 .bioec_org_info_container {
270 padding: 40px 24px;
271 }
272}
273
274@media (max-width: 994px) {
275.botoesSidebarMobile{
276display: flex;
277}
278}
279</style>
Java method "com.sun.proxy.$Proxy136.getOrganization(long)" threw an exception when invoked on com.sun.proxy.$Proxy136 object "com.liferay.portal.service.impl.OrganizationLocalServiceImpl@51e5b32a"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: organization = OrganizationLocalServi... [in template "34764#34807#null" at line 20, column 17] ----
1<#assign
2 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
3 JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")
4/>
5
6<#assign
7 hasPrivileges = false
8 userId = themeDisplay.getUserId()
9/>
10
11<#assign
12 orgTypes = ["Entidade Governamental","Associação","Outras ICT's","Comunidade Tradicional/Cooperativa","Startup",
13 "Entidade do Terceiro Setor","Investidor/Agência de Fomento","Grupo de Pesquisa/Universidade","Empresa"]
14/>
15
16<#if userId?? >
17<#assign
18 orgId = _CUSTOM_FIELD_organization.getData()?number
19 hasPrivileges = OrganizationLocalService.hasUserOrganization(userId, orgId)
20 organization = OrganizationLocalService.getOrganization(orgId)
21/>
22</#if>
23
24<#if hasPrivileges>
25 <#assign
26 organization = OrganizationLocalService.getOrganization(_CUSTOM_FIELD_organization.getData()?number)
27 articleId = organization.getExpandoBridge().getAttribute("journal-article")
28 journalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),articleId?c)
29 articleXml = journalArticle.getDocument().getRootElement()
30
31 setoresXml = articleXml.selectNodes("dynamic-element[@name='Text40807358']")
32 setores = ""
33 />
34 <#list setoresXml as setor>
35 <#assign setores = setores + "'" + setor.getStringValue()?trim + "'," >
36 </#list>
37
38 <button class="bioec_secondary_button mx-3" data-toggle="modal" style="display: flex;margin-left: auto !important;margin-right: auto !important;margin-top: 24px;" data-target="#bioec-org-delete-modal">EXCLUIR ORGANIZAÇÃO</button>
39 <!-- <div class="mt-4 d-md-flex d-none align-items-center justify-content-end">
40 <button class="bioec_primary_button bioec_editar" data-toggle="modal" data-target="#bioec-org-edit-modal">EDITAR</button>
41 </div> -->
42
43 <#-- MODAL DE EXLUIR ORGANIZAÇÃO -->
44 <div id="bioec-org-delete-modal" class="modal fade" style="display: none;" role="dialog" aria-hidden="true">
45 <div class="modal-dialog" role="document">
46 <div class="modal-content px-4 py-3">
47 <div class="modal-header">
48 <h5 class="modal-title">Excluir organização</h5>
49 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
50 <span aria-hidden="true">×</span>
51 </button>
52 </div>
53 <div class="d-flex justify-content-end py-3">
54 <button type="button" class="bioec_secondary_button mx-3" data-dismiss="modal">CANCELAR</button>
55 <button type="button" class="bioec_primary_button" onclick="deleteOrg()" >CONTINUAR</button>
56 </div>
57 </div>
58 </div>
59 </div>
60
61
62
63 <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
64 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js" integrity="sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
65 <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
66 <link
67 rel="stylesheet"
68 href="https://cdnjs.cloudflare.com/ajax/libs/croppie/2.6.5/croppie.min.css"
69 integrity="sha512-zxBiDORGDEAYDdKLuYU9X/JaJo/DPzE42UubfBw9yg8Qvb2YRRIQ8v4KsGHOx2H1/+sdSXyXxLXv5r7tHc9ygg=="
70 crossorigin="anonymous"
71 referrerpolicy="no-referrer"
72 />
73
74 <script
75 src="https://cdnjs.cloudflare.com/ajax/libs/croppie/2.6.5/croppie.min.js"
76 integrity="sha512-Gs+PsXsGkmr+15rqObPJbenQ2wB3qYvTHuJO6YJzPe/dTLvhy0fmae2BcnaozxDo5iaF8emzmCZWbQ1XXiX2Ig=="
77 crossorigin="anonymous"
78 referrerpolicy="no-referrer"
79 ></script>
80
81
82<style>
83
84 .bioec_profile-form h1 {
85 font-weight: 400;
86 font-size: 39px;
87 line-height: 150%;
88 color: #5B5C61;
89 }
90
91 .bioec_profile-form-control {
92 margin-bottom: 40px;
93 }
94
95 .bioec_profile-form-control label {
96 color: #5B5C61;
97 font-size: 20px;
98 font-weight: 700;
99 line-height: 30px;
100 margin-bottom: 8px;
101 }
102
103 .bioec_profile-form-control label[required]::before {
104 content: "*";
105 color: #ff0000;
106 margin-right: 0.4rem;
107 }
108
109 .bioec_profile-form-control input,
110 .bioec_profile-form-control select {
111 border-radius: 0;
112 outline: none;
113 border: none;
114 border-bottom: 1px solid #BEBEBE;
115 font-size: 16px;
116 font-weight: 400;
117 line-height: 24px;
118 color: #5B5C61;
119 width: 100%;
120 background-color: transparent;
121 padding: 2px;
122 margin: 0;
123 }
124
125 .submit-attempted .bioec_profile-form-control input:invalid,
126 .submit-attempted .bioec_profile-form-control select:invalid {
127 border-bottom: 1px solid #ff0000;
128 }
129
130 .bioec_profile-flex-container {
131 display: flex;
132 flex-direction: row;
133 justify-content: space-between;
134 flex-wrap: wrap;
135 }
136
137 .bioec_profile-flex-container .bioec_profile-form-control {
138 width: 50%;
139 padding-right: 1.5rem;
140 }
141
142 .bioec_profile-form-control textarea {
143 font-size: 16px;
144 font-weight: 400;
145 line-height: 24px;
146 color: #5B5C61;
147 width: 100%;
148 background-color: transparent;
149 border-radius: 0;
150 border: 1px solid #BEBEBE;
151 resize: none;
152 outline: none;
153 margin-top: 24px;
154 }
155
156 .modal-header h1{
157 color: #5B5C61;
158 margin-bottom: 0px;
159 font-size: 25px;
160 line-height: 58.5px;
161 font-weight: 400;
162 }
163
164 @media (max-width: 768px) {
165 .bioec_profile-flex-container .bioec_profile-form-control {
166 margin-bottom: 1.5rem;
167 width: 100%;
168 padding-right: 0rem;
169 }
170 }
171</style>
172
173<script>
174
175function deleteOrg() {
176 Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""});
177 fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/profile-management/organization/${_CUSTOM_FIELD_organization.getData()}",
178 {
179 method: "DELETE",
180 headers: {
181 "x-csrf-token": Liferay.authToken,
182 "Content-Type": "application/json",
183 "Accept": "application/json"
184 }
185 })
186 .then( Liferay.Util.openToast({
187 message: "Estamos processando seu arquivo. Favor aguarde por alguns segundos e redireciorameos você automaticamente.",
188 type: "success",
189 title: "",
190 toastProps: {
191 autoClose: 2000
192 }
193 }))
194 .then(setTimeout(() => { window.location.href = Liferay.ThemeDisplay.getPortalURL() + "/meu-perfil#deleteOrg" }, 2000))
195
196
197
198}
199
200
201
202</script>
203
204</#if>
Java method "com.sun.proxy.$Proxy136.getOrganization(long)" threw an exception when invoked on com.sun.proxy.$Proxy136 object "com.liferay.portal.service.impl.OrganizationLocalServiceImpl@51e5b32a"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: organization = OrganizationLocalServi... [in template "34764#34807#null" at line 20, column 17] ----
1<#assign
2 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
3 JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")
4/>
5
6<#assign
7 hasPrivileges = false
8 userId = themeDisplay.getUserId()
9/>
10
11<#assign
12 orgTypes = ["Entidade Governamental","Associação","Outras ICT's","Comunidade Tradicional/Cooperativa","Startup",
13 "Entidade do Terceiro Setor","Investidor/Agência de Fomento","Grupo de Pesquisa/Universidade","Empresa"]
14/>
15
16<#if userId?? >
17<#assign
18 orgId = _CUSTOM_FIELD_organization.getData()?number
19 hasPrivileges = OrganizationLocalService.hasUserOrganization(userId, orgId)
20 organization = OrganizationLocalService.getOrganization(orgId)
21/>
22</#if>
23
24<#if hasPrivileges>
25 <#assign
26 organization = OrganizationLocalService.getOrganization(_CUSTOM_FIELD_organization.getData()?number)
27 articleId = organization.getExpandoBridge().getAttribute("journal-article")
28 journalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),articleId?c)
29 articleXml = journalArticle.getDocument().getRootElement()
30
31 setoresXml = articleXml.selectNodes("dynamic-element[@name='Text40807358']")
32 setores = ""
33 />
34 <#list setoresXml as setor>
35 <#assign setores = setores + "'" + setor.getStringValue()?trim + "'," >
36 </#list>
37
38 <div class="mt-4 d-md-flex d-none align-items-center justify-content-end" style="display:none!important;" >
39 <button class="bioec_secondary_button mx-3" data-toggle="modal" data-target="#bioec-org-delete-modal" >EXCLUIR ORGANIZAÇÃO</button>
40 <button class="bioec_primary_button bioec_editar" data-toggle="modal" data-target="#bioec-org-edit-modal" >EDITAR</button>
41 </div>
42
43
44
45
46
47 <#-- MODAL DE EXLUIR ORGANIZAÇÃO -->
48 <div id="bioec-org-delete-modal" class="modal fade" style="display: none;" role="dialog" aria-hidden="true">
49 <div class="modal-dialog" role="document">
50 <div class="modal-content px-4 py-3">
51 <div class="modal-header">
52 <h5 class="modal-title">Excluir organização</h5>
53 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
54 <span aria-hidden="true">×</span>
55 </button>
56 </div>
57 <div class="d-flex justify-content-end py-3">
58 <button type="button" class="bioec_secondary_button mx-3" data-dismiss="modal">CANCELAR</button>
59 <button type="button" class="bioec_primary_button" onclick="deleteOrg()" >CONTINUAR</button>
60 </div>
61 </div>
62 </div>
63 </div>
64
65 <#-- MODAL DE EDIÇÃO -->
66 <div id="bioec-org-edit-modal" class="modal fade" style="display: none;" tabindex="-1" role="dialog" aria-hidden="true">
67 <div class="modal-dialog modal-lg" role="document">
68 <div class="modal-content px-4 py-3">
69
70 <div class="modal-header">
71 <h1>Sobre a organização</h1>
72 <button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="closeAndReset()">
73 <span aria-hidden="true">×</span>
74 </button>
75 </div>
76
77 <div class="modal-body">
78 <form id="organization-form" class="bioec_profile-form">
79<#assign imagemOrg = DDMStructure_CampoDeTexto18329557.getData() >
80
81 <div class="d-flex justify-content-center my-5" style="
82 flex-direction: column;
83 align-items: center;
84 ">
85 <div id="orgPicContainer" class="bioec_form-picture-container" ${(imagemOrg != "")?string("style='background-image: url("+ imagemOrg +")'","")} >
86 <i id="user-icon" class="fa fa-user"></i>
87 <button type="button" onclick="openFileSelectImagem()">
88 <i class="fa fa-edit"></i>
89 </button>
90 </div>
91 <input name="imagem" id="file-input" class="d-none" type="file" onchange="encodeImageAsURL(this)" accept="image/*"/>
92 <input class="d-none" id="inputOrgBase64OrgModal" />
93 <button type="button" onclick="removeImageOrgModal(this)" id="removerImagemOrgModal" ${(imagemOrg != "")?string("", "class='d-none'")}>
94 <i class="fa fa-trash"></i> Remover imagem
95 </button>
96 </div>
97
98 <div class="bioec_profile-flex-container">
99 <div class="bioec_profile-form-control">
100 <label required>Tipo de Organização</label>
101 <select id="tipo-de-organizacao" name="tipo" required title="Selecionar" value="${DDMStructure_Text61401294.getData()}">
102 <option value="" disabled selected>Selecionar</option>
103 <#list orgTypes as type>
104 <option value="${type}" ${(type==DDMStructure_Text61401294.getData())?string("selected","")} >${type}</option>
105 </#list>
106 </select>
107 </div>
108
109 <div class="bioec_profile-form-control">
110 <div id="org-tipo-6" class="d-none">
111 <label>Tipo de entidade</label>
112 <input name="investimento" type="text" id="tipodeentidadeOrganizacao" value="${DDMStructure_Text53411607.getData()}" />
113 </div>
114 <div id="org-tipo-7" class="d-none">
115 <label>Instituição</label>
116 <input name="instituicao" type="text" id="instituicaoOrganizacao" value="${DDMStructure_Text31001996.getData()}" />
117 </div>
118 </div>
119
120 <div class="bioec_profile-form-control">
121 <label required for="nomeOrganizacao">Nome da Organização</label>
122 <input id="nomeOrganizacao" name="nome" type="text" required value="${organization.getName()}" />
123 </div>
124
125 <div class="bioec_profile-form-control">
126 <label for="cidadeOrganizacao">Cidade</label>
127 <input id="cidadeOrganizacao" name="cidade" type="text" value="${DDMStructure_Text38119908.getData()}" />
128 </div>
129
130 <div class="bioec_profile-form-control">
131 <label for="estadoOrganizacao">Estado</label>
132 <input id="estadoOrganizacao" name="estado" type="text" value="${DDMStructure_Text87845472.getData()}" />
133 </div>
134
135
136 <div class="bioec_profile-form-control">
137 <label for="paisOrganizacao">País</label>
138 <input id="paisOrganizacao" name="pais" type="text" value="${DDMStructure_Text47038833.getData()}" />
139 </div>
140
141 </div>
142
143 <h1 class="my-5">Informações digitais</h1>
144
145 <div class="bioec_profile-flex-container">
146 <div class="bioec_profile-form-control">
147 <label for="siteOrganizacao">Site</label>
148 <input id="siteOrganizacao" name="site" type="url" value="${DDMStructure_Text98734375.getData()}" />
149 </div>
150 <div class="bioec_profile-form-control">
151 <label for="linkedinOrganizacao">Linkedin</label>
152 <input id="linkedinOrganizacao" name="linkedin" type="url" value="${DDMStructure_Text82629110.getData()}" />
153 </div>
154 <#-- <div class="bioec_profile-form-control">
155 <label>Instagram</label>
156 <input name="instagram" type="url" value="${Text28208517.getData()}" />
157 </div>
158 <div class="bioec_profile-form-control">
159 <label>Facebook</label>
160 <input name="facebook" type="url" value="${Text71851201.getData()}" />
161 </div> -->
162 </div>
163
164 <h1 class="my-5">Campo de atuação</h1>
165
166 <div>
167 <div class="bioec_profile-form-control">
168 <label required for="sobreOrganizacao">Sobre a organização</label>
169 <textarea id="sobreOrganizacao" name="sobre" rows="5" >${DDMStructure_Text54730891.getData()}</textarea>
170 </div>
171
172 <div class="bioec_profile-form-control">
173 <label required for="competenciasOrganizacao">Competências tecnológicas</label>
174 <textarea id="competenciasOrganizacao" name="competencias" rows="5" >${DDMStructure_Text51537691.getData()}</textarea>
175 </div>
176
177 <div class="bioec_profile-form-control">
178 <label required>Setores de atuação</label>
179 <select id="setores-de-atuacao" name="setores" multiple="multiple" style="width: 100%">
180 <option value="Agroindústria">Agroindústria</option>
181 <option value="Água Potável e Saneamento">Água Potável e Saneamento</option>
182 <option value="Alimentos e Bebidas">Alimentos e Bebidas</option>
183 <option value="Análise de Ciclo de Vida">Análise de Ciclo de Vida</option>
184 <option value="Biotecnologia">Biotecnologia</option>
185 <option value="Educação">Educação</option>
186 <option value="Energia e Biocombustíveis">Energia e Biocombustíveis</option>
187 <option value="Higiene Pessoal, Perfumaria e Cosméticos">Higiene Pessoal, Perfumaria e Cosméticos</option>
188 <option value="Inovação">Inovação</option>
189 </select>
190 </div>
191
192 <!-- <h1 class="mt-5 mb-4">Você na organização</h1>
193
194 <div class="bioec_profile-flex-container">
195 <div class="bioec_profile-form-control">
196 <label>Cargo/Função</label>
197 <input name="cargo" type="text" value="Administrador" />
198 </div>
199 </div> -->
200
201 </div>
202
203 <div class="d-flex justify-content-center my-5">
204 <button type="button" data-dismiss="modal" class="bioec_secondary_button mx-3" onclick="closeAndReset()">CANCELAR</a>
205 <button type="button" class="bioec_primary_button mx-3" onclick="submitOrganization()">SALVAR</button>
206 </div>
207
208 </form>
209 </div>
210 </div>
211 </div>
212 </div>
213
214 <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
215 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js" integrity="sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
216 <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
217
218<script>
219
220
221function toggleSpecialFields(value) {
222 if(value == "Investidor/Agência de Fomento") {
223 $("#org-tipo-6").removeClass("d-none")
224 $("#org-tipo-7").addClass("d-none")
225 } else if(value == "Grupo de Pesquisa/Universidade") {
226 $("#org-tipo-7").removeClass("d-none")
227 $("#org-tipo-6").addClass("d-none")
228 } else {
229 $("#org-tipo-6").addClass("d-none")
230 $("#org-tipo-7").addClass("d-none")
231 }
232}
233
234$("#tipo-de-organizacao").change((obj) => {
235 const v = obj.target.value
236 toggleSpecialFields(v)
237});
238
239toggleSpecialFields(document.getElementById("tipo-de-organizacao").value)
240
241$(document).ready(() => {
242 $("#setores-de-atuacao").select2({
243 language: {
244 noResults: () => "Nenhum resultado encontrado",
245 },
246 selectionCssClass: "bioec_multi_select",
247 });
248 $("#setores-de-atuacao").val([${setores}]);
249 $("#setores-de-atuacao").trigger('change');
250
251 let urlSearchParams = new URLSearchParams(window.location.search);
252
253 if( urlSearchParams.has('popup_editar') == 1){
254 $('.bioec_editar').click();
255 urlSearchParams.delete('popup_editar');
256 if (history.replaceState) {
257 let searchString = urlSearchParams.toString().length > 0 ? '?' + urlSearchParams.toString() : '';
258 let newUrl = window.location.protocol + "//" + window.location.host + window.location.pathname + searchString + window.location.hash;
259 history.replaceState(null, '', newUrl);
260 }
261 }
262});
263
264function validImageSize(base64="") {
265 const decoded = atob(base64.substring(base64.indexOf(',') + 1));
266 const sizeMB = decoded.length / 1e+6;
267 console.log("MB: " + decoded.length / 1e+6);
268 if(sizeMB > 10) {
269 Liferay.Util.openToast({
270 message: "O tamanho da imagem não deve ultrapassar 10 MB.",
271 type: "danger",
272 title: "",
273 toastProps: {
274 autoClose: 5000
275 }
276 })
277 return false
278 }
279 return true
280}
281
282 function encodeImageAsURL(element) {
283 let file = element.files[0];
284 let reader = new FileReader();
285 reader.onloadend = () => {
286 if(reader.result) {
287 if(!validImageSize(reader.result)) return;
288 try {
289 console.log("hi!")
290 const pic_container = document.getElementById("orgPicContainer")
291 const base64_input = document.getElementById("inputOrgBase64OrgModal")
292 base64_input.value = reader.result
293 pic_container.style.backgroundImage = 'url(' + reader.result + ')'
294 const removeImageButton = document.getElementById(
295 "removerImagemOrgModal"
296 );
297 const user_icon = document.getElementById("user-icon")
298 user_icon.style.display = "none";
299 removeImageButton.classList.remove("d-none");
300 } catch (error) {
301 console.error(error)
302 }
303 }
304 }
305 reader.readAsDataURL(file);
306 }
307
308 function removeImageOrgModal(element) {
309 try {
310 const file_input = document.getElementById("file-input");
311 const pic_container = document.getElementById("orgPicContainer")
312 const base64_input = document.getElementById("inputOrgBase64OrgModal");
313
314 file_input.value = null;
315 base64_input.value = "";
316 pic_container.style.backgroundImage = null;
317
318 const user_icon = document.getElementById("user-icon")
319 user_icon.style.display = "block";
320
321 const removeImageButton = document.getElementById("removerImagemOrgModal");
322 removeImageButton.classList.add("d-none");
323 } catch (error) {
324 console.error(error);
325 }
326 }
327
328function openFileSelectImagem() {
329 document.getElementById("file-input").click();
330}
331
332function initUrl(input, defaulthost) {
333 const value = input.value;
334 if(!value) {
335 input.value = defaulthost;
336 }
337}
338
339function submitForm() {
340console.log("Tentativa de envio")
341const form = document.getElementById("organization-form")
342form.classList.add("submit-attempted")
343}
344
345function closeAndReset() {
346 document.getElementById("organization-form").reset();
347}
348
349</script>
350
351<style>
352
353 .bioec_profile-form #removerImagemOrgModal {
354 background: none;
355 cursor: pointer;
356 border: none;
357 outline: none;
358 color: #5b5c61;
359 font-size: 16px;
360 font-weight: 900;
361 line-height: 24px;
362 letter-spacing: 0em;
363 width: fit-content;
364 margin-left: 16px;
365 margin-top: 22px;
366 }
367
368
369 .bioec_profile-form h1 {
370 font-weight: 400;
371 font-size: 39px;
372 line-height: 150%;
373 color: #5B5C61;
374 }
375
376 .bioec_profile-form-control {
377 margin-bottom: 40px;
378 }
379
380 .bioec_profile-form-control label {
381 color: #5B5C61;
382 font-size: 20px;
383 font-weight: 700;
384 line-height: 30px;
385 margin-bottom: 8px;
386 }
387
388 .bioec_profile-form-control label[required]::before {
389 content: "*";
390 color: #ff0000;
391 margin-right: 0.4rem;
392 }
393
394 .bioec_profile-form-control input,
395 .bioec_profile-form-control select {
396 border-radius: 0;
397 outline: none;
398 border: none;
399 border-bottom: 1px solid #BEBEBE;
400 font-size: 16px;
401 font-weight: 400;
402 line-height: 24px;
403 color: #5B5C61;
404 width: 100%;
405 background-color: transparent;
406 padding: 2px;
407 margin: 0;
408 }
409
410 .submit-attempted .bioec_profile-form-control input:invalid,
411 .submit-attempted .bioec_profile-form-control select:invalid {
412 border-bottom: 1px solid #ff0000;
413 }
414
415 .bioec_profile-flex-container {
416 display: flex;
417 flex-direction: row;
418 justify-content: space-between;
419 flex-wrap: wrap;
420 }
421
422 .bioec_profile-flex-container .bioec_profile-form-control {
423 width: 50%;
424 padding-right: 1.5rem;
425 }
426
427 .bioec_profile-form-control textarea {
428 font-size: 16px;
429 font-weight: 400;
430 line-height: 24px;
431 color: #5B5C61;
432 width: 100%;
433 background-color: transparent;
434 border-radius: 0;
435 border: 1px solid #BEBEBE;
436 resize: none;
437 outline: none;
438 margin-top: 24px;
439 }
440
441 .bioec_form-picture-container {
442 color: var(--white);
443 background-color: #595A5F;
444 border-radius: 50%;
445 position: relative;
446 display: flex;
447 align-items: center;
448 justify-content: center;
449 padding: 35px;
450 width: 180px;
451 height: 180px;
452 font-size: 100px;
453 background-size: cover;
454 }
455
456 .bioec_form-picture-container[style] > i {
457 display: none;
458 }
459
460 .bioec_form-picture-container button {
461 position: absolute;
462 right: 0;
463 bottom: 0;
464 color: var(--white);
465 background-color: var(--color-3);
466 height: 40px;
467 width: 40px;
468 border-radius: 50%;
469 border: none;
470 outline: none;
471 display: flex;
472 align-items: center;
473 justify-content: center;
474 padding: 0;
475 font-size: 18px
476 }
477
478 .bioec_multi_select {
479 font-size: 16px;
480 font-weight: 400;
481 line-height: 24px;
482 color: #5B5C61;
483 width: 100%;
484 background-color: transparent;
485 border-radius: 0 !important;
486 border: 1px solid #BEBEBE !important;
487 resize: none;
488 outline: none;
489 padding: 12px !important;
490 }
491
492 .bioec_multi_select .select2-selection__choice {
493 background-color: transparent !important;
494 margin-left: 12px !important;
495 margin-top: 0px !important;
496 }
497
498 .modal-header h1{
499 color: #5B5C61;
500 margin-bottom: 0px;
501 font-size: 25px;
502 line-height: 58.5px;
503 font-weight: 400;
504 }
505
506 @media (max-width: 768px) {
507 .bioec_profile-flex-container .bioec_profile-form-control {
508 margin-bottom: 1.5rem;
509 width: 100%;
510 padding-right: 0rem;
511 }
512 }
513</style>
514
515<script>
516
517function deleteOrg() {
518 Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""});
519 fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/profile-management/organization/${_CUSTOM_FIELD_organization.getData()}",
520 {
521 method: "DELETE",
522 headers: {
523 "x-csrf-token": Liferay.authToken,
524 "Content-Type": "application/json",
525 "Accept": "application/json"
526 }
527 })
528 .then( Liferay.Util.openToast({
529 message: "Estamos processando seu arquivo. Favor aguarde por alguns segundos e redireciorameos você automaticamente.",
530 type: "success",
531 title: "",
532 toastProps: {
533 autoClose: 2000
534 }
535 }))
536 .then(setTimeout(() => { window.location.href = Liferay.ThemeDisplay.getPortalURL() + "/meu-perfil#deleteOrg" }, 2000))
537
538
539
540}
541
542
543function submitOrganization() {
544 Liferay.Util.openToast({
545 message: "Enviando requisição",
546 type: "info",
547 title: "",
548 });
549 console.log("submitOrganization");
550 let site = document.getElementById("siteOrganizacao").value;
551 let linkedin = document.getElementById("linkedinOrganizacao").value;
552
553 if (site != "") {
554 if (
555 !site.startsWith("https://") &&
556 !site.startsWith("http://") &&
557 !site.startsWith("https://www") &&
558 !site.startsWith("http://www")
559 ) {
560 Liferay.Util.openToast({
561 message:
562 "O campo 'site' precisa começar com 'https://', 'http://', 'https://www' ou 'http://www' para ser válido",
563 type: "danger",
564 title: "",
565 toastProps: {
566 autoClose: 5000,
567 },
568 });
569 return;
570 }
571 }
572
573 if (linkedin != "") {
574 if (
575 !linkedin.startsWith("https://www.linkedin.com") &&
576 !site.startsWith("http://www.linkedin.com") &&
577 !linkedin.startsWith("https://linkedin.com") &&
578 !site.startsWith("http://linkedin.com")
579 ) {
580 Liferay.Util.openToast({
581 message:
582 "O campo 'linkedin' precisa começar com 'https://www.linkedin.com' ou 'http://www.linkedin.com' com ou sem os 'www.' para ser válido",
583 type: "danger",
584 title: "",
585 toastProps: {
586 autoClose: 5000,
587 },
588 });
589 return;
590 }
591 }
592
593 fetch(
594 Liferay.ThemeDisplay.getPortalURL() +
595 "/o/profile-management/organization/${_CUSTOM_FIELD_organization.getData()}",
596 {
597 method: "PUT",
598 headers: {
599 "x-csrf-token": Liferay.authToken,
600 "Content-Type": "application/json",
601 },
602 body: JSON.stringify({
603 imagem: document.getElementById("inputOrgBase64OrgModal").value,
604 tipo: document.getElementById("tipo-de-organizacao").value,
605 nome: document.getElementById("nomeOrganizacao").value.trim(),
606 cidade: document.getElementById("cidadeOrganizacao").value,
607 estado: document.getElementById("estadoOrganizacao").value,
608 pais: document.getElementById("paisOrganizacao").value,
609 site: document.getElementById("siteOrganizacao").value,
610 linkedin: document.getElementById("linkedinOrganizacao").value,
611 sobre: document.getElementById("sobreOrganizacao").value,
612 setores: $("#setores-de-atuacao").select2("val"),
613 competencias: document.getElementById("competenciasOrganizacao").value,
614 tipodeentidade: document.getElementById("tipodeentidadeOrganizacao")
615 .value,
616 instituicao: document.getElementById("instituicaoOrganizacao").value,
617 }),
618 }
619 )
620 .then(
621 (response) =>
622 new Promise((resolve, reject) => {
623 resolve({
624 status: response.status,
625 ok: response.ok,
626 }).then((r) => console.log(r));
627 reject({}).then((c) => console.log(c));
628 })
629 )
630 .then((res) => {
631 if (res.status == "200") {
632 Liferay.Util.openToast({
633 message: "Perfil alterado com sucesso.",
634 type: "success",
635 title: "",
636 toastProps: {
637 autoClose: 5000,
638 },
639 });
640 location.reload();
641 } else if(res.status == "302"){
642 Liferay.Util.openToast({
643 message: "Cadastre uma organização com SITE diferente.",
644 type: "danger",
645 title: "Site inserido já existe",
646 toastProps: {
647 autoClose: 5000
648 }
649 })
650 } else if(res.status == "409"){
651 Liferay.Util.openToast({
652 message: "Cadastre uma organização com Nome da Organização diferente.",
653 type: "danger",
654 title: "Nome da Organização cadastrada já existe",
655 toastProps: {
656 autoClose: 5000
657 }
658 })
659 }
660 })
661 .catch((e) => console.log(e));
662}
663
664
665</script>
666
667</#if>
Java method "com.sun.proxy.$Proxy136.getOrganization(long)" threw an exception when invoked on com.sun.proxy.$Proxy136 object "com.liferay.portal.service.impl.OrganizationLocalServiceImpl@51e5b32a"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: organization = OrganizationLocalServi... [in template "34764#34807#null" at line 15, column 17] ----
1<#assign
2 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
3 JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")
4/>
5
6<#assign
7 viewerHasPrivileges = false
8 userId = themeDisplay.getUserId()
9/>
10
11<#if userId?? >
12 <#assign
13 orgId = _CUSTOM_FIELD_organization.getData()?number
14 viewerHasPrivileges = OrganizationLocalService.hasUserOrganization(userId, orgId)
15 organization = OrganizationLocalService.getOrganization(orgId)
16 />
17</#if>
18
19
20<#if viewerHasPrivileges || DDMStructure_Field04200031.getData() != "0">
21<#assign
22 organization = OrganizationLocalService.getOrganization(_CUSTOM_FIELD_organization.getData()?number)
23 articleId = organization.getExpandoBridge().getAttribute("journal-article")
24 journalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),articleId?c)
25 articleXml = journalArticle.getDocument().getRootElement()
26
27 setores = articleXml.selectNodes("dynamic-element[@name='Text67772680']")
28/>
29<#else>
30<#assign setores = ["privado"] />
31</#if>
32
33<#assign
34
35 sobre = (viewerHasPrivileges || DDMStructure_Field80037203.getData()!="0")?string(DDMStructure_Text54730891.getData()!"","")
36 competencias = (viewerHasPrivileges || DDMStructure_Field75645729.getData()!="0")?string(DDMStructure_Text51537691.getData()!"","")
37
38>
39
40<div>
41
42 <#if viewerHasPrivileges || DDMStructure_Field80037203.getData()!="0" >
43 <div class="bioec_org_sobre">
44 <label>Sobre a organização</label>
45 <div class="bioec_org_sobre_container">
46 <#if sobre != "">
47 ${sobre}
48 <#else>
49 <div class="bioec_org_sobre_vazio">
50 Nenhuma descrição foi adicionada neste perfil ainda
51 </div>
52 </#if>
53 </div>
54 </div>
55 </#if>
56
57 <#if viewerHasPrivileges || DDMStructure_Field75645729.getData()!="0" >
58 <div class="bioec_org_sobre">
59 <label>Competências tecnológicas</label>
60 <div class="bioec_org_sobre_container">
61 <#if competencias != "">
62 ${competencias}
63 <#else>
64 <div class="bioec_org_sobre_vazio">
65 Nenhuma descrição foi adicionada neste perfil ainda
66 </div>
67 </#if>
68 </div>
69 </div>
70 </#if>
71
72 <#if viewerHasPrivileges || DDMStructure_Field04200031.getData()!="0" >
73 <div class="bioec_org_sobre">
74 <label>Setor(es) de atuação</label>
75 <div class="bioec_org_sobre_container">
76 <#if setores[0]!="privado">
77 <#if setores?size == 1 && setores[0].getStringValue()?trim == "" >
78 <div class="bioec_org_sobre_vazio">
79 Nenhum setor foi adicionado neste perfil ainda
80 </div>
81 <#else>
82 <#if setores?size != 0 >
83 <ul>
84 <#list setores as setor>
85 <li>${setor.getStringValue()}</li>
86 </#list>
87 </ul>
88 <#else>
89 <div class="bioec_org_sobre_vazio">
90 Nenhum setor foi adicionado neste perfil ainda
91 </div>
92 </#if>
93 </#if>
94 <#else>
95 <div class="bioec_org_sobre_vazio">
96 Nenhum setor foi adicionado neste perfil ainda
97 </div>
98 </#if>
99 </div>
100 </div>
101 </#if>
102
103</div>
104
105<style>
106.bioec_org_sobre label {
107 color: #5B5C61;
108 font-weight: 700;
109 margin-bottom: 10px;
110 font-size: 20px;
111 line-height: 30px;
112}
113
114.bioec_org_sobre_container {
115 font-size: 16px;
116 border: 1px solid #BEBEBE;
117 padding: 24px;
118 color: #5B5C61;
119 margin-bottom: 40px;
120}
121
122.bioec_org_sobre_vazio {
123 color: #5B5C61;
124 font-size: 16px;
125 text-align: center;
126 font-weight: 700;
127}
128
129.bioec_org_sobre_container ul {
130 color: #5B5C61;
131 margin: 0;
132}
133</style>
Java method "com.sun.proxy.$Proxy136.getOrganization(long)" threw an exception when invoked on com.sun.proxy.$Proxy136 object "com.liferay.portal.service.impl.OrganizationLocalServiceImpl@51e5b32a"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: organization = OrganizationLocalServi... [in template "34764#34807#null" at line 22, column 9] ----
1<#assign
2 viewerHasPrivileges = false
3 userId = themeDisplay.getUserId()
4/>
5<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
6<#if userId?? >
7 <#assign
8 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
9 />
10 <#assign
11 orgId = _CUSTOM_FIELD_organization.getData()?number
12 viewerHasPrivileges = OrganizationLocalService.hasUserOrganization(userId, orgId)
13 />
14</#if>
15
16<#assign
17 UserLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.UserLocalService")
18/>
19<#assign
20 orgId = _CUSTOM_FIELD_organization.getData()?number
21 users = UserLocalService.getOrganizationUsers(orgId)
22 organization = OrganizationLocalService.getOrganization(orgId)
23 nomeDaOrg = organization.getName()!""
24/>
25
26<div class="bioec_org_admins">
27 <label>Administradores desse perfil</label>
28
29 <#list users as user>
30 <#assign userArticleId = user.getExpandoBridge().getAttribute("journal-article")!"0" >
31
32 <#assign urlWC = "">
33 <#if userArticleId != "0" && userArticleId != "">
34 <#assign userArticle = JournalArticleLocalService.getLatestArticle(themeDisplay.getLayout().getGroupId(), userArticleId?string) >
35 <#assign urlWC = userArticle.getUrlTitle()!"">
36 </#if>
37
38
39 <#assign
40 nome = user.getFullName()
41 />
42 <div class="bioec_org_admin_container">
43 <div class="bioec_org_admin_img_placeholder">
44 <i class="fa-solid fa-user"></i>
45 </div>
46 <div class="bioec_org_admin_content">
47 <b><a style="color: #5B5C61;" href="<#if urlWC != ''>/w/${urlWC}</#if>">${nome}</a></b>
48 Administrador
49 </div>
50 <#if viewerHasPrivileges>
51 <div class="bioec_org_admin_buttons_container">
52 <#if userId != user.getUserId() >
53 <button class="bioec_org_admin_button d-none" data-toggle="modal" data-target="#bioec-admin-modal">
54 <i class="fa-solid fa-pen-to-square"></i>
55 </button>
56 <button class="bioec_org_admin_button" onclick="removeAdminFromOrg(${user.getUserId()})">
57 <i class="fa-solid fa-trash-can"></i>
58 </button>
59 </#if>
60 </div>
61 </#if>
62 </div>
63 </#list>
64
65 <#if viewerHasPrivileges>
66 <div class="bioec_org_flex_end">
67 <#if (1 < users?size)>
68 <button class="bioec_secondary_button mx-3 mb-4 mb-md-0" data-toggle="modal" data-target="#bioec-leave-modal">DEIXAR DE SER ADMINISTRADOR</button>
69 </#if>
70 <button class="bioec_primary_button bioec_modal-adicionar" data-toggle="modal" data-target="#bioec-admin-modal">ADICIONAR ADMINISTRADOR</button>
71 </div>
72
73 <#-- MODAL DE ADICIONAR ADMINISTRADOR -->
74 <div id="bioec-admin-modal" class="modal fade" style="display: none;" role="dialog" aria-hidden="true">
75 <div class="modal-dialog modal-lg" role="document">
76 <div class="modal-content">
77 <div class="py-3 px-4 d-flex justify-content-between bioec_modal-line">
78 <div class="bioec_modal-title">Adicionar administrador</div>
79 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
80 <i class="fa-solid fa-xmark"></i>
81 </button>
82 </div>
83 <div class="bioec_modal-form">
84 <div class="py-3 px-4 bioec_modal-line">
85 <h1>${title.getData()}</h1>
86 <div class="bioec_modal-form-control">
87 <label>E-mail do administrador</label>
88 <input id="admin-email" type="text" placeholder="Digite aqui" value="" >
89 </div>
90 <div class="bioec_modal-form-control d-none">
91 <label>Cargo/Função</label>
92 <input id="admin-role" type="text" placeholder="Digite aqui" value="" >
93 </div>
94 </div>
95 <div class="py-3 px-4 d-flex justify-content-end">
96 <button type="button" class="bioec_secondary_button mx-3" data-dismiss="modal">CANCELAR</button>
97 <button type="button" class="bioec_primary_button" onclick="addAdminToOrg()">CONTINUAR</button>
98 </div>
99 </div>
100 </div>
101 </div>
102 </div>
103
104 <#-- MODAL DE DEIXAR ORGANIZAÇÃO -->
105 <div id="bioec-leave-modal" class="modal fade" style="display: none;" role="dialog" aria-hidden="true">
106 <div class="modal-dialog modal-lg" role="document">
107 <div class="modal-content px-4 py-4">
108 <div class="d-flex justify-content-between">
109 <h5 class="modal-title">Deixar de ser administrador</h5>
110 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
111 <span aria-hidden="true">×</span>
112 </button>
113 </div>
114 <div class="my-3">
115 <div class="mb-3">
116 ${title.getData()}
117 </div>
118 Ao clicar em continuar, a organização será removida do seu perfil. Caso possua outros administradores, ela continuará nos perfis desses usuários.
119 </div>
120 <div class="d-flex justify-content-end">
121 <button type="button" class="bioec_secondary_button mx-3" data-dismiss="modal">CANCELAR</button>
122 <button type="button" class="bioec_primary_button" onclick="quitOrganization()" >CONTINUAR</button>
123 </div>
124 </div>
125 </div>
126 </div>
127
128 </#if>
129</div>
130
131<script>
132
133$(document).ready(() => {
134 let urlSearchParams = new URLSearchParams(window.location.search);
135
136 if( urlSearchParams.has('popup_adicionar_admin') == 1){
137 $('.bioec_modal-adicionar').click();
138 urlSearchParams.delete("popup_adicionar_admin");
139 if (history.replaceState) {
140 let searchString = urlSearchParams.toString().length > 0 ? '?' + urlSearchParams.toString() : '';
141 let newUrl = window.location.protocol + "//" + window.location.host + window.location.pathname + searchString + window.location.hash;
142 history.replaceState(null, '', newUrl);
143 }
144 }
145});
146
147
148
149
150function quitOrganization() {
151 const url = Liferay.ThemeDisplay.getPortalURL() + "/o/profile-management/organization/${_CUSTOM_FIELD_organization.getData()}/user/" + ${userId}
152 fetch(url, {
153 method: 'DELETE',
154 "headers": {
155 "x-csrf-token": Liferay.authToken,
156 "Content-Type": "application/json"
157 }
158 })
159 .then(res => {
160 if(res.status == "200"){
161 Liferay.Util.openToast({
162 message: "Você deixou de ser Administrador",
163 type: "success",
164 title: "",
165 toastProps: {
166 autoClose: 5000
167 }
168 })
169 location.reload();
170 } else {throw "err";}
171 })
172 .catch(() => showErrorToast("Não foi possível adicionar o administrador. Verifique o email e tente novamente"))
173}
174
175function removeAdminFromOrg(userId) {
176 console.log(userId)
177 if(userId) {
178 const url = Liferay.ThemeDisplay.getPortalURL() + "/o/profile-management/organization/${_CUSTOM_FIELD_organization.getData()}/user/" + userId
179 fetch(url, {
180 method: 'DELETE',
181 "headers": {
182 "x-csrf-token": Liferay.authToken,
183 "Content-Type": "application/json"
184 }
185 })
186 .then(res => {
187 if(res.status == "200"){
188 Liferay.Util.openToast({
189 message: "Administrador deletado com sucesso.",
190 type: "success",
191 title: "",
192 toastProps: {
193 autoClose: 5000
194 }
195 })
196 location.reload();
197 } else {throw "err";}
198 })
199 .catch(() => showErrorToast("Não foi possível adicionar o administrador. Verifique o email e tente novamente"))
200 }
201}
202
203function addAdminToOrg() {
204 const userEmail = document.getElementById("admin-email").value
205 console.log(userEmail)
206 if(userEmail) {
207 const url = Liferay.ThemeDisplay.getPortalURL() + "/o/profile-management/organization/${_CUSTOM_FIELD_organization.getData()}/user/" + userEmail
208 fetch(url, {
209 method: 'POST',
210 "headers": {
211 "x-csrf-token": Liferay.authToken,
212 "Content-Type": "application/json"
213 }
214 })
215 .then(res => {
216 if(res.status == "200"){
217 Liferay.Util.openToast({
218 message: "Administrador adicionado com sucesso.",
219 type: "success",
220 title: "",
221 toastProps: {
222 autoClose: 5000
223 }
224 })
225 location.reload();
226 gtag('event', 'admnistrador_registrado', {
227 "orgName" : "${nomeDaOrg}"
228 });
229 } else {throw "err";}
230 })
231 .catch(() => showErrorToast("Não foi possível adicionar o administrador. Verifique o email e tente novamente"))
232 }
233}
234
235const showErrorToast = message => {
236 Liferay.Util.openToast({
237 message,
238 type: "danger",
239 title: "",
240 toastProps: {
241 autoClose: 5000,
242 style: { top: 0 },
243 }
244 })
245 }
246
247</script>
248
249<style>
250 .bioec_org_admins {
251 margin-bottom: 40px;
252 }
253
254 .bioec_org_admins label {
255 color: #5B5C61;
256 font-weight: 700;
257 margin-bottom: 10px;
258 font-size: 20px;
259 line-height: 30px;
260 }
261
262 .bioec_org_admin_container {
263 border: 1px solid #BEBEBE;
264 padding: 24px;
265 margin-bottom: 25px;
266 display: flex;
267 flex-direction: row;
268 align-items: center;
269 }
270
271 .bioec_org_flex_end {
272 display: flex;
273 flex-direction: row;
274 align-items: center;
275 justify-content: end;
276 }
277
278 .bioec_org_admin_img_placeholder {
279 align-self: center;
280 height: 48px;
281 width: 48px;
282 background-color: #595A5F;
283 border-radius: 50%;
284 display: flex;
285 align-items: center;
286 justify-content: center;
287 color: var(--white-1);
288 font-size: 28px;
289 }
290
291 .bioec_org_admin_content {
292 font-size: 16px;
293 color: #5B5C61;
294 flex: 1;
295 margin: 0 12px;
296 }
297
298 .bioec_org_admin_content b {
299 display: block;
300 }
301
302 .bioec_org_admin_button {
303 color: var(--white-1);
304 background-color: #595A5F;
305 border-radius: 8px;
306 border: none;
307 outline: none;
308 width: 34px;
309 height: 34px;
310 font-size: 16px;
311 padding: 0px;
312 margin-left: 12px;
313 }
314
315 .bioec_org_admin_buttons_container {
316 display: flex;
317 flex-direction: row;
318 }
319
320 .bioec_modal-title {
321 font-weight: 700;
322 font-size: 20px;
323 color: #5B5C61;
324 }
325
326 .bioec_modal-line {
327 border-bottom: 1px solid #E8ECEF;
328 }
329
330 .bioec_modal-form h1 {
331 font-weight: 400;
332 font-size: 24px;
333 line-height: 150%;
334 color: #5B5C61;
335 margin-bottom: 40px;
336 }
337
338 .bioec_modal-form-control {
339 margin-bottom: 24px;
340 }
341
342 .bioec_modal-form-control label {
343 color: #5B5C61;
344 font-size: 20px;
345 font-weight: 700;
346 line-height: 30px;
347 margin-bottom: 8px;
348 }
349
350 .bioec_modal-form-control label[required]::before {
351 content: "*";
352 color: #ff0000;
353 margin-right: 0.4rem;
354 }
355
356 .bioec_modal-form-control input {
357 border-radius: 0;
358 outline: none;
359 border: none;
360 border-bottom: 1px solid #BEBEBE;
361 font-size: 16px;
362 font-weight: 400;
363 line-height: 24px;
364 color: #5B5C61;
365 width: 100%;
366 background-color: transparent;
367 padding: 2px;
368 margin: 0;
369 }
370
371 @media (max-width: 767px) {
372 .bioec_org_admin_buttons_container {
373 flex-direction: column;
374 }
375 .bioec_org_admin_button {
376 margin-bottom: 12px;
377 }
378 .bioec_org_flex_end {
379 flex-direction: column;
380 align-items: center;
381 }
382 }
383</style>
SpeedVac Concentrator
Modelo: DNA 120
Marca: Thermo Scientific
Função
O SpeedVac Concentrator é um equipamento que seca ou concentra a amostra com auxílio de vácuo e temperatura.
Shaker Com Stick Stuff
Modelo: .
Marca: Infors HT
Função
Incubadora com agitação usada para cultivo de micro-organismos e culturas de células em ambiente controlado. O equipamento conta com uma porta dobrável que se abre para a frente e facilita o carregamento, possue controle de velocidade e agitação, ambiente anerobico para cultivo microbiano, e o agitador de incubação garante condições homogêneas e fornece resultados reproduzíveis . Além disso conta com a tecnologia Stick Stuff (Green Sticky Stuff) um material adesivo para flexibilidade máxima de frascos e portadores de tamanhos diferentes.
Termociclador
Modelo: .
Marca: .
Função
Os Termocicladores são equipamentos usados em Biologia Molecular que permitem realizar os ciclos de temperaturas necessários para uma reação em cadeia da polimerização ou amplificação de DNA. No laboratório de Biotecnologia do ISI contamos com termocicladores com blocos de 96 poços, 2 x 96 poços e 3 x 32 poços com resistência elétrica e faixas de temperatura programáveis incluindo a tampa aquecida para evitar a condensação de água nas tampas dos tubos onde ocorre a reação, e função de gradiente, que permite diferentes temperaturas nas distintas partes do bloco. Aplicações: Laboratórios de pesquisa e análises químicas.
Termociclador
Modelo: QuantStudio
Marca: Life Technologies
Função
O PCR Real Time (ou qPCR, quantitative polymerase chain reaction) é um equipamento utilizado para a quantificação e detecção de ácidos nucleicos. O PCR Real Time baseia-se na detecção da fluorescência emitida por uma molécula repórter que aumenta à medida que a reação avança. O aumento da fluorescência ocorre devido ao acúmulo do produto de PCR (fragmento alvo) a cada ciclo de amplificação. Pode-se detectar quantidades extremamente mínimas de ácido nucleico do patógeno investigado e quantificar o produto final com precisão. Além disso, não há necessidade do processamento pós-PCR, como ocorre no PCR convencional, fator esse que evita contaminação e economiza recursos e tempo. Os testes de PCR Real Time são fáceis de executar, apresentam sensibilidade e especificidade bastante elevadas, e fornecem escopo para automação. Aplicações: Pesquisas Médicas, vigilância epidemiológica em saúde pública ; Detecção de agentes patogênicos ; Clonagem molecular, triagem genética, mapeamento genético, expressão gênica, genotipagem ; Detecção de OGM, segurança alimentar e outras aplicações em indústrias e laboratórios.
The following has evaluated to null or missing: ==> autorId [in template "34764#34807#41127" at line 71, column 46] ---- 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: #if autorId != "" && autorId?? [in template "34764#34807#41127" at line 71, column 41] ----
1<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
2<#assign UserLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.UserLocalService")>
3<#assign AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")>
4<#assign
5mbMessageLocalService = serviceLocator.findService("com.liferay.message.boards.service.MBMessageLocalService")
6 tagsLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetTagLocalService")
7 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
8>
9
10
11<div class="bioec-profile-demanda-main">
12 <div id="demanda-lista-container" class="d-flex flex-column">
13 <#if entries?has_content>
14 <#list entries as entry>
15 <#assign journalArticle = JournalArticleLocalService.getLatestArticle(entry.getClassPK()) >
16 <#assign JournalArticleID = journalArticle.getId()>
17 <#assign JournalArticleFrontId = journalArticle.getArticleId()>
18 <#assign articleXml = journalArticle.getDocument().getRootElement()
19 userIsAdmin = false
20 orgId = ""
21 >
22
23 <#assign nomeParaContato = "">
24
25 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text77253735']")??>
26
27 <#assign nomeParaContato = articleXml.selectSingleNode("dynamic-element[@field-reference='Text77253735']").getStringValue()!""
28 nomeParaContato = nomeParaContato?replace("\n\t\t", "")
29 nomeParaContato = nomeParaContato?replace("\n\t", "")
30 >
31
32 </#if>
33 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text94974146']")??>
34 <#assign telefone = articleXml.selectSingleNode("dynamic-element[@field-reference='Text94974146']").getStringValue()!""
35 telefone = telefone?replace("\n\t\t", "")
36 telefone = telefone?replace("\n\t", "")
37 >
38 </#if>
39
40 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text68569631']")??>
41 <#assign email = articleXml.selectSingleNode("dynamic-element[@field-reference='Text68569631']").getStringValue()!""
42 email = email?replace("\n\t\t", "")
43 email = email?replace("\n\t", "")
44 >
45 </#if>
46
47 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='CopyOfCopyOfText18267936']")??>
48 <#assign desc = articleXml.selectSingleNode("dynamic-element[@field-reference='CopyOfCopyOfText18267936']").getStringValue()!""
49 desc = desc?replace("\n\t\t", "")
50 desc = desc?replace("\n\t", "")
51 >
52 </#if>
53 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text97565506']")??>
54 <#assign imagem = articleXml.selectSingleNode("dynamic-element[@field-reference='Text97565506']").getStringValue()!""
55 imagem = imagem?replace("(\r\n)+", "",'r')
56 imagem = imagem?replace(" ", "",'r')
57 >
58 </#if>
59 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text99746569']")??>
60 <#assign
61 autorId = articleXml.selectSingleNode("dynamic-element[@field-reference='Text99746569']").getStringValue()!""
62 autorId = autorId?replace("\n\t\t", "")
63 autorId = autorId?replace("\n\t", "")
64 autorArticleId = ""
65 >
66 </#if>
67 <#assign
68 commentsCount = mbMessageLocalService.getDiscussionMessagesCount(entry.getClassName(), entry.getClassPK(), 0)!"0"
69 >
70
71 <#if autorId != "" && autorId??>
72 <#assign
73 autor = UserLocalService.fetchUser(autorId?number)!""
74 autorArticleId = autor.getExpandoBridge().getAttribute("journal-article")!"0"
75 />
76 <#if autor != "">
77 <#assign autor = autor.getFullName()!"">
78 <#else>
79 <#assign autor = "Anônimo" >
80 </#if>
81 <#else>
82 <#assign autor = "Anônimo" >
83 </#if>
84 <#assign categorias = AssetCategoryLocalService.getCategoryNames(entry.getClassName(), entry.getClassPK())!"" >
85 <#assign urlWC = "">
86 <#if autorArticleId != "0" && autorArticleId != "" && autor != "Anônimo">
87 <#assign autorArticle = JournalArticleLocalService.getLatestArticle(themeDisplay.getLayout().getGroupId(), autorArticleId?string) >
88 <#assign urlWC = autorArticle.getUrlTitle()!"">
89 </#if>
90
91 <#assign tags = tagsLocalService.getTagNames("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()?number )
92 tagName = tags[0]!""
93 orgOrUser = ""
94 >
95
96 <#if tagName?contains("organization") && tagName != "" >
97 <#assign orgOrUser = "org">
98 <#else>
99 <#assign orgOrUser = "user">
100 </#if>
101
102 <#if orgOrUser == "org" >
103
104 <#assign
105 orgId = tagName?keep_after("organization-")
106 organization = OrganizationLocalService.fetchOrganization(orgId?number)!""
107 >
108
109
110 <#if organization != "" && autor != "Anônimo">
111
112 <#assign orgArticleId = organization.getExpandoBridge().getAttribute("journal-article")
113 orgJournalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),orgArticleId?c)
114 urlWC = orgJournalArticle.getUrlTitle()!""
115 autor = organization.getName()!""
116 >
117
118 </#if>
119 </#if>
120
121 <#if themeDisplay.isSignedIn() >
122 <#if tagName?contains("organization-")>
123 <#assign userIsAdmin = OrganizationLocalService.hasUserOrganization(themeDisplay.getUserId(), orgId?number)>
124 <#else>
125 <#if autorId?number == themeDisplay.getUserId()>
126 <script>console.log("oi");</script>
127 <#assign userIsAdmin = true>
128 </#if>
129 </#if>
130
131
132 </#if>
133
134
135
136 <div class="demanda-lista-item">
137
138 <div class="lista-checkmark">
139 <#if categorias?seq_contains("aprovado") > <i title="Aprovado" style="color: #4ECD66" class="fa-solid fa-circle-check"></i> </#if>
140 <#if categorias?seq_contains("pendente") > <i title="Em análise" style="color: #D90000"class="fa-solid fa-spinner"></i> </#if>
141 <#if categorias?seq_contains("recusado") > <i title="Recusado" style="color: #D90000"class="fa-solid fa-exclamation-circle"></i> </#if>
142 </div>
143
144
145 <div class="lista-titulo">
146 <h5>${entry.getHighlightedTitle()}</h5>
147 </div>
148
149 <div class="lista-arrow">
150 <button style="padding: 0;" class="btn" type="button" data-toggle="collapse" data-target="#collapseID${entry.getClassPK()}" aria-expanded="false" aria-controls="collapseID${entry.getClassPK()}">
151 <i class="fa-solid fa-chevron-down"></i>
152 </button>
153 </div>
154
155 <div class="lista-desc">
156 <p>${desc}</p>
157 </div>
158
159 <div class="lista-collapse collapse" id="collapseID${entry.getClassPK()}">
160 <#if nomeParaContato != "" || telefone != "" || email != "" || imagem?trim !="">
161 <div class="lista-details">
162 <div class="lista-pic">
163 <i class="fa-solid fa-image-slash"></i>
164 <#if imagem?trim !="" >
165 <img class="bioec_demanda_img" src="${imagem}">
166 <#else>
167 <div class="bioec_demanda_img_placeholder">
168 <i class="fa-solid fa-image"></i>
169 sem imagem
170 </div>
171 </#if>
172 </div>
173 <#if nomeParaContato != "" || telefone != "" || email != "" >
174 <div class="lista-contato">
175 <p>Contato</p>
176 <p class="lista-author">${nomeParaContato}</p>
177 <p class="lista-phone">${telefone}</p>
178 <p class="lista-email">${email}</p>
179 </div>
180 </#if>
181 </div>
182 </#if>
183
184 <#if categorias?seq_contains("recusado") >
185 <div style="border-top: 1px solid #E8ECEF; font-weight: bold; padding-top: 24px;">
186 <p>Conteúdo Em Análise Pelo Cetiqt:</p>
187 <p>Conteúdo recusado pelo CETIQT por violar as políticas de privacidade.</p>
188 </div>
189 </#if>
190 <div class="lista-footnote">
191 <div>
192 <span class="lista-date">${journalArticle.getDisplayDate()?string('dd/MM/yyyy')}</span> | <span class="lista-commentNumber">${commentsCount} cometários</span> <span class="barra-pipe"> | </span> <span class="lista-author">Publicado por <a <#if urlWC != ''>href="/w/${urlWC}</#if>">${autor}</a></span>
193 </div>
194 <#if userIsAdmin>
195 <div class="buttonsActions">
196 <div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modalDemanda${JournalArticleID}">
197 <i class="fa-solid fa-edit"></i>
198 </div>
199 <div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modal-demanda-${entry.getClassPK()}">
200 <i class="fa-solid fa-trash-can"></i>
201 </div>
202
203 </div>
204 </#if>
205 </div>
206 </div>
207 </div>
208
209 <#if userIsAdmin>
210 <div style="display: none;" id="modal-demanda-${entry.getClassPK()}" class="modal fade" role="dialog">
211 <div class="modal-dialog modal-lg" role="document">
212 <div class="modal-content">
213 <div class="modal-header" >
214 <h4 class="m-0">Remover Demanda</h4>
215 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
216 <span aria-hidden="true">
217 <i class="fa-solid fa-close"></i>
218 </span>
219 </button>
220 </div>
221 <div class="modal-body">
222 <h5>Você tem certeza que deseja remover essa demanda?</h5>
223 <div>
224 Ao clicar em continuar, a demanda será removida do seu perfil.
225 </div>
226 </div>
227 <div class="modal-footer justify-content-end">
228 <button class="bioec_secondary_button" data-dismiss="modal">CANCELAR</button>
229 <button class="bioec_primary_button" type="button" onclick="excluirDemanda(${JournalArticleFrontId}, ${orgId})">CONTINUAR</button>
230 </div>
231 </div>
232 </div>
233 </div>
234
235 <#-- modal edição -->
236
237
238 <div style="display: none;" id="modalDemanda${JournalArticleID}" class="modal fade bioec-profile-demanda-modal modalDemanda" role="dialog">
239 <div class="modal-dialog modal-lg" role="document">
240 <form id="formularioDemanda${JournalArticleID}" class="form-group modal-content formularioDemanda">
241 <div id="demandaModal-l1${JournalArticleID}" class="modal-header demandaModal-l1">
242 <h5>Adicionar demanda</h5>
243 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
244 <span aria-hidden="true">×</span>
245 </button>
246 </div>
247 <div id="demandaModal-l2${JournalArticleID}" class="modal-body demandaModal-l2">
248 <div id="demandaTitle${JournalArticleID}" class="demandaTitle">
249 <label class="ReqLabel" for="demandaInputTitle${JournalArticleID}">Título da demanda</label>
250 <input id="demandaInputTitle${JournalArticleID}" value="${entry.getHighlightedTitle()}" type="text" placeholder="Inserir um título" required>
251 </div>
252 <div id="demandaName${JournalArticleID}" class="demandaName">
253 <label class="" for="demandaInputName${JournalArticleID}">Nome para contato</label>
254 <input value="${nomeParaContato}" id="demandaInputName${JournalArticleID}" placeholder="Inserir nome" type="text">
255 </div>
256 <div id="demandaTelephone${JournalArticleID}" class="demandaTelephone">
257 <label class="" for="demandaInputPhone${JournalArticleID}">Telefone para contato</label>
258 <input value="${telefone}" id="demandaInputPhone${JournalArticleID}" name="demandaInputPhone" type="text" placeholder ='(__)_____-_____' minlength="14" />
259 </div>
260 <div id="demandaEmail${JournalArticleID}" class="demandaEmail">
261 <label class="" for="demandaInputEmail${JournalArticleID}">E-mail para contato</label>
262 <input value="${email}" id="demandaInputEmail${JournalArticleID}" placeholder="Inserir e-mail" type="text">
263 </div>
264 <div id="demandaDesc${JournalArticleID}" class="demandaDesc">
265 <label class="ReqLabel" for="demandaInputDesc${JournalArticleID}">Descrição</label>
266 <textarea id="demandaInputDesc${JournalArticleID}" style="max-width: 100%;font-size: 16px;height: 80px;border: 1px solid #BEBEBE;" required>${desc}</textarea>
267 </div>
268 <div id="demandaImg${JournalArticleID}" class="demandaImg">
269 <div style="display: flex; flex-direction: column; gap: 8px">
270 <label>Imagem da demanda (Máx. 10 MB)</label>
271 <label class="btn carregarImagem" id="carregarImagem${JournalArticleID}" for="inputCarregarImagemDemanda${JournalArticleID}" style="font-size: 16px; cursor: pointer;">CARREGAR IMAGEM</label>
272 <input class="inputCarregarImagemDemanda" id="inputCarregarImagemDemanda${JournalArticleID}" type="file" accept="image/*" onchange="encodeDemandaImageAsURL${JournalArticleID}(this)">
273 <input class="d-none" id="inputDemandaBase64${JournalArticleID}" value="${imagem}" />
274 <div class="imagemCarregadaDemanda imagemCarregadaDemanda${JournalArticleID} d-md-none d-block" style="background-image: url(${imagem})"></div>
275 <button type="button" id="removerImagemDemanda${JournalArticleID}" class="<#if imagem == "" || imagem?? == false> d-none </#if> removerImagemDemanda" >
276 <i class="fa fa-trash"></i> Remover imagem
277 </button>
278 </div>
279 <div class="imagemCarregadaDemanda imagemCarregadaDemanda${JournalArticleID} d-md-block d-none" style="background-image: url(${imagem})"></div>
280 </div>
281 </div>
282 <div class="TextImportant">
283 <p>
284 Importante: O conteúdo enviado passará por um processo interno de aprovação. Só então o conteúdo adicionado aparecerá no portal.
285 </p>
286 </div>
287
288 <div id="demandaModal-l3${JournalArticleID}" class="modal-footer demandaModal-l3">
289 <button class="btn button-empty" onclick="" id="demandas-saveAndClose${JournalArticleID}">SALVAR E FECHAR</button>
290 </div>
291 </form>
292 </div>
293 </div>
294
295 </#if>
296 <#--
297
298
299
300
301 <div style="display: none;" id="modalInfra${JournalArticleID}" class="modal fade bioec-profile-infra-modal" role="dialog">
302 <div class="modal-dialog modal-lg" role="document">
303
304 <form class="form-group modal-content" id="formularioInfraestrutura${JournalArticleID}">
305 <div id="infraModal-l1-${JournalArticleID}" class="modal-header infraModal-l1" >
306 <h5>Adicionar Infraestrutura</h5>
307 <button id="fecharModal${JournalArticleID}" type="button" class="close" data-dismiss="modal" aria-label="Close">
308 <span aria-hidden="true">×</span>
309 </button>
310 </div>
311 <div id="infraModal-l2-${JournalArticleID}" class="modal-body infraModal-l2">
312 <div id="infraName${JournalArticleID}" class="infraName">
313 <label class="ReqLabel" for="inputInfraName${JournalArticleID}">Nome da infraestrutura</label>
314 <input type="text" id="inputInfraName${JournalArticleID}" value="${entry.getHighlightedTitle()}" placeholder="Nome da infraestrutura" required>
315 </div>
316 <div id="infraModel${JournalArticleID}" class="infraModel">
317 <label class="ReqLabel" for="inputInfraModel${JournalArticleID}">Modelo</label>
318 <input type="text" id="inputInfraModel${JournalArticleID}" value="${modelo}" placeholder="Modelo" required>
319 </div>
320 <div id="infraBrand${JournalArticleID}" class="infraBrand">
321 <label class="ReqLabel" for="inputInfraBrand${JournalArticleID}">Marca</label>
322 <input type="text" id="inputInfraBrand${JournalArticleID}" value="${marca}" placeholder="Marca" required>
323 </div>
324
325 <div id="infraImg${JournalArticleID}" class="infraImg">
326 <div style="display: flex; flex-direction: column; gap: 8px">
327 <label>Imagem da infraestrutura (Máx. 10 MB)</label>
328 <label class="bioec_secondary_button" id="carregarImagem${JournalArticleID}" for="inputCarregarImagemInfra${JournalArticleID}" style="font-size: 16px;color: #333244;align-self:start;">
329 CARREGAR IMAGEM
330 </label>
331 <input id="inputCarregarImagemInfra${JournalArticleID}" class="inputCarregarImagemInfra" type="file" accept="image/*" onchange="encodeInfraImageAsURL${JournalArticleID}(this)">
332 <input class="d-none" id="inputInfraBase64${JournalArticleID}" />
333 <div class="imagemCarregadaInfra${JournalArticleID} d-md-none d-block"></div>
334 <button type="button" id="removerImagemInfra${JournalArticleID}" class="d-none removerImagemInfra" >
335 <i class="fa fa-trash"></i> Remover imagem
336 </button>
337 </div>
338 <div class="imagemCarregadaInfra${JournalArticleID} d-md-block d-none"></div>
339 </div>
340
341 <div id="infraFunction${JournalArticleID}" class="infraFunction">
342 <label class="ReqLabel" for="inputInfraFunction${JournalArticleID}">Função</label>
343 <input type="text" id="inputInfraFunction${JournalArticleID}" class="inputInfraFunction" value="${funcao}" placeholder="Função" required>
344 </div>
345 </div>
346 <div class="TextImportant">
347 <p>
348 Importante: O conteúdo enviado passará por um processo interno de aprovação. Só então o conteúdo adicionado aparecerá no portal.
349 </p>
350 </div>
351 <div id="infraModal-l3-${JournalArticleID}" class="modal-footer infraModal-l3">
352 <button class="bioec_secondary_button" id="demandas-saveAndClose${JournalArticleID}" onclick="">SALVAR E FECHAR</button>
353 </div>
354 </form>
355
356 </div>
357
358
359 -->
360
361
362
363 <script>
364 <#if userIsAdmin>
365 function excluirDemanda(wcId, orgId) {
366 Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""});
367 fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/demanda/" + wcId, {
368 method: 'DELETE',
369 "headers": {
370 "x-csrf-token": Liferay.authToken,
371 "Content-Type": "application/json"
372 }
373 })
374 .then(res => {
375 if(res.status == 200) {
376 Liferay.Util.openToast({
377 message: "Infraestrutura excluida com sucesso",
378 type: "success",
379 title: "",
380 toastProps: {
381 autoClose: 5000
382 }
383 })
384 setTimeout(function(){ location.reload(); }, 2000)
385 } else {
386 Liferay.Util.openToast({
387 message: "Erro ao excluir infraestrutura",
388 type: "danger",
389 title: "",
390 toastProps: {
391 autoClose: 5000
392 }
393 })
394 }
395 });
396 }
397
398
399
400
401 function validImageSize(base64="") {
402 const decoded = atob(base64.substring(base64.indexOf(',') + 1));
403 const sizeMB = decoded.length / 1e+6;
404 console.log("MB: " + decoded.length / 1e+6);
405 if(sizeMB > 10) {
406 Liferay.Util.openToast({
407 message: "O tamanho da imagem não deve ultrapassar 10 MB.",
408 type: "danger",
409 title: "",
410 toastProps: {
411 autoClose: 5000
412 }
413 })
414 return false
415 }
416 return true
417 }
418
419 function encodeDemandaImageAsURL${JournalArticleID}(element) {
420 let file = element.files[0];
421 let reader = new FileReader();
422 reader.onloadend = () => {
423 if(reader.result) {
424 if(!validImageSize(reader.result)) return;
425 try {
426 const base64_input = document.getElementById("inputDemandaBase64${JournalArticleID}")
427 base64_input.value = reader.result
428 Array.from(document.getElementsByClassName("imagemCarregadaDemanda${JournalArticleID}")).forEach( el => el.style.backgroundImage = 'url(' + reader.result + ')' )
429
430 const removeImageButton = document.getElementById("removerImagemDemanda${JournalArticleID}")
431 removeImageButton.classList.remove("d-none")
432 } catch (error) {
433 console.error(error)
434 }
435 }
436 }
437 reader.readAsDataURL(file);
438 }
439
440 function removeImageDemanda${JournalArticleID}() {
441 try {
442 const file_input = document.getElementById("inputCarregarImagemDemanda${JournalArticleID}")
443 Array.from(document.getElementsByClassName("imagemCarregadaDemanda${JournalArticleID}")).forEach( el => el.style.backgroundImage = "" )
444 const base64_input = document.getElementById("inputDemandaBase64${JournalArticleID}")
445 file_input.value = null
446 base64_input.value = ""
447
448 const removeImageButton = document.getElementById("removerImagemDemanda${JournalArticleID}")
449 removeImageButton.classList.add("d-none")
450 } catch (error) {
451 console.error(error)
452 }
453}
454
455
456document.getElementById("removerImagemDemanda${JournalArticleID}").addEventListener("click", removeImageDemanda${JournalArticleID});
457
458<#-- Rest da edição de organização -->
459
460<#if orgOrUser == "org">
461document.querySelector('#formularioDemanda${JournalArticleID}').addEventListener('submit', event => {
462 event.preventDefault();
463 adicionarDemanda${JournalArticleID}();
464});
465
466function adicionarDemanda${JournalArticleID}() {
467 Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""});
468 $("#demandas-saveAndClose${JournalArticleID}").prop("disabled",true);
469
470
471
472 const demandaData = {
473 titulo: document.getElementById("demandaInputTitle${JournalArticleID}").value,
474 nomeContato: document.getElementById("demandaInputName${JournalArticleID}").value,
475 telefoneContato: document.getElementById("demandaInputPhone${JournalArticleID}").value,
476 emailContato: document.getElementById("demandaInputEmail${JournalArticleID}").value,
477 descricao: document.getElementById("demandaInputDesc${JournalArticleID}").value,
478 imagem: document.getElementById("inputDemandaBase64${JournalArticleID}").value,
479 }
480
481 console.log(demandaData);
482
483 fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/demanda/${JournalArticleFrontId}", {
484 method: 'PUT',
485 "headers": {
486 "x-csrf-token": Liferay.authToken,
487 "Content-Type": "application/json"
488 },
489 body: JSON.stringify(demandaData)
490 })
491 .then(res => {
492 if(res.status == 200) {
493 Liferay.Util.openToast({
494 message: "Demanda editada com sucesso. Após a submissão, será iniciado o processo interno de aprovação do conteúdo enviado. Só então o conteúdo submetido aparecerá no portal.",
495 type: "success",
496 title: "",
497 toastProps: {
498 autoClose: 5000
499 }
500 })
501 setTimeout(function(){ location.reload(); }, 2000);
502 } else {
503 $("#demandas-saveAndClose${JournalArticleID}").prop("disabled",false);
504 Liferay.Util.openToast({
505 message: "Erro ao editada demanda",
506 type: "danger",
507 title: "",
508 toastProps: {
509 autoClose: 5000
510 }
511 })
512 }
513 })
514
515 }
516</#if>
517
518<#-- Rest da edição de pessoa fisica -->
519
520
521 <#if orgOrUser == "user">
522
523 document.querySelector('#formularioDemanda${JournalArticleID}').addEventListener('submit', event => {
524 event.preventDefault();
525 adicionarDemanda${JournalArticleID}();
526 });
527
528 function adicionarDemanda${JournalArticleID}() {
529 Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""});
530 $("#demandas-saveAndClose${JournalArticleID}").prop("disabled",true);
531
532 const demandaData = {
533 titulo: document.getElementById("demandaInputTitle${JournalArticleID}").value,
534 nomeContato: document.getElementById("demandaInputName${JournalArticleID}").value,
535 telefoneContato: document.getElementById("demandaInputPhone${JournalArticleID}").value,
536 emailContato: document.getElementById("demandaInputEmail${JournalArticleID}").value,
537 descricao: document.getElementById("demandaInputDesc${JournalArticleID}").value,
538 imagem: document.getElementById("inputDemandaBase64${JournalArticleID}").value,
539 }
540
541 console.log(demandaData);
542
543 fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/demanda/${JournalArticleFrontId}", {
544 method: 'PUT',
545 "headers": {
546 "x-csrf-token": Liferay.authToken,
547 "Content-Type": "application/json"
548 },
549 body: JSON.stringify(demandaData)
550 })
551 .then( res => {
552 if(res.status == 200) {
553 Liferay.Util.openToast({
554 message: "Demanda editada com sucesso. Após a submissão, será iniciado o processo interno de aprovação do conteúdo enviado. Só então o conteúdo submetido aparecerá no portal.",
555 type: "success",
556 title: "",
557 toastProps: {
558 autoClose: 5000
559 }
560 })
561 setTimeout(function(){ location.reload(); }, 2000);
562 } else {
563 $("#demandas-saveAndClose${JournalArticleID}").prop("disabled",false);
564 Liferay.Util.openToast({
565 message: "Erro ao editar Demanda",
566 type: "danger",
567 title: "",
568 toastProps: {
569 autoClose: 5000
570 }
571 })
572 }
573 });
574
575 };
576
577
578 </#if>
579
580
581 </#if>
582 </script>
583
584
585
586
587 </#list>
588 </#if>
589 </div>
590</div>
591
592<style>
593.bioec_demanda_img {
594 overflow: hidden;
595 background-size: contain;
596 background-position: center;
597 background-repeat: no-repeat;
598}
599
600.bioec_demanda_img_placeholder {
601 width: 140px;
602 height: 140px;
603 background-color: #E8ECEF;
604 display: flex;
605 flex-direction: column;
606 align-items: center;
607 justify-content: center;
608 font-size: 14px;
609 color: #5B5C61;
610}
611
612.bioec_demanda_img_placeholder i {
613 font-size: 44px;
614}
615
616
617.pagination-items-per-page.active > a,
618.pagination-items-per-page.active > button,
619.pagination-items-per-page.show > a,
620.pagination-items-per-page.show > button,
621.page-item.active .page-link,
622.page-item.show .page-link{
623 border-color: #4ECD66;
624 background-color: #4ECD66;
625}
626
627.pagination-results,
628.pagination-items-per-page > a,
629.pagination-items-per-page > button,
630.pagination-items-per-page > a:hover,
631.pagination-items-per-page > button:hover,
632.page-link{
633 color: #4ebe66;
634}
635
636.bioec-profile-demanda-main{
637 display: flex;
638 gap: 40px;
639 flex-direction: column;
640 padding-bottom: 20px;
641}
642.bioec-profile-demanda-main h5{
643 font-weight: 700;
644}
645.bioec-profile-demanda-main h5, .bioec-profile-demanda-main p{
646 color: #5B5C61;
647 margin-bottom: 0px;
648 font-size: 16px;
649
650}
651
652.bioec-profile-demanda-main #demanda-lista-container>div{
653 border: 1px #BEBEBE solid;
654 padding: 24px 24px 0 24px;
655 margin-bottom: 40px;
656 display: grid;
657 grid-row-gap: 24px;
658 grid-template-columns: 24px 12px 1fr 15px;
659 grid-template-areas:
660 "ck . tit arrw"
661 "desc desc desc desc"
662 "clps clps clps clps";
663}
664
665.bioec-profile-demanda-main .lista-checkmark { grid-area: ck; display: flex; }
666.bioec-profile-demanda-main .lista-checkmark i { font-size: 24px; }
667.bioec-profile-demanda-main .lista-pic { grid-area: pic; display: flex; justify-content: center;}
668.bioec-profile-demanda-main .lista-arrow { grid-area: arrw; }
669
670.bioec-profile-demanda-main .lista-titulo {
671 grid-area: tit;
672 display: flex;
673 flex-direction: column;
674 justify-content: center;
675
676}
677
678.bioec-profile-demanda-main .lista-titulo h5{
679 margin-bottom: 0px;
680}
681
682.bioec-profile-demanda-main .lista-desc {
683grid-area: desc;
684}
685
686.bioec-profile-demanda-main .lista-desc p{
687 margin: 0;
688}
689
690.bioec-profile-demanda-main a{
691 color: #5B5C61;
692}
693
694.demanda-port{
695 border: 1px #BEBEBE solid;
696 padding: 24px;
697 display: flex;
698 flex-direction: column;
699 align-items: center;
700 gap: 24px;
701}
702
703.demanda-port p{
704text-align: center;
705
706}
707
708.demanda-port div{
709display: flex;
710 justify-content: space-between;
711 width: min(558px, 100%);
712}
713
714.button-empty {
715border: solid 1px #4ECD66;
716padding: 8px 24px;
717color: #333244;
718 transition: 250ms;
719}
720
721.button-empty:hover{
722 background-color: #4ECD66;
723}
724
725.button-filled {
726background-color: #4ECD66;
727border: solid 1px #4ECD66;
728padding: 8px 24px;
729color: #333244;
730transition: 250ms;
731
732}
733
734.button-filled:hover{
735 background-color: transparent;
736}
737
738.bioec-profile-demanda-main .lista-footnote {
739
740 display: flex;
741 justify-content: space-between;
742 border-top: 1px solid #E8ECEF;
743 padding-top: 12px;
744 font-size: 14px;
745 font-weight: 300;
746 gap: 15px;
747 color: #5B5C61;
748
749}
750.lista-collapse{
751display: flex;
752flex-direction: column;
753gap: 24px;
754grid-area: clps;
755padding-bottom: 24px;
756}
757
758 .lista-details{
759 display: flex;
760 justify-content: flex-start;
761 gap: 24px;
762}
763.lista-pic img {
764 max-height: 138px;
765 max-width: 138px;
766}
767
768.bioec-profile-demanda-main p{
769
770}
771
772.imagemCarregadaDemanda {
773 height: 100px;
774 width: 100px;
775 background-size: contain;
776 background-position: center;
777 background-repeat: no-repeat;
778}
779
780
781.ButtonAddDemanda {
782 background: #4ECD66;
783 border-radius: 8px;
784 padding: 8px 24px;
785 border: none;
786 font-weight: 700;
787 color: #333244;
788 font-family: 'Roboto';
789 float: right;
790 text-transform: uppercase;
791}
792.ButtonAddDemanda:hover{
793 color: #333244;
794 text-decoration: none;
795}
796
797.bioec-profile-demanda-modal label {
798 margin: 0;
799 cursor: default;
800 font-size: 20px;
801 font-weight: 700;
802 color: #5B5C61;
803}
804
805.bioec-profile-demanda-modal div {
806 width: 100%;
807}
808
809#demandaModal-l1, .demandaModal-l1 {
810 padding: 18px 24px;
811 display: flex;
812 justify-content: space-between;
813}
814
815#demandaModal-l1 img, .demandaModal-l1 img {
816 cursor: pointer;
817}
818
819#demandaModal-l1 h5, .demandaModal-l1 h5 {
820 margin: 0;
821 font-size: 20px;
822 font-weight: 700;
823 color: #5B5C61;
824}
825
826#demandaModal-l2, .demandaModal-l2 {
827 border-top: 1px solid #E8ECEF;
828 display: grid;
829 grid-template-columns: 1fr 1fr;
830 grid-template-areas:
831 "titu nome"
832 "fone mail"
833 "desc desc"
834 "imagem ."
835 ;
836 column-gap: 24px;
837 row-gap: 40px;
838 padding: 24px;
839}
840
841#demandaModal-l2>div, .demandaModal-l2>div {
842 display: flex;
843 flex-direction: column;
844 gap: 8px;
845}
846
847#demandaTitle, .demandaTitle {
848 grid-area: titu;
849}
850
851#demandaName, .demandaName {
852 grid-area: nome;
853}
854
855#demandaTelephone, .demandaTelephone {
856 grid-area: fone;
857}
858
859#demandaEmail, .demandaEmail {
860 grid-area: mail;
861}
862
863#demandaBrand, .demandaBrand {
864 grid-area: marca;
865}
866
867#demandaModal-l2>#demandaImg, .demandaModal-l2>.demandaImg {
868 grid-area: imagem;
869 display: flex;
870 flex-direction: column;
871}
872
873#demandaDesc, .demandaDesc {
874 grid-area: desc;
875
876}
877
878#demandaDesc input, .demandaDesc input {
879 height: 80px;
880}
881
882.TextImportant{
883 border-bottom: 1px solid #E8ECEF;
884 padding: 24px;
885 color: #5B5C61;
886}
887
888.bioec-profile-demanda-modal input[type="text"] {
889 border-top: none;
890 border-left: none;
891 border-right: none;
892 border-bottom: 1px solid #BEBEBE;
893 width: 100%;
894 font-size: 16px;
895
896}
897
898
899.bioec-profile-demanda-modal input[type="text"]:focus-visible {
900 outline: none;
901 border-bottom: 1px solid black;
902
903}
904
905.bioec-profile-demanda-modal .ReqLabel:before {
906 content: "* ";
907 color: #D90000;
908
909}
910
911#inputCarregarImagemDemanda, .inputCarregarImagemDemanda {
912 display: none;
913}
914
915#carregarImagem, .carregarImagem {
916 padding: 8px 24px;
917 border: 1px solid #4ECD66;
918 width: fit-content;
919 transition: 250ms;
920
921}
922
923#carregarImagem:hover, .carregarImagem:hover {
924 background-color: #4ECD66;
925}
926
927.button-empty {
928 border: solid 1px #4ECD66;
929 padding: 8px 24px;
930 color: #333244;
931 transition: 250ms;
932 font-weight: bold;
933}
934
935.button-empty:hover {
936 background-color: #4ECD66;
937}
938
939.button-filled {
940 background-color: #4ECD66;
941 border: solid 1px #4ECD66;
942 padding: 8px 24px;
943 color: #333244;
944 transition: 250ms;
945 font-weight: bold;
946}
947
948.button-filled:hover {
949 background-color: transparent;
950}
951
952#demandaModal-l3, .demandaModal-l3 {
953 gap: 24px;
954 display: flex;
955 justify-content: flex-end;
956 padding: 24px;
957}
958
959.modal {
960 padding: initial !important;
961 border-radius: 4px !important;
962
963}
964
965.modal a.close-modal {
966 display: none;
967}
968
969#removerImagemDemanda, .removerImagemDemanda {
970 background: none;
971 border: none;
972 outline: none;
973 color: #5B5C61;
974 font-size: 16px;
975 font-weight: 900;
976 line-height: 24px;
977 letter-spacing: 0em;
978 width: fit-content;
979 margin-left: 16px;
980}
981
982
983@media(max-width: 964px){
984 .lista-pic img {
985 width: 100%;
986 max-height: unset;
987 max-width: unset;
988
989 }
990}
991
992@media (max-width: 550px) {
993 #demandaModal-l2, .demandaModal-l2 {
994 display: flex;
995 flex-direction: column;
996 }
997
998 #demandaModal-l3, .demandaModal-l3 {
999 display: flex;
1000 flex-direction: column;
1001 }
1002}
1003
1004@media(max-width: 450px){
1005 .bioec-profile-demanda-main .lista-details{
1006 flex-direction: column;
1007 }
1008
1009 .lista-contato{
1010 text-align: center;
1011 }
1012
1013 .bioec-profile-demanda-main .lista-footnote{
1014 flex-direction: column;
1015 gap: 10px;
1016 align-items: flex-end;
1017 text-align: right;
1018 }
1019}
1020
1021@media(max-width: 992px){
1022 #demanda-lista-container {
1023 padding-inline: 15px;
1024 }
1025}
1026
1027.bioec-profile-demanda-main .lista-footnote .buttonsActions {
1028 display: flex;
1029 gap: 17px;
1030}
1031
1032@media (max-width: 768px) {
1033 .bioec-profile-demanda-main .lista-desc {
1034 gap: 24px;
1035 flex-direction: column-reverse;
1036 }
1037 .bioec-profile-demanda-main .lista-footnote {
1038 flex-direction: column;
1039 align-items: center;
1040 }
1041 .bioec-profile-demanda-main .lista-footnote > div {
1042 text-align: center;
1043 }
1044
1045 .bioec-profile-demanda-main .lista-footnote .barra-pipe {
1046 display: none;
1047 }
1048 .bioec-profile-demanda-main .lista-footnote .lista-author {
1049 display: flex;
1050 gap: 4px;
1051 justify-content: center;
1052 }
1053 .bioec-profile-demanda-main .lista-footnote .buttonsActions {
1054 width: 100%;
1055 justify-content: space-between;
1056 }
1057}
1058
1059
1060</style>
1061
1062
1063<script>
1064
1065
1066
1067</script>
The following has evaluated to null or missing: ==> autorId [in template "34764#34807#41133" at line 81, column 54] ---- 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: #if autorId != "" && autorId?? [in template "34764#34807#41133" at line 81, column 49] ----
1<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
2<#assign UserLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.UserLocalService")>
3<#assign AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")>
4<#assign mbMessageLocalService = serviceLocator.findService("com.liferay.message.boards.service.MBMessageLocalService")>
5<#assign OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
6 tagsLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetTagLocalService")
7>
8
9
10
11
12
13
14
15
16<div class="bioec-profile-oferta-main">
17 <div id="oferta-lista-container" class="d-flex flex-column">
18 <#if entries?has_content>
19 <#list entries as entry>
20 <#assign journalArticle = JournalArticleLocalService.getLatestArticle(entry.getClassPK()) >
21 <#assign JournalArticleID = journalArticle.getId()>
22 <#assign JournalArticleFrontId = journalArticle.getArticleId()>
23 <#assign articleXml = journalArticle.getDocument().getRootElement()
24 userIsAdmin = false
25 orgId = ""
26 >
27
28 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='CampoDeTexto50355704']")??>
29
30 <#assign nomeParaContato = articleXml.selectSingleNode("dynamic-element[@field-reference='CampoDeTexto50355704']").getStringValue()!""
31 nomeParaContato = nomeParaContato?replace("\n\t\t", "")
32 nomeParaContato = nomeParaContato?replace("\n\t", "")
33 >
34 </#if>
35
36 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text90715721']")??>
37 <#assign telefone = articleXml.selectSingleNode("dynamic-element[@field-reference='Text90715721']")!""
38 telefone = telefone.getStringValue()!""
39 telefone = telefone?replace("\n\t\t", "")
40 telefone = telefone?replace("\n\t", "")
41 >
42
43 </#if>
44
45 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text68569631']")??>
46 <#assign email = articleXml.selectSingleNode("dynamic-element[@field-reference='Text68569631']").getStringValue()!""
47 email = email?replace("\n\t\t", "")
48 email = email?replace("\n\t", "")
49 >
50 </#if>
51
52
53 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='CopyOfText18267936']")??>
54 <#assign desc = articleXml.selectSingleNode("dynamic-element[@field-reference='CopyOfText18267936']").getStringValue()!""
55 desc = desc?replace("\n\t\t", "")
56 desc = desc?replace("\n\t", "")
57 >
58 </#if>
59
60 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text80669990']")??>
61 <#assign imagem = articleXml.selectSingleNode("dynamic-element[@field-reference='Text80669990']").getStringValue()!""
62 imagem = imagem?replace("\n\t\t", "")
63 imagem = imagem?replace("\n\t", "")
64 >
65 </#if>
66
67 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='CampoDeTexto97452704']")??>
68 <#assign autorId = articleXml.selectSingleNode("dynamic-element[@field-reference='CampoDeTexto97452704']").getStringValue()!""
69 autorId = autorId?replace("\n\t\t", "")
70 autorId = autorId?replace("\n\t", "")
71 autorArticleId = ""
72 >
73 </#if>
74
75 <#assign
76 commentsCount = mbMessageLocalService.getDiscussionMessagesCount(entry.getClassName(), entry.getClassPK(), 0)!"0"
77 >
78
79
80
81 <#if autorId != "" && autorId??>
82 <#assign
83 autor = UserLocalService.fetchUser(autorId?number)!""
84 autorArticleId = autor.getExpandoBridge().getAttribute("journal-article")!"0"
85 />
86 <#if autor != "">
87 <#assign autor = autor.getFullName()!"">
88 <#else>
89 <#assign autor = "Anônimo" >
90 </#if>
91 <#else>
92 <#assign autor = "Anônimo" >
93 </#if>
94 <#assign categorias = AssetCategoryLocalService.getCategoryNames(entry.getClassName(), entry.getClassPK())!"" >
95 <#assign urlWC = "">
96
97 <#if autorArticleId != "0" && autorArticleId != "" && autor != "Anônimo">
98 <#assign autorArticle = JournalArticleLocalService.getLatestArticle(themeDisplay.getLayout().getGroupId(), autorArticleId?string) >
99 <#assign urlWC = autorArticle.getUrlTitle()!"">
100 </#if>
101
102
103 <#assign tags = tagsLocalService.getTagNames("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()?number )
104 tagName = tags[0]!""
105 orgOrUser = ""
106 >
107
108 <#if tagName?contains("organization") && tagName != "" >
109 <#assign orgOrUser = "org">
110 <#else>
111 <#assign orgOrUser = "user">
112 </#if>
113
114 <#if orgOrUser == "org" >
115
116 <#assign
117 orgId = tagName?keep_after("organization-")
118 organization = OrganizationLocalService.fetchOrganization(orgId?number)!""
119 >
120
121
122 <#if organization != "" && autor != "Anônimo">
123 <#assign orgArticleId = organization.getExpandoBridge().getAttribute("journal-article")
124 orgJournalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),orgArticleId?c)
125 urlWC = orgJournalArticle.getUrlTitle()!""
126 autor = organization.getName()!""
127 >
128
129 </#if>
130 </#if>
131
132 <#if themeDisplay.isSignedIn() >
133 <#if tagName?contains("organization-")>
134 <#assign userIsAdmin = OrganizationLocalService.hasUserOrganization(themeDisplay.getUserId(), orgId?number)>
135 <#else>
136 <#if autorId?number == themeDisplay.getUserId()>
137 <script>console.log("oi");</script>
138 <#assign userIsAdmin = true>
139 </#if>
140 </#if>
141
142
143 </#if>
144
145
146 <div class="oferta-lista-item">
147 <div class="lista-checkmark">
148 <#if categorias?seq_contains("aprovado") > <i title="Aprovado" style="color: #4ECD66" class="fa-solid fa-circle-check"></i> </#if>
149 <#if categorias?seq_contains("pendente") > <i title="Em análise" style="color: #D90000"class="fa-solid fa-spinner"></i> </#if>
150 <#if categorias?seq_contains("recusado") > <i title="Recusado" style="color: #D90000"class="fa-solid fa-exclamation-circle"></i> </#if>
151 </div>
152
153
154 <div class="lista-titulo">
155 <h5>${entry.getHighlightedTitle()}</h5>
156 </div>
157
158 <div class="lista-arrow">
159 <button style="padding: 0;" class="btn" type="button" data-toggle="collapse" data-target="#collapseID${entry.getClassPK()}" aria-expanded="false" aria-controls="collapseID${entry.getClassPK()}">
160 <i class="fa-solid fa-chevron-down"></i>
161 </button>
162 </div>
163
164 <div class="lista-desc">
165 <p>${desc}</p>
166 </div>
167
168 <div class="lista-collapse collapse" id="collapseID${entry.getClassPK()}">
169 <#if nomeParaContato != "" || telefone != "" || email != "" || imagem?trim !="">
170 <div class="lista-details">
171 <div class="lista-pic">
172 <i class="fa-solid fa-image-slash"></i>
173 <#if imagem?trim !="" >
174 <img class="bioec_oferta_img" src="${imagem}">
175 <#else>
176 <div class="bioec_oferta_img_placeholder">
177 <i class="fa-solid fa-image"></i>
178 sem imagem
179 </div>
180 </#if>
181 </div>
182 <#if nomeParaContato != "" || telefone != "" || email != "" >
183 <div class="lista-contato">
184 <p>Contato</p>
185 <p class="lista-author">${nomeParaContato}</p>
186 <p class="lista-phone">${telefone}</p>
187 <p class="lista-email">${email}</p>
188 </div>
189 </#if>
190 </div>
191 </#if>
192
193 <#if categorias?seq_contains("recusado") >
194 <div style="border-top: 1px solid #E8ECEF; font-weight: bold; padding-top: 24px;">
195 <p>Conteúdo Em Análise Pelo Cetiqt:</p>
196 <p>Conteúdo recusado pelo CETIQT por violar as políticas de privacidade.</p>
197 </div>
198 </#if>
199 <div class="lista-footnote">
200 <div>
201 <span class="lista-date">${journalArticle.getDisplayDate()?string('dd/MM/yyyy')}</span> | <span class="lista-commentNumber">${commentsCount} cometários</span> <span class="barra-pipe"> | </span> <span class="lista-author">Publicado por <a <#if urlWC != ''>href="/w/${urlWC}</#if>">${autor}</a></span>
202 </div>
203 <#if userIsAdmin>
204 <div class="buttonsActions">
205 <div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modalOferta${JournalArticleID}">
206 <i class="fa-solid fa-edit"></i>
207 </div>
208 <div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modal-oferta-${entry.getClassPK()}">
209 <i class="fa-solid fa-trash-can"></i>
210 </div>
211
212 </div>
213 </#if>
214 </div>
215 </div>
216 </div>
217
218 <#if userIsAdmin>
219 <div style="display: none;" id="modal-oferta-${entry.getClassPK()}" class="modal fade" role="dialog">
220 <div class="modal-dialog modal-lg" role="document">
221 <div class="modal-content">
222 <div class="modal-header" >
223 <h4 class="m-0">Remover Oferta</h4>
224 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
225 <span aria-hidden="true">
226 <i class="fa-solid fa-close"></i>
227 </span>
228 </button>
229 </div>
230 <div class="modal-body">
231 <h5>Você tem certeza que deseja remover essa oferta?</h5>
232 <div>
233 Ao clicar em continuar, a oferta será removida do seu perfil.
234 </div>
235 </div>
236 <div class="modal-footer justify-content-end">
237 <button class="bioec_secondary_button" data-dismiss="modal">CANCELAR</button>
238 <button class="bioec_primary_button" type="button" onclick="excluirOferta(${JournalArticleFrontId}, ${orgId})">CONTINUAR</button>
239 </div>
240 </div>
241 </div>
242 </div>
243
244 <#-- modal edição -->
245
246
247 <div style="display: none;" id="modalOferta${JournalArticleID}" class="modal fade bioec-profile-oferta-modal modalOferta" role="dialog">
248 <div class="modal-dialog modal-lg" role="document">
249 <form id="formularioOferta${JournalArticleID}" class="form-group modal-content formularioOferta">
250 <div id="ofertaModal-l1${JournalArticleID}" class="modal-header ofertaModal-l1">
251 <h5>Adicionar oferta</h5>
252 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
253 <span aria-hidden="true">×</span>
254 </button>
255 </div>
256 <div id="ofertaModal-l2${JournalArticleID}" class="modal-body ofertaModal-l2">
257 <div id="ofertaTitle${JournalArticleID}" class="ofertaTitle">
258 <label class="ReqLabel" for="ofertaInputTitle${JournalArticleID}">Título da oferta</label>
259 <input id="ofertaInputTitle${JournalArticleID}" value="${entry.getHighlightedTitle()}" type="text" placeholder="Inserir um título" required>
260 </div>
261 <div id="ofertaName${JournalArticleID}" class="ofertaName">
262 <label class="" for="ofertaInputName${JournalArticleID}">Nome para contato</label>
263 <input value="${nomeParaContato}" id="ofertaInputName${JournalArticleID}" placeholder="Inserir nome" type="text">
264 </div>
265 <div id="ofertaTelephone${JournalArticleID}" class="ofertaTelephone">
266 <label class="" for="ofertaInputPhone${JournalArticleID}">Telefone para contato</label>
267 <input value="${telefone}" id="ofertaInputPhone${JournalArticleID}" name="ofertaInputPhone" type="text" placeholder ='(__)_____-_____' minlength="14" />
268 </div>
269 <div id="ofertaEmail${JournalArticleID}" class="ofertaEmail">
270 <label class="" for="ofertaInputEmail${JournalArticleID}">E-mail para contato</label>
271 <input value="${email}" id="ofertaInputEmail${JournalArticleID}" placeholder="Inserir e-mail" type="text">
272 </div>
273 <div id="ofertaDesc${JournalArticleID}" class="ofertaDesc">
274 <label class="ReqLabel" for="ofertaInputDesc${JournalArticleID}">Descrição</label>
275 <textarea id="ofertaInputDesc${JournalArticleID}" style="max-width: 100%;font-size: 16px;height: 80px;border: 1px solid #BEBEBE;" required>${desc}</textarea>
276 </div>
277 <div id="ofertaImg${JournalArticleID}" class="ofertaImg">
278 <div style="display: flex; flex-direction: column; gap: 8px">
279 <label>Imagem da oferta (Máx. 10 MB)</label>
280 <label class="btn carregarImagem" id="carregarImagem${JournalArticleID}" for="inputCarregarImagemOferta${JournalArticleID}" style="font-size: 16px; cursor: pointer;">CARREGAR IMAGEM</label>
281 <input class="inputCarregarImagemOferta" id="inputCarregarImagemOferta${JournalArticleID}" type="file" accept="image/*" onchange="encodeOfertaImageAsURL${JournalArticleID}(this)">
282 <input class="d-none" id="inputOfertaBase64${JournalArticleID}" value="${imagem}"/>
283 <div class="imagemCarregadaOferta imagemCarregadaOferta${JournalArticleID} d-md-none d-block" style="background-image: url(${imagem})"></div>
284 <button type="button" id="removerImagemOferta${JournalArticleID}" class="<#if imagem == "" || imagem?? == false> d-none </#if> removerImagemOferta" >
285 <i class="fa fa-trash"></i> Remover imagem
286 </button>
287 </div>
288 <div class="imagemCarregadaOferta imagemCarregadaOferta${JournalArticleID} d-md-block d-none" style="background-image: url(${imagem})"></div>
289 </div>
290 </div>
291 <div class="TextImportant">
292 <p>
293 Importante: O conteúdo enviado passará por um processo interno de aprovação. Só então o conteúdo adicionado aparecerá no portal.
294 </p>
295 </div>
296
297 <div id="ofertaModal-l3${JournalArticleID}" class="modal-footer ofertaModal-l3">
298 <button class="btn button-empty" onclick="" id="ofertas-saveAndClose${JournalArticleID}">SALVAR E FECHAR</button>
299 </div>
300 </form>
301 </div>
302 </div>
303
304 </#if>
305 <#--
306
307
308
309
310 <div style="display: none;" id="modalInfra${JournalArticleID}" class="modal fade bioec-profile-infra-modal" role="dialog">
311 <div class="modal-dialog modal-lg" role="document">
312
313 <form class="form-group modal-content" id="formularioInfraestrutura${JournalArticleID}">
314 <div id="infraModal-l1-${JournalArticleID}" class="modal-header infraModal-l1" >
315 <h5>Adicionar Infraestrutura</h5>
316 <button id="fecharModal${JournalArticleID}" type="button" class="close" data-dismiss="modal" aria-label="Close">
317 <span aria-hidden="true">×</span>
318 </button>
319 </div>
320 <div id="infraModal-l2-${JournalArticleID}" class="modal-body infraModal-l2">
321 <div id="infraName${JournalArticleID}" class="infraName">
322 <label class="ReqLabel" for="inputInfraName${JournalArticleID}">Nome da infraestrutura</label>
323 <input type="text" id="inputInfraName${JournalArticleID}" value="${entry.getHighlightedTitle()}" placeholder="Nome da infraestrutura" required>
324 </div>
325 <div id="infraModel${JournalArticleID}" class="infraModel">
326 <label class="ReqLabel" for="inputInfraModel${JournalArticleID}">Modelo</label>
327 <input type="text" id="inputInfraModel${JournalArticleID}" value="${modelo}" placeholder="Modelo" required>
328 </div>
329 <div id="infraBrand${JournalArticleID}" class="infraBrand">
330 <label class="ReqLabel" for="inputInfraBrand${JournalArticleID}">Marca</label>
331 <input type="text" id="inputInfraBrand${JournalArticleID}" value="${marca}" placeholder="Marca" required>
332 </div>
333
334 <div id="infraImg${JournalArticleID}" class="infraImg">
335 <div style="display: flex; flex-direction: column; gap: 8px">
336 <label>Imagem da infraestrutura (Máx. 10 MB)</label>
337 <label class="bioec_secondary_button" id="carregarImagem${JournalArticleID}" for="inputCarregarImagemInfra${JournalArticleID}" style="font-size: 16px;color: #333244;align-self:start;">
338 CARREGAR IMAGEM
339 </label>
340 <input id="inputCarregarImagemInfra${JournalArticleID}" class="inputCarregarImagemInfra" type="file" accept="image/*" onchange="encodeInfraImageAsURL${JournalArticleID}(this)">
341 <input class="d-none" id="inputInfraBase64${JournalArticleID}" />
342 <div class="imagemCarregadaInfra${JournalArticleID} d-md-none d-block"></div>
343 <button type="button" id="removerImagemInfra${JournalArticleID}" class="d-none removerImagemInfra" >
344 <i class="fa fa-trash"></i> Remover imagem
345 </button>
346 </div>
347 <div class="imagemCarregadaInfra${JournalArticleID} d-md-block d-none"></div>
348 </div>
349
350 <div id="infraFunction${JournalArticleID}" class="infraFunction">
351 <label class="ReqLabel" for="inputInfraFunction${JournalArticleID}">Função</label>
352 <input type="text" id="inputInfraFunction${JournalArticleID}" class="inputInfraFunction" value="${funcao}" placeholder="Função" required>
353 </div>
354 </div>
355 <div class="TextImportant">
356 <p>
357 Importante: O conteúdo enviado passará por um processo interno de aprovação. Só então o conteúdo adicionado aparecerá no portal.
358 </p>
359 </div>
360 <div id="infraModal-l3-${JournalArticleID}" class="modal-footer infraModal-l3">
361 <button class="bioec_secondary_button" id="ofertas-saveAndClose${JournalArticleID}" onclick="">SALVAR E FECHAR</button>
362 </div>
363 </form>
364
365 </div>
366
367
368 -->
369
370
371
372 <script>
373 <#if userIsAdmin>
374 function excluirOferta(wcId, orgId) {
375 Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""});
376 fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/oferta/" + wcId, {
377 method: 'DELETE',
378 "headers": {
379 "x-csrf-token": Liferay.authToken,
380 "Content-Type": "application/json"
381 }
382 })
383 .then(res => {
384 if(res.status == 200) {
385 Liferay.Util.openToast({
386 message: "Infraestrutura excluida com sucesso",
387 type: "success",
388 title: "",
389 toastProps: {
390 autoClose: 5000
391 }
392 })
393 setTimeout(function(){ location.reload(); }, 2000)
394 } else {
395 Liferay.Util.openToast({
396 message: "Erro ao excluir infraestrutura",
397 type: "danger",
398 title: "",
399 toastProps: {
400 autoClose: 5000
401 }
402 })
403 }
404 });
405 }
406
407
408
409
410 function validImageSize(base64="") {
411 const decoded = atob(base64.substring(base64.indexOf(',') + 1));
412 const sizeMB = decoded.length / 1e+6;
413 console.log("MB: " + decoded.length / 1e+6);
414 if(sizeMB > 10) {
415 Liferay.Util.openToast({
416 message: "O tamanho da imagem não deve ultrapassar 10 MB.",
417 type: "danger",
418 title: "",
419 toastProps: {
420 autoClose: 5000
421 }
422 })
423 return false
424 }
425 return true
426 }
427
428 function encodeOfertaImageAsURL${JournalArticleID}(element) {
429 let file = element.files[0];
430 let reader = new FileReader();
431 reader.onloadend = () => {
432 if(reader.result) {
433 if(!validImageSize(reader.result)) return;
434 try {
435 const base64_input = document.getElementById("inputOfertaBase64${JournalArticleID}")
436 base64_input.value = reader.result
437 Array.from(document.getElementsByClassName("imagemCarregadaOferta${JournalArticleID}")).forEach( el => el.style.backgroundImage = 'url(' + reader.result + ')' )
438
439 const removeImageButton = document.getElementById("removerImagemOferta${JournalArticleID}")
440 removeImageButton.classList.remove("d-none")
441 } catch (error) {
442 console.error(error)
443 }
444 }
445 }
446 reader.readAsDataURL(file);
447 }
448
449 function removeImageOferta${JournalArticleID}() {
450 try {
451 const file_input = document.getElementById("inputCarregarImagemOferta${JournalArticleID}")
452 Array.from(document.getElementsByClassName("imagemCarregadaOferta${JournalArticleID}")).forEach( el => el.style.backgroundImage = "" )
453 const base64_input = document.getElementById("inputOfertaBase64${JournalArticleID}")
454 file_input.value = null
455 base64_input.value = ""
456
457 const removeImageButton = document.getElementById("removerImagemOferta${JournalArticleID}")
458 removeImageButton.classList.add("d-none")
459 } catch (error) {
460 console.error(error)
461 }
462}
463
464
465
466document.getElementById("removerImagemOferta${JournalArticleID}").addEventListener("click", removeImageOferta${JournalArticleID});
467
468<#-- Rest da edição de organização -->
469
470<#if orgOrUser == "org">
471document.querySelector('#formularioOferta${JournalArticleID}').addEventListener('submit', event => {
472 event.preventDefault();
473 adicionarOferta${JournalArticleID}();
474});
475
476function adicionarOferta${JournalArticleID}() {
477 Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""});
478 $("#ofertas-saveAndClose${JournalArticleID}").prop("disabled",true);
479
480
481
482 const ofertaData = {
483 titulo: document.getElementById("ofertaInputTitle${JournalArticleID}").value,
484 nomeContato: document.getElementById("ofertaInputName${JournalArticleID}").value,
485 telefoneContato: document.getElementById("ofertaInputPhone${JournalArticleID}").value,
486 emailContato: document.getElementById("ofertaInputEmail${JournalArticleID}").value,
487 descricao: document.getElementById("ofertaInputDesc${JournalArticleID}").value,
488 imagem: document.getElementById("inputOfertaBase64${JournalArticleID}").value,
489 }
490
491 console.log(ofertaData);
492
493 fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/oferta/${JournalArticleFrontId}", {
494 method: 'PUT',
495 "headers": {
496 "x-csrf-token": Liferay.authToken,
497 "Content-Type": "application/json"
498 },
499 body: JSON.stringify(ofertaData)
500 })
501 .then(res => {
502 if(res.status == 200) {
503 Liferay.Util.openToast({
504 message: "Oferta editada com sucesso. Após a submissão, será iniciado o processo interno de aprovação do conteúdo enviado. Só então o conteúdo submetido aparecerá no portal.",
505 type: "success",
506 title: "",
507 toastProps: {
508 autoClose: 5000
509 }
510 })
511 setTimeout(function(){ location.reload(); }, 2000);
512 } else {
513 $("#ofertas-saveAndClose${JournalArticleID}").prop("disabled",false);
514 Liferay.Util.openToast({
515 message: "Erro ao editar oferta",
516 type: "danger",
517 title: "",
518 toastProps: {
519 autoClose: 5000
520 }
521 })
522 }
523 })
524 }
525</#if>
526
527<#-- Rest da edição de pessoa fisica -->
528
529
530
531 <#if orgOrUser == "user">
532
533 document.querySelector('#formularioOferta${JournalArticleID}').addEventListener('submit', event => {
534 event.preventDefault();
535 adicionarOferta${JournalArticleID}();
536 });
537
538 function adicionarOferta${JournalArticleID}() {
539 Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""});
540 $("#ofertas-saveAndClose${JournalArticleID}").prop("disabled",true);
541
542 const ofertaData = {
543 titulo: document.getElementById("ofertaInputTitle${JournalArticleID}").value,
544 nomeContato: document.getElementById("ofertaInputName${JournalArticleID}").value,
545 telefoneContato: document.getElementById("ofertaInputPhone${JournalArticleID}").value,
546 emailContato: document.getElementById("ofertaInputEmail${JournalArticleID}").value,
547 descricao: document.getElementById("ofertaInputDesc${JournalArticleID}").value,
548 imagem: document.getElementById("inputOfertaBase64${JournalArticleID}").value,
549 }
550
551 console.log(ofertaData);
552
553 fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/oferta/${JournalArticleFrontId}", {
554 method: 'PUT',
555 "headers": {
556 "x-csrf-token": Liferay.authToken,
557 "Content-Type": "application/json"
558 },
559 body: JSON.stringify(ofertaData)
560 })
561 .then( res => {
562 if(res.status == 200) {
563 Liferay.Util.openToast({
564 message: "Oferta editada com sucesso. Após a submissão, será iniciado o processo interno de aprovação do conteúdo enviado. Só então o conteúdo submetido aparecerá no portal.",
565 type: "success",
566 title: "",
567 toastProps: {
568 autoClose: 5000
569 }
570 })
571 setTimeout(function(){ location.reload(); }, 2000);
572 } else {
573 $("#ofertas-saveAndClose${JournalArticleID}").prop("disabled",false);
574 Liferay.Util.openToast({
575 message: "Erro ao editar Oferta",
576 type: "danger",
577 title: "",
578 toastProps: {
579 autoClose: 5000
580 }
581 })
582 }
583 });
584
585 };
586
587
588 </#if>
589
590
591 </#if>
592 </script>
593
594
595
596
597 </#list>
598 </#if>
599 </div>
600</div>
601
602<style>
603.bioec_oferta_img {
604 overflow: hidden;
605 background-size: contain;
606 background-position: center;
607 background-repeat: no-repeat;
608}
609
610.bioec_oferta_img_placeholder {
611 width: 140px;
612 height: 140px;
613 background-color: #E8ECEF;
614 display: flex;
615 flex-direction: column;
616 align-items: center;
617 justify-content: center;
618 font-size: 14px;
619 color: #5B5C61;
620}
621
622.bioec_oferta_img_placeholder i {
623 font-size: 44px;
624}
625
626
627.pagination-items-per-page.active > a,
628.pagination-items-per-page.active > button,
629.pagination-items-per-page.show > a,
630.pagination-items-per-page.show > button,
631.page-item.active .page-link,
632.page-item.show .page-link{
633 border-color: #4ECD66;
634 background-color: #4ECD66;
635}
636
637.pagination-results,
638.pagination-items-per-page > a,
639.pagination-items-per-page > button,
640.pagination-items-per-page > a:hover,
641.pagination-items-per-page > button:hover,
642.page-link{
643 color: #4ebe66;
644}
645
646.bioec-profile-oferta-main{
647 display: flex;
648 gap: 40px;
649 flex-direction: column;
650 padding-bottom: 20px;
651}
652.bioec-profile-oferta-main h5{
653 font-weight: 700;
654}
655.bioec-profile-oferta-main h5, .bioec-profile-oferta-main p{
656 color: #5B5C61;
657 margin-bottom: 0px;
658 font-size: 16px;
659
660}
661
662.bioec-profile-oferta-main #oferta-lista-container>div{
663 border: 1px #BEBEBE solid;
664 padding: 24px 24px 0 24px;
665 margin-bottom: 40px;
666 display: grid;
667 grid-row-gap: 24px;
668 grid-template-columns: 24px 12px 1fr 15px;
669 grid-template-areas:
670 "ck . tit arrw"
671 "desc desc desc desc"
672 "clps clps clps clps";
673}
674
675.bioec-profile-oferta-main .lista-checkmark { grid-area: ck; display: flex; }
676.bioec-profile-oferta-main .lista-checkmark i { font-size: 24px; }
677.bioec-profile-oferta-main .lista-pic { grid-area: pic; display: flex; justify-content: center;}
678.bioec-profile-oferta-main .lista-arrow { grid-area: arrw; }
679
680.bioec-profile-oferta-main .lista-titulo {
681 grid-area: tit;
682 display: flex;
683 flex-direction: column;
684 justify-content: center;
685
686}
687
688.bioec-profile-oferta-main .lista-titulo h5{
689 margin-bottom: 0px;
690}
691
692.bioec-profile-oferta-main .lista-desc {
693grid-area: desc;
694}
695
696.bioec-profile-oferta-main .lista-desc p{
697 margin: 0;
698}
699
700.bioec-profile-oferta-main a{
701 color: #5B5C61;
702}
703
704.oferta-port{
705 border: 1px #BEBEBE solid;
706 padding: 24px;
707 display: flex;
708 flex-direction: column;
709 align-items: center;
710 gap: 24px;
711}
712
713.oferta-port p{
714text-align: center;
715
716}
717
718.oferta-port div{
719display: flex;
720 justify-content: space-between;
721 width: min(558px, 100%);
722}
723
724.button-empty {
725border: solid 1px #4ECD66;
726padding: 8px 24px;
727color: #333244;
728 transition: 250ms;
729}
730
731.button-empty:hover{
732 background-color: #4ECD66;
733}
734
735.button-filled {
736background-color: #4ECD66;
737border: solid 1px #4ECD66;
738padding: 8px 24px;
739color: #333244;
740transition: 250ms;
741
742}
743
744.button-filled:hover{
745 background-color: transparent;
746}
747
748.bioec-profile-oferta-main .lista-footnote {
749
750 display: flex;
751 justify-content: space-between;
752 border-top: 1px solid #E8ECEF;
753 padding-top: 12px;
754 font-size: 14px;
755 font-weight: 300;
756 gap: 15px;
757 color: #5B5C61;
758
759}
760.lista-collapse{
761display: flex;
762flex-direction: column;
763gap: 24px;
764grid-area: clps;
765padding-bottom: 24px;
766}
767
768 .lista-details{
769 display: flex;
770 justify-content: flex-start;
771 gap: 24px;
772}
773.lista-pic img {
774 max-height: 138px;
775 max-width: 138px;
776}
777
778.bioec-profile-oferta-main p{
779
780}
781
782.imagemCarregadaOferta {
783 height: 100px;
784 width: 100px;
785 background-size: contain;
786 background-position: center;
787 background-repeat: no-repeat;
788}
789
790
791.ButtonAddOferta {
792 background: #4ECD66;
793 border-radius: 8px;
794 padding: 8px 24px;
795 border: none;
796 font-weight: 700;
797 color: #333244;
798 font-family: 'Roboto';
799 float: right;
800 text-transform: uppercase;
801}
802.ButtonAddOferta:hover{
803 color: #333244;
804 text-decoration: none;
805}
806
807.bioec-profile-oferta-modal label {
808 margin: 0;
809 cursor: default;
810 font-size: 20px;
811 font-weight: 700;
812 color: #5B5C61;
813}
814
815.bioec-profile-oferta-modal div {
816 width: 100%;
817}
818
819#ofertaModal-l1, .ofertaModal-l1 {
820 padding: 18px 24px;
821 display: flex;
822 justify-content: space-between;
823}
824
825#ofertaModal-l1 img, .ofertaModal-l1 img {
826 cursor: pointer;
827}
828
829#ofertaModal-l1 h5, .ofertaModal-l1 h5 {
830 margin: 0;
831 font-size: 20px;
832 font-weight: 700;
833 color: #5B5C61;
834}
835
836#ofertaModal-l2, .ofertaModal-l2 {
837 border-top: 1px solid #E8ECEF;
838 display: grid;
839 grid-template-columns: 1fr 1fr;
840 grid-template-areas:
841 "titu nome"
842 "fone mail"
843 "desc desc"
844 "imagem ."
845 ;
846 column-gap: 24px;
847 row-gap: 40px;
848 padding: 24px;
849}
850
851#ofertaModal-l2>div, .ofertaModal-l2>div {
852 display: flex;
853 flex-direction: column;
854 gap: 8px;
855}
856
857#ofertaTitle, .ofertaTitle {
858 grid-area: titu;
859}
860
861#ofertaName, .ofertaName {
862 grid-area: nome;
863}
864
865#ofertaTelephone, .ofertaTelephone {
866 grid-area: fone;
867}
868
869#ofertaEmail, .ofertaEmail {
870 grid-area: mail;
871}
872
873#ofertaBrand, .ofertaBrand {
874 grid-area: marca;
875}
876
877#ofertaModal-l2>#ofertaImg, .ofertaModal-l2>.ofertaImg {
878 grid-area: imagem;
879 display: flex;
880 flex-direction: column;
881}
882
883#ofertaDesc, .ofertaDesc {
884 grid-area: desc;
885
886}
887
888#ofertaDesc input, .ofertaDesc input {
889 height: 80px;
890}
891
892.TextImportant{
893 border-bottom: 1px solid #E8ECEF;
894 padding: 24px;
895 color: #5B5C61;
896}
897
898.bioec-profile-oferta-modal input[type="text"] {
899 border-top: none;
900 border-left: none;
901 border-right: none;
902 border-bottom: 1px solid #BEBEBE;
903 width: 100%;
904 font-size: 16px;
905
906}
907
908
909.bioec-profile-oferta-modal input[type="text"]:focus-visible {
910 outline: none;
911 border-bottom: 1px solid black;
912
913}
914
915.bioec-profile-oferta-modal .ReqLabel:before {
916 content: "* ";
917 color: #D90000;
918
919}
920
921#inputCarregarImagemOferta, .inputCarregarImagemOferta {
922 display: none;
923}
924
925#carregarImagem, .carregarImagem {
926 padding: 8px 24px;
927 border: 1px solid #4ECD66;
928 width: fit-content;
929 transition: 250ms;
930
931}
932
933#carregarImagem:hover, .carregarImagem:hover {
934 background-color: #4ECD66;
935}
936
937.button-empty {
938 border: solid 1px #4ECD66;
939 padding: 8px 24px;
940 color: #333244;
941 transition: 250ms;
942 font-weight: bold;
943}
944
945.button-empty:hover {
946 background-color: #4ECD66;
947}
948
949.button-filled {
950 background-color: #4ECD66;
951 border: solid 1px #4ECD66;
952 padding: 8px 24px;
953 color: #333244;
954 transition: 250ms;
955 font-weight: bold;
956}
957
958.button-filled:hover {
959 background-color: transparent;
960}
961
962#ofertaModal-l3, .ofertaModal-l3 {
963 gap: 24px;
964 display: flex;
965 justify-content: flex-end;
966 padding: 24px;
967}
968
969.modal {
970 padding: initial !important;
971 border-radius: 4px !important;
972
973}
974
975.modal a.close-modal {
976 display: none;
977}
978
979#removerImagemOferta, .removerImagemOferta {
980 background: none;
981 border: none;
982 outline: none;
983 color: #5B5C61;
984 font-size: 16px;
985 font-weight: 900;
986 line-height: 24px;
987 letter-spacing: 0em;
988 width: fit-content;
989 margin-left: 16px;
990}
991
992
993@media(max-width: 964px){
994 .lista-pic img {
995 width: 100%;
996 max-height: unset;
997 max-width: unset;
998
999 }
1000}
1001
1002@media (max-width: 550px) {
1003 #ofertaModal-l2, .ofertaModal-l2 {
1004 display: flex;
1005 flex-direction: column;
1006 }
1007
1008 #ofertaModal-l3, .ofertaModal-l3 {
1009 display: flex;
1010 flex-direction: column;
1011 }
1012}
1013
1014@media(max-width: 450px){
1015 .bioec-profile-oferta-main .lista-details{
1016 flex-direction: column;
1017 }
1018
1019 .lista-contato{
1020 text-align: center;
1021 }
1022
1023 .bioec-profile-oferta-main .lista-footnote{
1024 flex-direction: column;
1025 gap: 10px;
1026 align-items: flex-end;
1027 text-align: right;
1028 }
1029}
1030
1031@media(max-width: 992px){
1032 #oferta-lista-container {
1033 padding-inline: 15px;
1034 }
1035}
1036
1037.bioec-profile-oferta-main .lista-footnote .buttonsActions {
1038 display: flex;
1039 gap: 17px;
1040}
1041
1042@media (max-width: 768px) {
1043 .bioec-profile-oferta-main .lista-desc {
1044 gap: 24px;
1045 flex-direction: column-reverse;
1046 }
1047 .bioec-profile-oferta-main .lista-footnote {
1048 flex-direction: column;
1049 align-items: center;
1050 }
1051 .bioec-profile-oferta-main .lista-footnote > div {
1052 text-align: center;
1053 }
1054
1055 .bioec-profile-oferta-main .lista-footnote .barra-pipe {
1056 display: none;
1057 }
1058 .bioec-profile-oferta-main .lista-footnote .lista-author {
1059 display: flex;
1060 gap: 4px;
1061 justify-content: center;
1062 }
1063 .bioec-profile-oferta-main .lista-footnote .buttonsActions {
1064 width: 100%;
1065 justify-content: space-between;
1066 }
1067}
1068
1069
1070</style>
1071
1072
1073<script>
1074
1075
1076
1077</script>
The following has evaluated to null or missing: ==> autor [in template "34764#34807#41154" at line 219, column 637] ---- 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: ${autor} [in template "34764#34807#41154" at line 219, column 635] ----
1<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
2 <#assign UserLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.UserLocalService")>
3 <#assign AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")>
4 <#assign PortletFileRepositoryUtil = staticUtil["com.liferay.portal.kernel.portletfilerepository.PortletFileRepositoryUtil"]
5 JSONFactoryUtil = staticUtil["com.liferay.portal.kernel.json.JSONFactoryUtil"]
6 mbMessageLocalService = serviceLocator.findService("com.liferay.message.boards.service.MBMessageLocalService")
7 tagsLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetTagLocalService")
8 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
9 >
10 <#assign journalArticles = JournalArticleLocalService.getArticlesByStructureId(themeDisplay.getLayout().getGroupId(), 47601, 0, -1, -1, ORDER_BY_ASC) />
11
12 <script src="https://unpkg.com/imask"></script>
13
14 <div class="bioec-profile-post-main">
15 <div id="post-lista-container" class="d-flex flex-column">
16 <#if entries?has_content>
17 <#list entries as entry>
18 <#assign journalArticle = JournalArticleLocalService.getLatestArticle(entry.getClassPK()) >
19 <#assign JournalArticleID = journalArticle.getId()>
20 <#assign JournalArticleFrontId = journalArticle.getArticleId()>
21 <#assign tipoDePost = "" >
22 <#assign urlWC = "">
23 <#assign articleXml = journalArticle.getDocument().getRootElement()
24 userIsAdmin = false
25 orgId = ""
26 imagem = ""
27 autorId = ""
28 desc = ""
29 >
30 <#assign tags = tagsLocalService.getTagNames("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()?number )
31 tagName = tags[0]!""
32 orgOrUser = ""
33 link = ""
34 >
35
36 <#if tagName?contains("organization") && tagName != "" >
37 <#assign orgOrUser = "org">
38 <#else>
39 <#assign orgOrUser = "user" />
40 </#if>
41
42 <#assign tituloDoPost = "">
43
44 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text33341198']")??>
45
46 <#assign tituloDoPost = articleXml.selectSingleNode("dynamic-element[@field-reference='Text33341198']").getStringValue()!""
47 tituloDoPost = tituloDoPost?replace("\n\t\t", "")
48 tituloDoPost = tituloDoPost?replace("\n\t", "")
49 />
50
51 </#if>
52
53 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='RichText67646278']")??>
54 <#assign desc = articleXml.selectSingleNode("dynamic-element[@field-reference='RichText67646278']").getStringValue()!""
55 desc = desc?replace("\n\t\t", "")
56 desc = desc?replace("\n\t", "")
57 />
58 </#if>
59
60 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='CampoDeTexto05403380']")??>
61 <#assign link = articleXml.selectSingleNode("dynamic-element[@field-reference='CampoDeTexto05403380']").getStringValue()!""
62 link = link?replace("\n\t\t", "")
63 link = link?replace("\n\t", "")
64 />
65 </#if>
66
67 <#if articleXml.selectNodes("dynamic-element[@name='CampoDeTexto47994077']")??>
68 <#assign contRelacionado = articleXml.selectNodes("dynamic-element[@name='CampoDeTexto47994077']")!""
69 />
70 </#if>
71
72 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='CampoDeTexto12713402']")??>
73 <#assign imagem = articleXml.selectSingleNode("dynamic-element[@field-reference='CampoDeTexto12713402']").getStringValue()!""
74 imagem = imagem?replace("\n\t\t", "")
75 imagem = imagem?replace("\n\t", "")
76 >
77 <#--if imagem?? && imagem?trim != "">
78 <#assign
79 jsonObject = JSONFactoryUtil.createJSONObject(imagem)
80 fileEntryId = jsonObject.getLong("fileEntryId")
81 >
82 <#if fileEntryId != 0>
83 <#assign
84 fileEntry = PortletFileRepositoryUtil.getPortletFileEntry(fileEntryId)
85 fileEntryURL = PortletFileRepositoryUtil.getDownloadPortletFileEntryURL(themeDisplay, fileEntry,"")
86 >
87 </#if>
88 </#if-->
89 </#if>
90
91 <#assign categorias = AssetCategoryLocalService.getCategoryNames(entry.getClassName(), entry.getClassPK())!"">
92 <#if categorias?is_sequence>
93 <#if categorias?seq_contains("Notícias")>
94 <#assign tipoDePost = "Notícia" >
95 </#if>
96 <#if categorias?seq_contains("Notas Técnicas e Relatórios")>
97 <#assign tipoDePost = "Nota Técnica e Relatório" >
98 </#if>
99 <#if categorias?seq_contains("Artigos")>
100 <#assign tipoDePost = "Artigo" >
101 </#if>
102 </#if>
103
104
105 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text26813532']")??>
106 <#assign
107 autorId = articleXml.selectSingleNode("dynamic-element[@field-reference='Text26813532']").getStringValue()!""
108 autorId = autorId?replace("\n\t\t", "")
109 autorId = autorId?replace("\n\t", "")
110 >
111 </#if>
112 <#assign
113 autorArticleId = ""
114 commentsCount = mbMessageLocalService.getDiscussionMessagesCount(entry.getClassName(), entry.getClassPK(), 0)!"0"
115 >
116 <#if orgOrUser == "user" >
117 <#if autorId != "" && autorId??>
118 <#assign
119 autor = UserLocalService.fetchUser(autorId?number)!""
120 autorArticleId = autor.getExpandoBridge().getAttribute("journal-article")!"0"
121 />
122 <#if autor != "">
123 <#assign autor = autor.getFullName()!"">
124 <#else>
125 <#assign autor = "Anônimo" >
126 </#if>
127 <#else>
128 <#assign autor = "Anônimo" >
129 </#if>
130
131
132
133 <#if autorArticleId != "0" && autorArticleId != "" && autor != "Anônimo">
134 <#assign autorArticle = JournalArticleLocalService.getLatestArticle(themeDisplay.getLayout().getGroupId(), autorArticleId?string) >
135 <#assign urlWC = autorArticle.getUrlTitle()!"">
136 </#if>
137
138 </#if>
139
140 <#if orgOrUser == "org" >
141 <#assign orgId = tagName?keep_after("organization-")
142 organization = OrganizationLocalService.fetchOrganization(orgId?number)!"">
143 <#if organization != "">
144 <#assign orgArticleId = organization.getExpandoBridge().getAttribute("journal-article")
145 orgJournalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),orgArticleId?c)
146 urlWC = orgJournalArticle.getUrlTitle()!""
147 autor = organization.getName()!"">
148 </#if>
149 </#if>
150
151 <#if themeDisplay.isSignedIn() >
152 <#if tagName?contains("organization-")>
153 <#assign userIsAdmin = OrganizationLocalService.hasUserOrganization(themeDisplay.getUserId(), orgId?number)>
154 <#else>
155 <#if autorId != "">
156 <#if autorId?number == themeDisplay.getUserId()>
157
158 <#assign userIsAdmin = true>
159 </#if>
160 </#if>
161 </#if>
162
163
164 </#if>
165
166
167
168 <div class="post-lista-item">
169 <div class="lista-checkmark">
170 <#if categorias?seq_contains("aprovado") > <i title="Aprovado" style="color: #4ECD66" class="fa-solid fa-circle-check"></i> </#if>
171 <#if categorias?seq_contains("pendente") > <i title="Em análise" style="color: #D90000"class="fa-solid fa-spinner"></i> </#if>
172 <#if categorias?seq_contains("recusado") > <i title="Recusado" style="color: #D90000"class="fa-solid fa-exclamation-circle"></i> </#if>
173
174 </div>
175
176 <div class="lista-titulo">
177 <h5>${tipoDePost}</h5>
178 </div>
179
180 <div class="lista-arrow">
181 <button style="padding: 0;" class="btn" type="button" data-toggle="collapse" data-target="#collapseID${JournalArticleID}" aria-expanded="false" aria-controls="collapseID${JournalArticleID}">
182 <i class="fa-solid fa-chevron-down"></i>
183 </button>
184 </div>
185
186 <div class="lista-desc">
187 <#if imagem?trim != "" >
188 <div>
189 <img src="${imagem}" />
190 </div>
191 <#else>
192 <div class="bioec_post_img_placeholder">
193 <i class="fa-solid fa-image"></i>
194 sem imagem
195 </div>
196 </#if>
197 <p>${tituloDoPost}</p>
198 </div>
199
200 <div class="lista-collapse collapse" id="collapseID${JournalArticleID}">
201 <#if desc !="">
202 <div class="lista-details">
203 <div class="lista-contato">
204 ${desc}
205 </div>
206 </div>
207 </#if>
208
209 <#if categorias?seq_contains("recusado") >
210 <div style="border-top: 1px solid #E8ECEF; font-weight: bold; padding-top: 24px;">
211 <p>Conteúdo Em Análise Pelo Cetiqt:</p>
212 <p>Conteúdo recusado pelo CETIQT por violar as políticas de privacidade.</p>
213 </div>
214 </#if>
215
216 <div class="lista-footnote">
217 <div>
218 <span class="post-type" style="text-transform: uppercase;" id="postInputTipodePost${JournalArticleID}" vlaue="${tipoDePost}">${tipoDePost}</span> <span class="barra-pipe"> | </span>
219 <span class="lista-date">${journalArticle.getDisplayDate()?string('dd/MM/yyyy')}</span> | <span class="lista-commentNumber">${commentsCount} comentários</span> <span class="barra-pipe"> | </span> <span class="lista-author">Publicado por <a <#if urlWC != ''>href="/w/${urlWC}</#if>">${autor}</a></span>
220 </div>
221 <#if userIsAdmin>
222 <div class="buttonsActions">
223 <div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modalEditPost${JournalArticleID}">
224 <i class="fa-solid fa-edit"></i>
225 </div>
226 <div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modal-post-${entry.getClassPK()}">
227 <i class="fa-solid fa-trash-can"></i>
228 </div>
229 </div>
230 </#if>
231 </div>
232 </div>
233 </div>
234
235
236 <#if userIsAdmin>
237 <div style="display: none;" id="modal-post-${entry.getClassPK()}" class="modal fade" role="dialog">
238 <div class="modal-dialog modal-lg" role="document">
239 <div class="modal-content">
240 <div class="modal-header" >
241 <h4 class="m-0">Remover Publicação</h4>
242 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
243 <span aria-hidden="true">
244 <i class="fa-solid fa-close"></i>
245 </span>
246 </button>
247 </div>
248 <div class="modal-body">
249 <h5>Você tem certeza que deseja remover essa publicação?</h5>
250 <div>
251 Ao clicar em continuar, a publicação será removida do seu perfil.
252 </div>
253 </div>
254 <div class="modal-footer justify-content-end">
255 <button class="bioec_secondary_button" data-dismiss="modal">CANCELAR</button>
256 <button class="bioec_primary_button" type="button" onclick="excluirPost${JournalArticleID}()">CONTINUAR</button>
257 </div>
258 </div>
259 </div>
260 </div>
261
262 <#-- modal edição -->
263
264
265 <div style="display: none" id="modalEditPost${JournalArticleID}" class="modal fade bioec-profile-edit-post-modal" role="dialog">
266 <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
267 <form class="form-group modal-content" id="formularioEditPost${JournalArticleID}">
268 <div id="editPostModal-l1${JournalArticleID}" class="editPostModal-l1 modal-header">
269 <h5>Editar ${tipoDePost}</h5>
270 <button
271 type="button"
272 class="close"
273 data-dismiss="modal"
274 aria-label="Close"
275 >
276 <span aria-hidden="true">×</span>
277 </button>
278 </div>
279
280 <div id="editPostModal-l2${JournalArticleID}" class="editPostModal-l2 modal-body">
281 <div id="editPostTitle${JournalArticleID}" class="postTitle">
282 <label class="reqLabel" for="editPostInputTitle${JournalArticleID}"
283 >Título</label
284 >
285 <input
286 id="editPostInputTitle${JournalArticleID}"
287 class="postInputTitle"
288 type="text"
289 value="${tituloDoPost}"
290 placeholder="Inserir um título"
291 required
292 />
293 </div>
294 <div id="editPostDesc${JournalArticleID}" class="postDesc">
295 <label class="reqLabel" for="editPostInputDesc${JournalArticleID}"
296 >Texto principal</label
297 >
298 <textarea
299 id="editPostInputDesc${JournalArticleID}"
300 class="postInputDesc"
301 rows="7"
302 style="border: 1px solid #bebebe"
303 required
304 >${desc}</textarea>
305 </div>
306
307 <div id="editPostImg${JournalArticleID}" class="postImg">
308 <div style="display: flex; flex-direction: column; gap: 8px">
309 <label>Imagem de ${tipoDePost}</label>
310 <label
311 class="btn carregarImagemPost"
312 id="carregarImagemPost${JournalArticleID}"
313 for="inputCarregarImagemPost${JournalArticleID}"
314 style="font-size: 16px; cursor: pointer"
315 >CARREGAR IMAGEM</label
316 >
317 <input
318 id="inputCarregarImagemPost${JournalArticleID}"
319 class="inputCarregarImagemPost"
320 type="file"
321 accept="image/*"
322 />
323 <input class="d-none inputPostBase64" id="inputPostBase64${JournalArticleID}" value="${imagem}" />
324 <button type="button" id="removerImagemPost${JournalArticleID}" class="removerImagemPost <#if imagem == "" || imagem?? == false> d-none </#if>">
325 <i class="fa fa-trash"></i> Remover imagem
326 </button>
327
328 </div>
329 <div id="imagemCarregadaPost${JournalArticleID}" class="imagemCarregadaPost" style="background-image: url(${imagem})"></div>
330 </div>
331
332 <div id="postLink${JournalArticleID}" class="postLink">
333 <label for="postInputLinkMoreInfo${JournalArticleID}">Link para saber mais</label>
334 <small id="postLinkMoreInfo${JournalArticleID}" class="postLinkMoreInfo">
335 Espaço opcional para adicionar um link externo com mais
336 informações sobre o assunto.
337 </small>
338 <input
339 id="postInputLinkMoreInfo${JournalArticleID}"
340 type="text"
341 placeholder="Inserir link"
342 aria-describedby="postLinkMoreInfo${JournalArticleID}"
343 value="${link}"
344 />
345 </div>
346
347 <div id="editContentRel${JournalArticleID}">
348 <div style="display: flex; flex-direction: column; gap: 8px">
349 <label for="conteudoRelacionadoInput${JournalArticleID}">Conteúdos relacionados</label>
350 <small id="conteudoRelacionado${JournalArticleID}">
351 Espaço opcional para adicionar conteúdos relacionados de notícias ou artigos do Portal de Bioeconomia.
352 </small>
353
354 <#assign containerLink = []
355 containerId = [] />
356
357 <#assign i = 0 />
358
359 <#list contRelacionado as links>
360 <#assign valLink = links.getStringValue()
361 valLink = valLink?replace("\n\t\t", "")
362 valLink = valLink?replace("\n\t", "") />
363
364 <#list journalArticles as entrada>
365 <#assign
366 checkId = entrada.getId()?string
367 articleXml = entrada.getDocument().getRootElement()
368 titleInput = articleXml.selectSingleNode("dynamic-element[@field-reference='Text33341198']").getStringValue()
369 titleInput = titleInput?replace("\n\t\t", "")
370 titleInput = titleInput?replace("\n\t", "") />
371
372 <#if valLink = checkId>
373 <#assign containerLink += [titleInput] />
374 <#assign containerId += [checkId] />
375 </#if>
376 </#list>
377
378 </#list>
379
380 <#list 1..4 as j>
381
382 <input class="form-control search-select-post postName-${JournalArticleID}-${j}" list="postList-${j}" id="${containerId[i]!''}" placeholder="Selecione nova publicação" value="${containerLink[i]!''}">
383
384 <datalist id="postList-${j}" class="contRel${JournalArticleID}">
385 <#list journalArticles as entry>
386 <#assign
387 postId = entry.getId()?string
388 articleXml = entry.getDocument().getRootElement()
389 titulo = articleXml.selectSingleNode("dynamic-element[@field-reference='Text33341198']").getStringValue()
390 titulo = titulo?replace("\n\t\t", "")
391 titulo = titulo?replace("\n\t", "")
392 categorias = AssetCategoryLocalService.getCategoryNames("com.liferay.journal.model.JournalArticle", entry.resourcePrimKey)!""
393 />
394 <option value="${titulo}" id="${postId}">
395 Categorias: ${categorias?join(", ")}
396 </#list>
397 </datalist>
398 <#assign i = i + 1 />
399 </#list>
400
401 </div>
402 </div>
403
404
405
406
407 </div>
408 <div class="importantText">
409 <p>
410 Importante: O conteúdo enviado passará por um processo interno de
411 aprovação. Só então o conteúdo adicionado aparecerá no portal.
412 </p>
413 </div>
414 <div id="editPostModal-l3${JournalArticleID}" class="editPostModal-l3 modal-footer">
415 <button class="btn button-empty" id="editPost-saveAndClose${JournalArticleID}">
416 SALVAR E FECHAR
417 </button>
418 </div>
419 </form>
420 </div>
421 </div>
422
423 </#if>
424
425 <script>
426
427 <#if userIsAdmin>
428 function validImageSize(base64 = "") {
429 const decoded = atob(base64.substring(base64.indexOf(",") + 1));
430 const sizeMB = decoded.length / 1e6;
431 console.log("MB: " + decoded.length / 1e6);
432 if (sizeMB > 10) {
433 Liferay.Util.openToast({
434 message: "O tamanho da imagem não deve ultrapassar 10 MB.",
435 type: "danger",
436 title: "",
437 toastProps: {
438 autoClose: 5000
439 }
440 });
441 return false;
442 }
443 return true;
444 }
445
446
447
448
449
450 function editPost${JournalArticleID}() {
451 Liferay.Util.openToast({
452 message: "Enviando requisição",
453 type: "info",
454 title: "",
455 });
456 $("#editPost-saveAndClose").prop("disabled", true);
457
458 var conteudoRelNew = [];
459 var totalLists = document.getElementsByClassName("contRel${JournalArticleID}");
460
461 for (var i = 1; i < totalLists.length + 1; i++){
462 var postSel = document.getElementsByClassName("postName-${JournalArticleID}-" + i)[0];
463 var valueId = postSel.value;
464 var idPost = document.querySelector("option[value='"+valueId+"']").id;
465 conteudoRelNew.push(idPost);
466 }
467
468
469 const postData = {
470 "titulo": document.getElementById("editPostInputTitle${JournalArticleID}").value,
471 "conteudo": document.getElementById("editPostInputDesc${JournalArticleID}").value,
472 "imagem": document.getElementById("inputPostBase64${JournalArticleID}").value,
473 "link": document.getElementById("postInputLinkMoreInfo${JournalArticleID}").value,
474 "conteudoRelacionado": conteudoRelNew
475 }
476
477 fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/postagem/${JournalArticleFrontId}", {
478 method: 'PUT',
479 "headers": {
480 "x-csrf-token": Liferay.authToken,
481 "Content-Type": "application/json"
482 },
483 body: JSON.stringify(postData),
484
485 }).then((res) => {
486 console.log(res);
487 if (res.status == 200) {
488 Liferay.Util.openToast({
489 message:
490 "Publicação editada com sucesso. Após a submissão, será iniciado o processo interno de aprovação do conteúdo enviado. Só então o conteúdo submetido aparecerá no portal.",
491 type: "success",
492 title: "",
493 toastProps: {
494 autoClose: 5000,
495 }
496
497 });
498
499 document.getElementById("formularioEditPost${JournalArticleID}").reset();
500 document.getElementById("imagemCarregadaPost${JournalArticleID}").style.backgroundImage =
501 "";
502
503 } else {
504 Liferay.Util.openToast({
505 message: "Erro ao adicionar Artigo",
506 type: "danger",
507 title: "",
508 toastProps: {
509 autoClose: 5000,
510 }
511 });
512 }
513
514 });
515
516 setTimeout(function () {
517 location.reload();
518 }, 2000);
519
520 }
521
522
523 function encodeEditImageAsURL${JournalArticleID}() {
524 let file = document.getElementById("inputCarregarImagemPost${JournalArticleID}").files[0];
525 let reader = new FileReader();
526 reader.onloadend = () => {
527 if (reader.result) {
528 if (!validImageSize(reader.result)) return;
529 try {
530 const pic_container = document.getElementById("imagemCarregadaPost${JournalArticleID}");
531 const base64_input = document.getElementById("inputPostBase64${JournalArticleID}");
532 base64_input.value = reader.result;
533 pic_container.style.backgroundImage = "url(" + reader.result + ")";
534
535 const removeImageButton = document.getElementById(
536 "removerImagemPost${JournalArticleID}"
537 );
538 removeImageButton.classList.remove("d-none");
539 } catch (error) {
540 console.error(error);
541 }
542 }
543 };
544 reader.readAsDataURL(file);
545 }
546
547 document
548 .querySelector("#formularioEditPost${JournalArticleID}")
549 .addEventListener("submit", (event) => {
550 event.preventDefault();
551 editPost${JournalArticleID}();
552 });
553
554 function removeImagemPost${JournalArticleID}() {
555 try {
556 const file_input = document.getElementById("inputCarregarImagemPost${JournalArticleID}");
557 const pic_container = document.getElementById("imagemCarregadaPost${JournalArticleID}");
558 const base64_input = document.getElementById("inputPostBase64${JournalArticleID}");
559 file_input.value = null;
560 base64_input.value = "";
561 pic_container.style.backgroundImage = null;
562
563 const removeImageButton = document.getElementById("removerImagemPost${JournalArticleID}");
564 removeImageButton.classList.add("d-none");
565 } catch (error) {
566 console.error(error);
567 }
568 }
569
570 document
571 .getElementById("removerImagemPost${JournalArticleID}")
572 .addEventListener("click", removeImagemPost${JournalArticleID});
573
574
575 document
576 .getElementById("inputCarregarImagemPost${JournalArticleID}")
577 .addEventListener("change", encodeEditImageAsURL${JournalArticleID});
578
579
580 function excluirPost${JournalArticleID}() {
581 Liferay.Util.openToast({
582 message: "Enviando requisição",
583 type: "info",
584 title: ""
585 });
586
587 fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/postagem/${JournalArticleFrontId}", {
588 method: 'DELETE',
589 "headers": {
590 "x-csrf-token": Liferay.authToken,
591 "Content-Type": "application/json"
592 }
593 })
594 .then(res => {
595 if(res.status == 200) {
596 Liferay.Util.openToast({
597 message: "Publicação excluida com sucesso",
598 type: "success",
599 title: "",
600 toastProps: {
601 autoClose: 5000
602 }
603 })
604 setTimeout(function(){ location.reload(); }, 2000)
605 } else {
606 Liferay.Util.openToast({
607 message: "Erro ao excluir publicação",
608 type: "danger",
609 title: "",
610 toastProps: {
611 autoClose: 5000
612 }
613 })
614 }
615 });
616 }
617
618
619 </#if>
620
621
622
623 var button = document.querySelector('[data-target="#collapseID${JournalArticleID}"]');
624
625 var chevron = button.querySelector("i.fa-solid");
626
627 button.addEventListener("click", function () {
628 if (chevron.classList.contains("fa-chevron-up")) {
629 chevron.classList.remove("fa-chevron-up");
630 chevron.classList.add("fa-chevron-down");
631 } else {
632 chevron.classList.remove("fa-chevron-down");
633 chevron.classList.add("fa-chevron-up");
634 }
635 });
636
637
638
639
640 </script>
641
642
643
644
645 </#list>
646 </#if>
647 </div>
648 </div>
649
650 <style>
651 .bioec_post_img {
652 overflow: hidden;
653 background-size: contain;
654 background-position: center;
655 background-repeat: no-repeat;
656 }
657
658 .bioec_post_img_placeholder {
659 width: 140px;
660 height: 140px;
661 background-color: #E8ECEF;
662 display: flex;
663 flex-direction: column;
664 align-items: center;
665 justify-content: center;
666 font-size: 14px;
667 color: #5B5C61;
668 }
669
670 .bioec_post_img_placeholder i {
671 font-size: 44px;
672 }
673
674
675 .pagination-items-per-page.active > a,
676 .pagination-items-per-page.active > button,
677 .pagination-items-per-page.show > a,
678 .pagination-items-per-page.show > button,
679 .page-item.active .page-link,
680 .page-item.show .page-link{
681 border-color: #4ECD66;
682 background-color: #4ECD66;
683 }
684
685 .pagination-results,
686 .pagination-items-per-page > a,
687 .pagination-items-per-page > button,
688 .pagination-items-per-page > a:hover,
689 .pagination-items-per-page > button:hover,
690 .page-link{
691 color: #4ebe66;
692 }
693
694 .bioec-profile-post-main{
695 display: flex;
696 gap: 40px;
697 flex-direction: column;
698 padding-bottom: 20px;
699 }
700 .bioec-profile-post-main h5{
701 font-weight: 700;
702 }
703 .bioec-profile-post-main h5, .bioec-profile-post-main p{
704 color: #5B5C61;
705 margin-bottom: 0px;
706 font-size: 16px;
707
708 }
709
710 .bioec-profile-post-main #post-lista-container>div{
711 border: 1px #BEBEBE solid;
712 padding: 24px 24px 0 24px;
713 margin-bottom: 40px;
714 display: grid;
715 grid-row-gap: 24px;
716 grid-template-columns: 24px 12px 1fr 15px;
717 grid-template-areas:
718 "ck . tit arrw"
719 "desc desc desc desc"
720 "clps clps clps clps";
721 }
722
723 .bioec-profile-post-main .lista-checkmark { grid-area: ck; }
724 .bioec-profile-post-main .lista-checkmark i {
725 font-size: 24px;
726 }
727
728 .bioec-profile-post-main .lista-pic { grid-area: pic; display: flex; justify-content: center;}
729 .bioec-profile-post-main .lista-arrow { grid-area: arrw; }
730
731 .bioec-profile-post-main .lista-titulo {
732 grid-area: tit;
733 display: flex;
734 flex-direction: column;
735 justify-content: center;
736
737 }
738
739 .bioec-profile-post-main .lista-titulo h5{
740 margin-bottom: 0px;
741 font-weight: 400;
742 font-size: 16px;
743 line-height: 150%;
744 text-transform: uppercase;
745 }
746
747 .bioec-profile-post-main .lista-desc {
748 grid-area: desc;
749 display: flex;
750 align-items: center;
751 gap: 46px;
752 }
753
754 .bioec-profile-post-main .lista-desc > div {
755 height: 138px;
756 }
757
758 .bioec-profile-post-main .lista-desc img {
759 height: 100%;
760 }
761
762 .bioec-profile-post-main .lista-desc p {
763 margin: 0;
764 font-weight: 700;
765 font-size: 16px;
766 line-height: 150%;
767 }
768
769 .bioec-profile-post-main a{
770 color: #5B5C61;
771 }
772
773 .post-port{
774 border: 1px #BEBEBE solid;
775 padding: 24px;
776 display: flex;
777 flex-direction: column;
778 align-items: center;
779 gap: 24px;
780 }
781
782 .post-port p{
783 text-align: center;
784
785 }
786
787 .post-port div{
788 display: flex;
789 justify-content: space-between;
790 width: min(558px, 100%);
791 }
792
793 .button-empty {
794 border: solid 1px #4ECD66;
795 padding: 8px 24px;
796 color: #333244;
797 transition: 250ms;
798 }
799
800 .button-empty:hover{
801 background-color: #4ECD66;
802 }
803
804 .button-filled {
805 background-color: #4ECD66;
806 border: solid 1px #4ECD66;
807 padding: 8px 24px;
808 color: #333244;
809 transition: 250ms;
810
811 }
812
813 .button-filled:hover{
814 background-color: transparent;
815 }
816
817 .bioec-profile-post-main .lista-footnote {
818
819 display: flex;
820 justify-content: space-between;
821 border-top: 1px solid #E8ECEF;
822 padding-top: 12px;
823 font-size: 14px;
824 font-weight: 300;
825 gap: 15px;
826 color: #5B5C61;
827
828 }
829 .lista-collapse{
830 display: flex;
831 flex-direction: column;
832 gap: 24px;
833 grid-area: clps;
834 padding-bottom: 24px;
835 }
836
837 .lista-details{
838 display: flex;
839 justify-content: flex-start;
840 gap: 24px;
841 color: #5B5C61;
842 }
843 .lista-pic img {
844 max-height: 138px;
845 max-width: 138px;
846 }
847
848 .bioec-profile-post-main p{
849
850 }
851
852 .imagemCarregadaPost {
853 height: 100px;
854 width: 100px;
855 background-size: contain;
856 background-position: center;
857 background-repeat: no-repeat;
858 }
859
860
861 .ButtonAddPost {
862 background: #4ECD66;
863 border-radius: 8px;
864 padding: 8px 24px;
865 border: none;
866 font-weight: 700;
867 color: #333244;
868 font-family: 'Roboto';
869 float: right;
870 text-transform: uppercase;
871 }
872 .ButtonAddPost:hover{
873 color: #333244;
874 text-decoration: none;
875 }
876
877 .bioec-profile-post-modal label {
878 margin: 0;
879 cursor: default;
880 font-size: 20px;
881 font-weight: 700;
882 color: #5B5C61;
883 }
884
885 .bioec-profile-post-modal div {
886 width: 100%;
887 }
888
889 #postModal-l1, .postModal-l1 {
890 padding: 18px 24px;
891 display: flex;
892 justify-content: space-between;
893 }
894
895 #postModal-l1 img, .postModal-l1 img {
896 cursor: pointer;
897 }
898
899 #postModal-l1 h5, .postModal-l1 h5 {
900 margin: 0;
901 font-size: 20px;
902 font-weight: 700;
903 color: #5B5C61;
904 }
905
906 #postModal-l2, .postModal-l2 {
907 border-top: 1px solid #E8ECEF;
908 display: grid;
909 grid-template-columns: 1fr 1fr;
910 grid-template-areas:
911 "titu nome"
912 "fone mail"
913 "desc desc"
914 "imagem ."
915 ;
916 column-gap: 24px;
917 row-gap: 40px;
918 padding: 24px;
919 }
920
921 #postModal-l2>div, .postModal-l2>div {
922 display: flex;
923 flex-direction: column;
924 gap: 8px;
925 }
926
927 #postTitle, .postTitle {
928 grid-area: titu;
929 }
930
931 #postName, .postName {
932 grid-area: nome;
933 }
934
935 #postTelephone, .postTelephone {
936 grid-area: fone;
937 }
938
939 #postEmail, .postEmail {
940 grid-area: mail;
941 }
942
943 #postBrand, .postBrand {
944 grid-area: marca;
945 }
946
947 #postModal-l2>#postImg, .editPostModal-l2>.postImg {
948 grid-area: imagem;
949 display: flex;
950 flex-direction: row;
951 }
952
953 #postDesc, .postDesc {
954 grid-area: desc;
955
956 }
957
958 #postDesc input, .postDesc input {
959 height: 80px;
960 }
961
962 .TextImportant{
963 border-bottom: 1px solid #E8ECEF;
964 padding: 24px;
965 color: #5B5C61;
966 }
967
968 .bioec-profile-post-modal input[type="text"] {
969 border-top: none;
970 border-left: none;
971 border-right: none;
972 border-bottom: 1px solid #BEBEBE;
973 width: 100%;
974 font-size: 16px;
975
976 }
977
978
979 .bioec-profile-post-modal input[type="text"]:focus-visible {
980 outline: none;
981 border-bottom: 1px solid black;
982
983 }
984
985 .bioec-profile-post-modal .ReqLabel:before {
986 content: "* ";
987 color: #D90000;
988
989 }
990
991 #inputCarregarImagemPost, .inputCarregarImagemPost {
992 display: none;
993 }
994
995 #carregarImagem, .carregarImagem {
996 padding: 8px 24px;
997 border: 1px solid #4ECD66;
998 width: fit-content;
999 transition: 250ms;
1000
1001 }
1002
1003 #carregarImagem:hover, .carregarImagem:hover {
1004 background-color: #4ECD66;
1005 }
1006
1007 .button-empty {
1008 border: solid 1px #4ECD66;
1009 padding: 8px 24px;
1010 color: #333244;
1011 transition: 250ms;
1012 font-weight: bold;
1013 }
1014
1015 .button-empty:hover {
1016 background-color: #4ECD66;
1017 }
1018
1019 .button-filled {
1020 background-color: #4ECD66;
1021 border: solid 1px #4ECD66;
1022 padding: 8px 24px;
1023 color: #333244;
1024 transition: 250ms;
1025 font-weight: bold;
1026 }
1027
1028 .button-filled:hover {
1029 background-color: transparent;
1030 }
1031
1032 #postModal-l3, .postModal-l3 {
1033 gap: 24px;
1034 display: flex;
1035 justify-content: flex-end;
1036 padding: 24px;
1037 }
1038
1039 .modal {
1040 padding: initial !important;
1041 border-radius: 4px !important;
1042
1043 }
1044
1045 .modal a.close-modal {
1046 display: none;
1047 }
1048
1049 #removerImagemPost, .removerImagemPost {
1050 background: none;
1051 border: none;
1052 outline: none;
1053 color: #5B5C61;
1054 font-size: 16px;
1055 font-weight: 900;
1056 line-height: 24px;
1057 letter-spacing: 0em;
1058 width: fit-content;
1059 margin-left: 16px;
1060 }
1061
1062
1063 @media(max-width: 964px){
1064 .lista-pic img {
1065 width: 100%;
1066 max-height: unset;
1067 max-width: unset;
1068
1069 }
1070 }
1071
1072 @media (max-width: 550px) {
1073 #postModal-l2, .postModal-l2 {
1074 display: flex;
1075 flex-direction: column;
1076 }
1077
1078 #postModal-l3, .postModal-l3 {
1079 display: flex;
1080 flex-direction: column;
1081 }
1082 }
1083
1084 @media(max-width: 450px){
1085 .bioec-profile-post-main .lista-details{
1086 flex-direction: column;
1087 }
1088
1089 .lista-contato{
1090 text-align: center;
1091 }
1092
1093 .bioec-profile-post-main .lista-footnote{
1094 flex-direction: column;
1095 gap: 10px;
1096 align-items: flex-end;
1097 text-align: right;
1098 }
1099 }
1100
1101
1102
1103
1104
1105 .bioec-profile-edit-post-modal label {
1106 margin: 0;
1107 cursor: default;
1108 font-size: 20px;
1109 font-weight: 700;
1110 color: #5b5c61;
1111 }
1112
1113 .bioec-profile-edit-post-modal small {
1114 font-weight: 300;
1115 font-size: 14px;
1116 line-height: 150%;
1117 color: #5b5c61;
1118 margin-top: -4px;
1119 }
1120
1121 .bioec-profile-edit-post-modal div {
1122 /* width: 100%; */
1123 }
1124
1125 #editPostModal-l1, .editPostModal-l1 {
1126 padding: 18px 24px;
1127 display: flex;
1128 justify-content: space-between;
1129 }
1130
1131 #editPostModal-l1 h5, .editPostModal-l1 h5 {
1132 line-height: 150%;
1133 margin: 0;
1134 font-size: 20px;
1135 font-weight: 700;
1136 color: #5b5c61;
1137 }
1138
1139 #editPostModal-l2, .editPostModal-l2 {
1140 padding: 24px;
1141 }
1142
1143 #editPostModal-l2 > div, .editPostModal-l2 > div {
1144 display: flex;
1145 flex-direction: column;
1146 gap: 8px;
1147 margin-bottom: 40px;
1148 }
1149
1150 #editPostModal-l2 > div:last-child, .editPostModal-l2 > div:last-child {
1151 margin-bottom: -4px;
1152 }
1153
1154 #editPostModal-l2 > #editPostImg, .editPostModal-l2 > .editPostImg {
1155 /* grid-area: imagem; */
1156 display: flex;
1157 flex-direction: row;
1158 }
1159
1160 .importantText {
1161 padding: 24px;
1162 color: #5b5c61;
1163 }
1164
1165 .importantText p {
1166 margin-bottom: 0;
1167 }
1168
1169 .bioec-profile-edit-post-modal input[type="text"] {
1170 border-top: none;
1171 border-left: none;
1172 border-right: none;
1173 border-bottom: 1px solid #bebebe;
1174 width: 100%;
1175 font-size: 16px;
1176 }
1177
1178
1179 .bioec-profile-edit-post-modal
1180 input[type="text"]:focus-visible {
1181 outline: none;
1182 border-bottom: 1px solid black;
1183 }
1184
1185 .bioec-profile-edit-post-modal .reqLabel:before {
1186 content: "* ";
1187 color: #d90000;
1188 }
1189
1190 #imagemCarregadaPost, .imagemCarregadaPost {
1191 height: 110px;
1192 width: 110px;
1193 margin-left: 3rem;
1194 background-size: contain;
1195 background-position: center;
1196 background-repeat: no-repeat;
1197 }
1198
1199 #removerImagemPost, .removerImagemPost {
1200 background: none;
1201 cursor: pointer;
1202 border: none;
1203 outline: none;
1204 color: #5b5c61;
1205 font-size: 16px;
1206 font-weight: 900;
1207 line-height: 24px;
1208 letter-spacing: 0em;
1209 width: fit-content;
1210 margin-left: 16px;
1211 }
1212
1213 #inputCarregarImagemPost, .inputCarregarImagemPost {
1214 display: none;
1215 }
1216
1217 #carregarImagemPost, .carregarImagemPost {
1218 padding: 8px 24px;
1219 border: 1px solid #4ecd66;
1220 width: fit-content;
1221 transition: 250ms;
1222 border-radius: 8px;
1223 }
1224
1225 #carregarImagemPost:hover, .carregarImagemPost:hover {
1226 background-color: #4ecd66;
1227 }
1228
1229 .button-empty {
1230 border: solid 1px #4ecd66;
1231 padding: 8px 24px;
1232 color: #333244;
1233 transition: 250ms;
1234 font-weight: bold;
1235 }
1236
1237 .button-empty:hover {
1238 background-color: #4ecd66;
1239 }
1240
1241 .button-filled {
1242 background-color: #4ecd66;
1243 border: solid 1px #4ecd66;
1244 padding: 8px 24px;
1245 color: #333244;
1246 transition: 250ms;
1247 font-weight: bold;
1248 }
1249
1250 .button-filled:hover {
1251 background-color: transparent;
1252 }
1253
1254 #editPostModal-l3, .editPostModal-l3 {
1255 gap: 24px;
1256 display: flex;
1257 justify-content: flex-end;
1258 padding: 15px;
1259 }
1260
1261 #editPostModal-l3 button, .editPostModal-l3 button {
1262 text-transform: uppercase;
1263 border-radius: 8px;
1264 }
1265
1266 @media (max-width: 550px) {
1267 #editPostModal-l2, .editPostModal-l2 {
1268 display: flex;
1269 flex-direction: column;
1270 }
1271
1272 #editPostModal-l3, .editPostModal-l3 {
1273 display: flex;
1274 flex-direction: column;
1275 }
1276 }
1277
1278 /* .modal {
1279 padding: initial !important;
1280 border-radius: 4px !important;
1281 height: initial !important;
1282 }
1283
1284 .modal a.close-modal {
1285 display: none;
1286 } */
1287
1288 /* final */
1289 .bioec-profile-post-main .lista-footnote .buttonsActions {
1290 display: flex;
1291 gap: 17px;
1292 }
1293
1294 @media (max-width: 992px) {
1295 #post-lista-container {
1296 padding-inline: 15px;
1297 }
1298 }
1299
1300 @media (max-width: 768px) {
1301 .bioec-profile-post-main .lista-desc {
1302 gap: 24px;
1303 flex-direction: column-reverse;
1304 }
1305 .bioec-profile-post-main .lista-footnote {
1306 flex-direction: column;
1307 align-items: center;
1308 }
1309 .bioec-profile-post-main .lista-footnote > div {
1310 text-align: center;
1311 }
1312 .bioec-profile-post-main .lista-footnote .post-type,
1313 .bioec-profile-post-main .lista-footnote .barra-pipe {
1314 display: none;
1315 }
1316 .bioec-profile-post-main .lista-footnote .lista-author {
1317 display: flex;
1318 gap: 4px;
1319 justify-content: center;
1320 }
1321 .bioec-profile-post-main .lista-footnote .buttonsActions {
1322 width: 100%;
1323 justify-content: space-between;
1324 }
1325 }
1326
1327
1328 </style>