projet_php/views/_partial/preview.tpl
2026-03-03 13:13:06 +01:00

107 lines
5.4 KiB
Smarty

<article class="col-md-3 mb-5 {if isset($smarty.session.user) and $smarty.session.user.user_status == 2} pb-5 {/if}" style="border-radius: 100px ;">
<div class="card h-100 shadow article-card rounded-4" style="border-width: 2px; overflow: hidden;">
<div class="ratio ratio-4x3">
<a href="index.php?ctrl=project&action=display&id={$objProject->getId()}">
<img src="{$smarty.env.IMG_PROJECT_PATH}{if ($smarty.env.IMG_PROJECT_PATH|cat:$objProject->getThumbnail())|file_exists}{$objProject->getThumbnail()}{else}{math equation="rand(1,4)"}.jpg{/if}"
class="w-100 h-100 object-fit-cover"
{if $objProject->getCreatorName()|stripos:'minou' !== false}
style =" box-shadow: 0 0 0 4px #000; "{/if}
alt=""
loading="lazy">
</a>
</div>
<div class="card-body p-3 bg-light" {if $objProject->getCreatorName()|stripos:'minou' !== false}style=" background-color: #ff8c00 !important; /* Orange tigre */
background-image: repeating-linear-gradient(
45deg,
transparent,
transparent 30px,
rgba(0, 0, 0, 0.15) 30px,
rgba(0, 0, 0, 0.15) 60px
) !important;
color: #000 !important;
position: relative;
z-index: 1;"{/if}>
<div class="d-flex align-items-start gap-3">
<a href="index.php?ctrl=user&action=user&pseudo={$objProject->getCreatorname()}">
<img src="{$smarty.env.IMG_USER_PATH}{if ($smarty.env.IMG_USER_PATH|cat:($objProject->getUser_image()))|file_exists}{$objProject->getUser_image()}{else}images.jpg{/if}"
class="rounded-circle flex-shrink-0 border border-2 border-white"
style="width: 64px; height: 64px; object-fit: cover; margin-top: 8px;{if $objProject->getCreatorName()|stripos:'minou' !== false}
box-shadow: 0 0 0 4px #000; {/if}"
alt="Photo de profil">
</a>
<div class="flex-grow-1">
<h3 class="h6 fw-bold mb-2 mt-1">{$objProject->getTitle()}</h3>
<p class="small text-muted mb-1">
<i class="bi bi-person"></i>
<a href="index.php?ctrl=user&action=user&pseudo={$objProject->getCreatorname()}"
class="text-decoration-none text-muted"
style="position: relative; z-index: 2;
{if $objProject->getCreatorName()|stripos:'minou' !== false}font-weight: 800 !important;
text-transform: uppercase;
color: #000 !important;{/if}">
{$objProject->getCreatorname()}
</a>
</p>
<p class="small text-muted mb-0">
<i class="bi bi-geo-alt">Colmar</i>
</p>
</div>
</div>
<div class="d-flex justify-content-between align-items-center mt-3">
<small class="text-muted">
<i class="bi bi-clock"><time>{$objProject->getCreation_date()}</time></i>
</small>
{if $objProject->getStatus() != "refusé"}
<a href="index.php?ctrl=project&action=display&id={$objProject->getId()}"
class="btn btn-sm btn-primary" {if $objProject->getCreatorName()|stripos:'minou' !== false}style="
background-color: #000 !important;
color: #ff8c00 !important;
border: none !important;
font-weight: bold !important;
transition: transform 0.2s;"{/if}>
Voir →
</a>
{/if}
</div>
{if isset($smarty.session.user)}
{if $smarty.session.user.user_id == $objProject->getUser_id()}
<a href="index.php?ctrl=project&action=addedit_project&id={$objProject->getId()}"
class="btn btn-sm btn-outline-secondary mt-2 w-100"
style="position: relative; z-index: 2;">
Editer
</a>
{/if}
{/if}
</div>
{if isset($smarty.session.user)
and $smarty.session.user.user_status == 2
and $objProject->getStatus() == "en_attente"}
<div class="card-footer bg-white border-top-0 p-2">
<div class="d-flex gap-2">
<a class="btn btn-sm btn-success flex-fill"
href="?ctrl=project&action=accept&id={$objProject->getId()}"
name="toPublished">Accepter</a>
<a class="btn btn-sm btn-warning flex-fill"
href="?ctrl=project&action=refuse&id={$objProject->getId()}"
name="toRefused">Refuser</a>
<a class="btn btn-sm btn-danger flex-fill"
href="index.php?ctrl=project&action=delete&id={$objProject->getId()}"
name="toDelete"
onclick="return confirm('Attention ! Êtes-vous sûr de vouloir supprimer ce projet ? Cette action est irréversible.');">
Supprimer</a>
</div>
</div>
{elseif $objProject->getStatus() == "refusé"}
<div class="card-footer bg-white border-top-0 p-2">
<p class="text-danger fw-bold text-center mb-0 small">Projet refusé</p>
</div>
{/if}
</div>
</article>