File size: 3,213 Bytes
2f9ca82 5782aa4 1341120 5782aa4 d778046 5782aa4 2f9ca82 5782aa4 7e63346 5782aa4 2f9ca82 d778046 da2673d 2f9ca82 5782aa4 4d9972f 5782aa4 3915bcf 5782aa4 42fe57c 56f6797 5782aa4 7e63346 6567ec8 7e63346 4b177c0 ae2be5c d778046 f2eb098 d778046 f2eb098 d778046 5782aa4 2f9ca82 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | <!DOCTYPE html>
<html>
<head>
<title>Сообщения</title>
<style>
.message { padding: 16px; margin: 16px 0; border-radius: 8px; border: 5px solid rgba(0, 0, 0, 0.3); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); }
.source-user { background-color: #e0f7fa; }
.source-cli { background-color: #dcedc8; }
.source-llm { background-color: #f3e5f5; }
.source-system { background-color: #fff3e0; }
.private::after { content: " 🔒"; }
.from-self::before { content: "🧍 "; }
pre.code-block {
background-color: #f0f0f0;
padding: 10px;
border-radius: 6px;
overflow-x: auto;
}
</style>
</head>
<body>
<div style="margin-bottom: 10px;">
{% if username %}
Привет, {{ username }} | <a href="/logout">Выход</a>
{% else %}
<a href="/login">Войти</a> | <a href="/register">Регистрация</a>
{% endif %}
</div>
<h1>Сообщения</h1>
<form method="post" enctype="multipart/form-data">
<textarea name="text" rows="3" cols="60" placeholder="Введите сообщение..."></textarea><br>
<textarea name="code" rows="6" cols="60" placeholder="Прикрепите код (опционально)..."></textarea><br>
<label>Файлы: <input type="file" name="binary_files" multiple></label><br>
<button name="hidden" value="false" type="submit">📢 Отправить</button>
<button name="hidden" value="true" type="submit">🙋 Отправить приватно</button>
</form>
<hr>
<div>
<a href="/messages">📢 Все сообщения</a> |
<a href="/messages?only_personal=true">🙋 Личные</a>
</div>
<hr>
{% for msg in messages %}
<div class="message source-{{ msg.source }}">
<div>
{% if msg.user_did == request.session['did'] %}<span class="from-self" title="это ваше сообщение"></span>{% endif %}
{% if msg.hidden %}<span class="private" title="личное сообщение"></span>{% endif %}
Источник: <i>{{ msg.source }}</i> — {{ msg.timestamp | format_timestamp }}
</div>
<div>
{% if msg.badges %}{{ msg.badges }}{% endif %}Пользователь: {% if msg.username %}<b>{{ msg.username }}</b>{% endif %} {% if msg.user_did %}({{ msg.user_did }}){% endif %}
</div>
<hr>
<div>{{ msg.text|safe }}</div>
{% if msg.code %}
<hr>
<div><b>Код:</b></div>
<pre class="code-block">{{ msg.code }}</pre>
{% endif %}
{% if msg.attachments %}
<hr>
<div><b>Файлы:</b></div>
<ul>
{% for file in msg.attachments %}
<li><a href="/download/{{ file.id }}">{{ file.filename }}</a> ({{ file.size }} байт)</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endfor %}
</body>
</html>
|