feat(templates/chat): add chat-related templates
This commit is contained in:
29
home/templates/chat/admin/admin_chat.html
Normal file
29
home/templates/chat/admin/admin_chat.html
Normal file
@@ -0,0 +1,29 @@
|
||||
{% extends "wagtailadmin/base.html" %}
|
||||
{% load static i18n %}
|
||||
|
||||
{% block titletag %}
|
||||
{% trans "Chat with" %} {{ chat_user.email }}
|
||||
{% endblock titletag %}
|
||||
|
||||
{% block content %}
|
||||
{% include "wagtailadmin/shared/header.html" with title="Chat" icon="mail" %}
|
||||
<h1>{% trans "Admin Chat View" %}</h1>
|
||||
<p>{% trans "This is the admin view of the chat. Here you can manage conversations and monitor user interactions." %}</p>
|
||||
|
||||
<ul>
|
||||
{% for message in chat_messages %}
|
||||
<li>
|
||||
<strong>{{ message.sender.email }}:</strong> {{ message.content }}
|
||||
</li>
|
||||
{% empty %}
|
||||
<li>{% trans "No messages found." %}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<form action="/chat/send/{{ chat_user.id }}/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="text" name="content" placeholder="{% trans "Type your message here..." %}" required>
|
||||
<button type="submit">{% trans "Send" %}</button>
|
||||
</form>
|
||||
{% endblock content %}
|
||||
|
||||
|
||||
23
home/templates/chat/admin/admin_chat_dashboard.html
Normal file
23
home/templates/chat/admin/admin_chat_dashboard.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% extends "wagtailadmin/base.html" %}
|
||||
{% load static i18n %}
|
||||
|
||||
{% block titletag %}
|
||||
{% trans "Chat" %}
|
||||
{% endblock titletag %}
|
||||
|
||||
{% block content %}
|
||||
{% include "wagtailadmin/shared/header.html" with title="Chat" icon="mail" %}
|
||||
<h1>{% trans "Admin Chat Dashboard" %}</h1>
|
||||
<ul>
|
||||
{% for user in chats %}
|
||||
<li>
|
||||
<a href="{% url 'admin_chat' user.id %}">
|
||||
{{ user.email }}
|
||||
</a>
|
||||
</li>
|
||||
{% empty %}
|
||||
<li>{% trans "No active chats found." %}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock content %}
|
||||
|
||||
26
home/templates/chat/user_chat.html
Normal file
26
home/templates/chat/user_chat.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static i18n %}
|
||||
|
||||
{% block title %}
|
||||
{% trans "Chat" %}
|
||||
{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{% trans "Chat with Support" %}</h1>
|
||||
<p>{% trans "This is the user chat interface. Here you can communicate with our support team for assistance." %}</p>
|
||||
|
||||
<ul>
|
||||
{% for message in chat_messages %}
|
||||
<li>
|
||||
<strong>{{ message.sender.email }}:</strong> {{ message.content }}
|
||||
</li>
|
||||
{% empty %}
|
||||
<li>{% trans "No messages found." %}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<form action="/chat/send/{{ user.id }}/" method="post">
|
||||
{% csrf_token %}
|
||||
<textarea name="content" placeholder="{% trans "Type your message here..." %}"></textarea>
|
||||
<button type="submit">{% trans "Send" %}</button>
|
||||
</form>
|
||||
{% endblock content %}
|
||||
Reference in New Issue
Block a user