ReleaseV12+AnnonceManuelleRights

This commit is contained in:
Flatlogic Bot 2026-02-20 21:42:47 +00:00
parent 88493bedcd
commit 98ca1a26f2
2 changed files with 79 additions and 26 deletions

View File

@ -5,6 +5,28 @@ document.addEventListener('DOMContentLoaded', () => {
const messagesList = document.getElementById('messages-list');
const typingIndicator = document.getElementById('typing-indicator');
// Check for event description overflow
const checkEventDescriptions = () => {
document.querySelectorAll('.event-description').forEach(el => {
// Give it a tiny delay to ensure rendering is complete
setTimeout(() => {
if (el.scrollHeight <= el.clientHeight + 2) { // +2 for potential rounding issues
const btn = el.nextElementSibling;
if (btn && btn.classList.contains('read-more-btn')) {
btn.style.display = 'none';
}
} else {
const btn = el.nextElementSibling;
if (btn && btn.classList.contains('read-more-btn')) {
btn.style.display = 'inline-block';
}
}
}, 100);
});
};
checkEventDescriptions();
window.addEventListener('resize', checkEventDescriptions);
function scrollToBottom(force = false) {
if (!messagesList) return;
@ -3580,6 +3602,18 @@ document.addEventListener('DOMContentLoaded', () => {
});
document.addEventListener('click', async (e) => {
// Toggle event description
const readMoreBtn = e.target.closest('.read-more-btn');
if (readMoreBtn) {
const cardBody = readMoreBtn.closest('.card-body');
const desc = cardBody.querySelector('.event-description');
if (desc) {
desc.classList.toggle('expanded');
readMoreBtn.innerText = desc.classList.contains('expanded') ? 'Voir moins' : 'Voir plus';
}
return;
}
// Delete event
const deleteBtn = e.target.closest('.delete-event-btn');
if (deleteBtn) {

View File

@ -494,6 +494,22 @@ $projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
-webkit-box-orient: vertical;
overflow: hidden;
line-height: 1.5;
position: relative;
}
.event-description.expanded {
-webkit-line-clamp: unset;
display: block;
}
.read-more-btn {
color: var(--blurple);
cursor: pointer;
font-weight: 500;
display: inline-block;
margin-top: -10px;
margin-bottom: 15px;
}
.read-more-btn:hover {
text-decoration: underline;
}
</style>
</head>
@ -927,7 +943,6 @@ $projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
<div class="mb-2">
<h5 class="card-title text-white mb-0"><?php echo htmlspecialchars($event['title']); ?></h5>
</div>
<div class="small text-muted mb-3 fst-italic">Organisé par <?php echo htmlspecialchars($event['username']); ?></div>
<div class="event-meta small text-muted mb-3">
<div class="d-flex align-items-center mb-1">
@ -958,9 +973,10 @@ $projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
</div>
<?php endif; ?>
</div>
<div class="card-text text-muted small mb-3 event-description">
<div class="card-text text-muted small mb-1 event-description">
<?php echo parse_markdown($event['description']); ?>
</div>
<div class="read-more-btn small mb-3">Voir plus</div>
<?php if ($event['enable_reactions']): ?>
<div class="mt-3 pt-3 border-top border-secondary">
@ -988,30 +1004,33 @@ $projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
</div>
<?php endif; ?>
</div>
<div class="card-footer bg-transparent border-secondary d-flex justify-content-end align-items-center gap-2">
<?php if ($can_edit_event || $event['user_id'] == $current_user_id): ?>
<button class="btn btn-sm btn-outline-info edit-event-btn"
data-id="<?php echo $event['id']; ?>"
data-title="<?php echo htmlspecialchars($event['title']); ?>"
data-description="<?php echo htmlspecialchars($event['description']); ?>"
data-start-date="<?php echo $event['start_date']; ?>"
data-start-time="<?php echo $event['start_time']; ?>"
data-end-date="<?php echo $event['end_date']; ?>"
data-end-time="<?php echo $event['end_time']; ?>"
data-is-permanent="<?php echo $event['is_permanent']; ?>"
data-frequency="<?php echo $event['frequency']; ?>"
data-banner-color="<?php echo $event['banner_color']; ?>"
data-banner-url="<?php echo $event['banner_url']; ?>"
data-enable-reactions="<?php echo $event['enable_reactions']; ?>"
>
<i class="fa-solid fa-pen-to-square"></i>
</button>
<?php endif; ?>
<?php if ($can_delete_event || $event['user_id'] == $current_user_id): ?>
<button class="btn btn-sm btn-outline-danger delete-event-btn" data-id="<?php echo $event['id']; ?>">
<i class="fa-solid fa-trash"></i>
</button>
<?php endif; ?>
<div class="card-footer bg-transparent border-secondary d-flex justify-content-between align-items-center gap-2">
<div class="small text-muted fst-italic">Organisé par <?php echo htmlspecialchars($event['username']); ?></div>
<div class="d-flex gap-2">
<?php if ($can_edit_event || $event['user_id'] == $current_user_id): ?>
<button class="btn btn-sm btn-outline-info edit-event-btn"
data-id="<?php echo $event['id']; ?>"
data-title="<?php echo htmlspecialchars($event['title']); ?>"
data-description="<?php echo htmlspecialchars($event['description']); ?>"
data-start-date="<?php echo $event['start_date']; ?>"
data-start-time="<?php echo $event['start_time']; ?>"
data-end-date="<?php echo $event['end_date']; ?>"
data-end-time="<?php echo $event['end_time']; ?>"
data-is-permanent="<?php echo $event['is_permanent']; ?>"
data-frequency="<?php echo $event['frequency']; ?>"
data-banner-color="<?php echo $event['banner_color']; ?>"
data-banner-url="<?php echo $event['banner_url']; ?>"
data-enable-reactions="<?php echo $event['enable_reactions']; ?>"
>
<i class="fa-solid fa-pen-to-square"></i>
</button>
<?php endif; ?>
<?php if ($can_delete_event || $event['user_id'] == $current_user_id): ?>
<button class="btn btn-sm btn-outline-danger delete-event-btn" data-id="<?php echo $event['id']; ?>">
<i class="fa-solid fa-trash"></i>
</button>
<?php endif; ?>
</div>
</div>
</div>
</div>