added events to event system

This commit is contained in:
2025-05-31 19:07:29 +02:00
parent 224d4d400e
commit 2c9b302a69
12 changed files with 309 additions and 112 deletions

View File

@@ -58,7 +58,7 @@
<tbody id="notifsTableBody">
{% if notifications %}
{% for notif in notifications %}
<tr class="{% if not notif.read %}table-warning{% endif %}">
<tr class="{% if not notif.read %}table-warning{% endif %}" data-notif-id="{{ notif.id }}">
<td>{{ notif.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</td>
<td>
{% if notif.notif_type == 'account_created' %}
@@ -83,7 +83,7 @@
<span class="badge bg-secondary">{{ notif.notif_type }}</span>
{% endif %}
</td>
<td>{{ notif.sender.username if notif.sender else 'System' }}</td>
<td>{{ notif.sender.username + ' ' + notif.sender.last_name if notif.sender else 'System' }}</td>
<td>
<button class="btn btn-sm btn-secondary"
data-bs-toggle="modal"
@@ -100,14 +100,27 @@
{% endif %}
</td>
<td>
{% if not notif.read %}
<button class="btn btn-sm btn-primary mark-read" data-notif-id="{{ notif.id }}">
<i class="fas fa-check"></i> Mark as Read
</button>
{% endif %}
<button class="btn btn-sm btn-danger delete-notif" data-notif-id="{{ notif.id }}">
<i class="fas fa-trash"></i>
</button>
<div class="btn-group">
{% if notif.notif_type in ['room_invite', 'room_invite_removed'] and notif.details and notif.details.room_id %}
<a href="{{ url_for('rooms.room', room_id=notif.details.room_id) }}"
class="btn btn-sm btn-primary">
<i class="fas fa-door-open"></i> View Room
</a>
{% elif notif.notif_type in ['conversation_invite', 'conversation_invite_removed', 'conversation_message'] and notif.details and notif.details.conversation_id %}
<a href="{{ url_for('conversations.conversation', conversation_id=notif.details.conversation_id) }}"
class="btn btn-sm btn-primary">
<i class="fas fa-comments"></i> View Conversation
</a>
{% endif %}
{% if not notif.read %}
<button class="btn btn-sm btn-success mark-read" data-notif-id="{{ notif.id }}">
<i class="fas fa-check"></i> Mark as Read
</button>
{% endif %}
<button class="btn btn-sm btn-danger delete-notif" data-notif-id="{{ notif.id }}">
<i class="fas fa-trash"></i>
</button>
</div>
</td>
</tr>
{% endfor %}