<#-- Get the demand_type from a given id demand type --> <#function getDemandType demand_types_list id_demand_type> <#if demand_types_list?? && demand_types_list?has_content><#list demand_types_list as demand_type><#if demand_type.idDemandType?string = id_demand_type><#return demand_type> <#function getBgColor label > <#assign color = 'F2F6FF'/> <#if label?contains("TERM") || label?contains("ACQUI") > <#assign color = 'F2F6FF'/> <#elseif label?contains("COMPL") || label?contains("RÉGL") || label?contains("REGL") > <#assign color = 'FFFAE6'/> <#elseif label?contains("COUR")> <#assign color = 'F2F6FF'/> <#elseif label?contains("ANNUL")> <#assign color = 'F2F6FF'/> <#return 'background-color:#'+ color +' !important;'/> <#function getColorStatus label > <#assign color = '071F32'/> <#if label?contains("TERM") || label?contains("ACQUI") > <#assign color = '3AE932'/> <#elseif label?contains("COMPL") || label?contains("RÉGL") || label?contains("REGL") > <#assign color = 'E22C3F'/> <#elseif label?contains("COUR")> <#assign color = 'E4AB73'/> <#elseif label?contains("ANNUL")> <#assign color = '828E98'/> <#return 'color:#'+ color +' !important;'/> <#macro tabDemands listDemandDashboard class nameDashboard> <@cTable class='demands' caption='Liste des demandes'> <@cThead> <@cTr> <@cTh>Demandes <@cTh class='status'>Statut <@cTh>Date de mise à jour <@cTh>Lien <@cTbody> <#list listDemandDashboard as demandDashboard> <#assign demand = demandDashboard.demand> <#if getDemandType( demand_types_list, demand.typeId )?has_content><#assign demand_type = getDemandType( demand_types_list, demand.typeId)> <#if demand_type??> <@cTr id="${class}-${(nameDashboard)!}-${(demand.UID)!}" class="${class} bg-content demand-head" params='data-id="${(nameDashboard)!}-${(demand.UID)!}" data-type-id="${(demand.typeId)!}" style="${getBgColor(demandDashboard.status?upper_case)}"'> <@cTd params='data-label="Type : "' nospan=true> <@cInline type='strong'>${(demand_type.label)!} <#if demandDashboard.listNotification??> <#list demandDashboard.listNotification?sort_by('date') as notification> <@cText class='notif font-weight-normal mt-1'>${(notification.date?number_to_date?string["dd.MM.yyyy"])!} - ${(notification.myDashboardNotification.subject)!} <#else> <@cText class='notif font-weight-normal mt-1'>Aucune notification ! <@cTd params='data-label="Statut : " style="${getColorStatus(demandDashboard.status?upper_case)}"' class='status' nospan=true> ${(demandDashboard.status)!} <@cTd class='pe-5' params='data-label="Date :"' nospan=true> <@cSection type='div' class='d-flex flex-column justify-content-center'> <@cInline type='strong'>${(demand.modifyDate?number_to_date?string["dd.MM.yyyy"])!} <@cInline type='small'>initié le ${(demand.creationDate?number_to_date?string["dd.MM.yyyy"])!} <@cTd class='pe-5' params='data-label="Accéder au service :"' nospan=true> <#if demand_type.url?has_content> <#assign linkLabel>Accéder au service <@cInline class='visually-hidden sr-only'>${(demand_type.label)!} <@cLink href='${demand_type.url!}' label='Accéder au service' class='show-target fs-sm url-sn' target='_blank' showTarget=true /> <#if demandDashboard.listNotification??> <#list demandDashboard.listNotification?sort_by('date') as notification> <@cTr class="sub msg-${(nameDashboard)!}-${demand.UID!} notification-content" id="content-${(nameDashboard)!}-${(demand.UID)!}" params='style="display:none"'> <@cTd colspan="4" params='style="border-inline: 1px solid gray;"'> <@div class="d-flex align-items-start mb-2" params='style="gap:1.5rem"'> <@div class="media-body text-left"> <@cTitle level=3 class='h5 fs-sm main-color'>${(notification.date?number_to_date?string["dd.MM.yyyy"])!} - <@cInline type='strong'>${(notification.myDashboardNotification.subject)!} <@cBlock class='py-2 px-4'>${(notification.myDashboardNotification.message)!} <#macro filter class="" panelName="" ancre=""> <@cFormRow class=class> <@cCol cols='12 col-md-2'> <@cInput name='date' type='date' id='date'/> <@cCol cols='12 col-md-3'> <@cSelect id='cat' name='cat'> <@cOption label="Rubriques (toutes)" value=""/> <#if categoryList??> <#list categoryList as key, value> <@cOption value=key label=value /> <@cCol cols='12 col-md-3'> <@cInput name='search' id='search' placeholder='Rechercher une demande'/> <@cBtn id="searchButton" label="Rechercher" type="button" disabled=true/> <@cBtn id="resetButton" label="Réinitialiser les filtres" type="button" href='jsp/site/Portal.jsp?page=mydashboard&panel=${panelName!}#${ancre!}' params="style='display: none;padding-top: 23px; margin-inline-start: var(--spacing-2);'"/>