apply languages
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
<div class="col-9">
|
||||
<h3>
|
||||
{{ account.userinfo.surname }} {{ account.userinfo.name }}
|
||||
<span style="margin-left: 15px; margin-bottom: 20px;" class="badge badge-{% if account.userinfo.activity_status == online_status %}success{% else %}secondary{% endif %}">{{ account.userinfo.activity_status }}</span> <a href="/chat_with?username={{ account.username }}"><i class="fa fa-comments"></i></a>
|
||||
<span style="margin-left: 15px; margin-bottom: 20px;" class="badge badge-{% if account.userinfo.activity_status == online_status %}success{% else %}secondary{% endif %}">{{ account.userinfo.activity_status }}</span>
|
||||
{% if not owner %}
|
||||
<form method="POST">
|
||||
{% csrf_token %}
|
||||
|
@@ -1,43 +0,0 @@
|
||||
{% extends 'base_main.html' %}
|
||||
|
||||
{% block scripts %}
|
||||
var page = 1;
|
||||
function setPage(number) {
|
||||
page = number;
|
||||
}
|
||||
function doPoll() {
|
||||
jQuery.get('/messages?chat_id={{ chat.id }}&page=' + page.toString(), function(data) {
|
||||
var e = document.getElementById('messages');
|
||||
if (e.innerHTML !== data)
|
||||
e.innerHTML = data;
|
||||
const name = "page_num_" + page.toString();
|
||||
elem = document.getElementById(name);
|
||||
if (elem) {
|
||||
elem.className = "btn btn-dark";
|
||||
}
|
||||
setTimeout(function() {doPoll()}, 2000);
|
||||
})
|
||||
}
|
||||
{% endblock %}
|
||||
|
||||
{% block onload %}doPoll(){% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<a href="/account?username={{ chat.user.username }}" style="font-size: 40px;"><i class="fa fa-arrow-left"></i></a>
|
||||
</div>
|
||||
<div class="col">
|
||||
<img src="{{ chat.user.userinfo.profile_pic_url }}" width="50px" height="50px" style="border-radius: 50%; margin-right: 10px;">
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<p style="font-size: 40px;">{{ chat.user.username }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<form method="POST">
|
||||
{% csrf_token %}
|
||||
<textarea name="text" style="width: 100%; height: 100px;"></textarea>
|
||||
<button type="submit" class="btn btn-dark">Отправить</button>
|
||||
</form>
|
||||
<div id="messages"></div>
|
||||
{% endblock %}
|
@@ -1,33 +0,0 @@
|
||||
{% if need_pagination %}
|
||||
<div style="display: flex; justify-content: flex-end">
|
||||
<table>
|
||||
<tr>
|
||||
{% for num in count_pages %}
|
||||
<td><button class="btn btn-light" id="page_num_{{ num }}" onclick="setPage({{ num }})">{{ num }}</button></td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="container">
|
||||
{% for message in messages %}
|
||||
<div class="row" style="margin-bottom: 15px;">
|
||||
{% if message.user == user %}
|
||||
<div class="col-8"></div>
|
||||
<div class="col-4" style="text-align: end; background-color: #b5deec; border-radius: 25px;">
|
||||
{% else %}
|
||||
<div class="col-4" style="background-color: #8ccde2; border-radius: 25px;">
|
||||
{% endif %}
|
||||
<p style="align-self: end; word-wrap: break-word;">{{ message.text }}</p>
|
||||
{% if message.user == user %}
|
||||
</div>
|
||||
{% else %}
|
||||
</div>
|
||||
<div class="col-8">
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
Reference in New Issue
Block a user