apply languages
This commit is contained in:
20
templates/chat_window.html
Normal file
20
templates/chat_window.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<div class="row" style="bottom: 0; height: 90%; position: absolute; top: 5%; left: 10%; right: 10%;">
|
||||
<div class="col-3" style="overflow-y: scroll;">
|
||||
<h3>Чаты</h3>
|
||||
{% for membership in memberships %}
|
||||
<div {% if membership.chat == current_chat %}style="background-color: #DDDDDD;"{% endif %}>
|
||||
<hr>
|
||||
<h4>{{ membership.chat.name }}</h4>
|
||||
<b>{{ membership.chat.last_message.sender.username }}</b>: {{ membership.chat.last_message.text }} {% if not membership.chat.last_message.is_read %}<i class="fa fa-circle"></i>{% endif %}
|
||||
<hr>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="col-9" style="position: relative; align-content: end;">
|
||||
<div style="position: absolute; bottom: 0; right: 0; left: 0;">
|
||||
{% for message in messages %}
|
||||
<b>{{ message.sender.username }}</b>: {{ message.text }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
25
templates/chats.html
Normal file
25
templates/chats.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{% extends 'base_main.html' %}
|
||||
|
||||
{% block scripts %}
|
||||
var chat_id = 1;
|
||||
var page = 1;
|
||||
function doPoll() {
|
||||
jQuery.get('/messaging/chat_window?chat_id=' + chat_id.toString() + '&page=' + page.toString(), function(data) {
|
||||
var e = document.getElementById('chats');
|
||||
e.innerHTML = data;
|
||||
setTimeout(function() {doPoll()}, 1000);
|
||||
})
|
||||
}
|
||||
{% endblock %}
|
||||
|
||||
{% block onload %}doPoll(){% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<div id="chats"></div>
|
||||
<div class="row">
|
||||
<div class="col-3"></div>
|
||||
<div class="col-9" style="position: absolute; bottom: 0;">
|
||||
<textarea name="text" style="width: 100%; height: 80px; resize: none;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user