Browse Source
lock and unlock chats feature
lock and unlock chats feature
models updated with lock values , course model has two group lock and professor lock options serializers updated with new fields admin panel updated for this new fields signals configured to automatically lock/unlock the chatrooms related to courses based on the boolean values of course to chat room page navigation shortcut is updated with unfold action buttons instead of html filesmaster
10 changed files with 130 additions and 20 deletions
-
23apps/chat/admin.py
-
18apps/chat/migrations/0002_roommessage_is_locked.py
-
6apps/chat/models.py
-
3apps/course/admin/course.py
-
23apps/course/migrations/0002_course_is_chat_group_lock_course_is_prof_chat_lock.py
-
23apps/course/migrations/0003_rename_is_chat_group_lock_course_is_group_chat_locked_and_more.py
-
9apps/course/models/course.py
-
5apps/course/serializers/course.py
-
28apps/course/signals.py
-
12templates/admin/chat/chatmessage/change_list.html
@ -0,0 +1,18 @@ |
|||
# Generated by Django 5.2.12 on 2026-04-26 14:28 |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('chat', '0001_initial'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='roommessage', |
|||
name='is_locked', |
|||
field=models.BooleanField(default=False, help_text='If True, only the professor and admins can send new messages.', verbose_name='Is Locked'), |
|||
), |
|||
] |
|||
@ -0,0 +1,23 @@ |
|||
# Generated by Django 5.2.12 on 2026-04-26 15:12 |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('course', '0001_initial'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='course', |
|||
name='is_chat_group_lock', |
|||
field=models.BooleanField(default=False, verbose_name='Lock Group Chat'), |
|||
), |
|||
migrations.AddField( |
|||
model_name='course', |
|||
name='is_prof_chat_lock', |
|||
field=models.BooleanField(default=False, verbose_name='Lock Private Chats with Professor'), |
|||
), |
|||
] |
|||
@ -0,0 +1,23 @@ |
|||
# Generated by Django 5.2.12 on 2026-04-26 15:18 |
|||
|
|||
from django.db import migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('course', '0002_course_is_chat_group_lock_course_is_prof_chat_lock'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RenameField( |
|||
model_name='course', |
|||
old_name='is_chat_group_lock', |
|||
new_name='is_group_chat_locked', |
|||
), |
|||
migrations.RenameField( |
|||
model_name='course', |
|||
old_name='is_prof_chat_lock', |
|||
new_name='is_professor_chat_locked', |
|||
), |
|||
] |
|||
@ -1,12 +0,0 @@ |
|||
{% extends "admin/change_list.html" %} |
|||
{% load i18n admin_urls %} |
|||
|
|||
{% block object-tools-items %} |
|||
{{ block.super }} |
|||
<li> |
|||
<a href="{% url 'admin:chat_roommessage_changelist' %}" class="unfold-button unfold-button-secondary"> |
|||
<span class="material-icons-outlined">arrow_back</span> |
|||
{% translate "Back to Chat Rooms" %} |
|||
</a> |
|||
</li> |
|||
{% endblock %} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue