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 messagesList = document.getElementById('messages-list');
const typingIndicator = document.getElementById('typing-indicator'); 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) { function scrollToBottom(force = false) {
if (!messagesList) return; if (!messagesList) return;
@ -3580,6 +3602,18 @@ document.addEventListener('DOMContentLoaded', () => {
}); });
document.addEventListener('click', async (e) => { 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 // Delete event
const deleteBtn = e.target.closest('.delete-event-btn'); const deleteBtn = e.target.closest('.delete-event-btn');
if (deleteBtn) { if (deleteBtn) {

View File

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