mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-14 02:28:23 +00:00
chg: [chats] show username
This commit is contained in:
parent
21686428f0
commit
f4da8c55f4
3 changed files with 12 additions and 4 deletions
|
@ -185,7 +185,7 @@ class ChatServiceInstance:
|
||||||
meta['chats'] = []
|
meta['chats'] = []
|
||||||
for chat_id in self.get_chats_with_messages():
|
for chat_id in self.get_chats_with_messages():
|
||||||
meta['chats'].append(
|
meta['chats'].append(
|
||||||
Chats.Chat(chat_id, self.uuid).get_meta({'created_at', 'icon', 'nb_subchannels', 'nb_messages'}))
|
Chats.Chat(chat_id, self.uuid).get_meta({'created_at', 'icon', 'nb_subchannels', 'nb_messages', 'username', 'str_username'}))
|
||||||
return meta
|
return meta
|
||||||
|
|
||||||
def get_nb_chats(self):
|
def get_nb_chats(self):
|
||||||
|
|
|
@ -94,6 +94,8 @@ class Chat(AbstractChatObject):
|
||||||
meta['nb_messages'] = self.get_nb_messages()
|
meta['nb_messages'] = self.get_nb_messages()
|
||||||
if 'username' in options:
|
if 'username' in options:
|
||||||
meta['username'] = self.get_username()
|
meta['username'] = self.get_username()
|
||||||
|
if meta['username'] and 'str_username' in options:
|
||||||
|
meta['username'] = meta['username'].split(':', 2)[2]
|
||||||
if 'subchannels' in options:
|
if 'subchannels' in options:
|
||||||
meta['subchannels'] = self.get_subchannels()
|
meta['subchannels'] = self.get_subchannels()
|
||||||
if 'nb_subchannels':
|
if 'nb_subchannels':
|
||||||
|
|
|
@ -65,8 +65,9 @@
|
||||||
<thead class="bg-dark text-white">
|
<thead class="bg-dark text-white">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Icon</th>
|
<th>Icon</th>
|
||||||
<th>Name</th>
|
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Username</th>
|
||||||
<th>Created at</th>
|
<th>Created at</th>
|
||||||
<th>First Seen</th>
|
<th>First Seen</th>
|
||||||
<th>Last Seen</th>
|
<th>Last Seen</th>
|
||||||
|
@ -81,8 +82,13 @@
|
||||||
<img src="{% if chat['icon'] %}{{ url_for('objects_image.image', filename=chat['icon'])}}{% else %}{{ url_for('static', filename='image/ail-icon.png') }}{% endif %}"
|
<img src="{% if chat['icon'] %}{{ url_for('objects_image.image', filename=chat['icon'])}}{% else %}{{ url_for('static', filename='image/ail-icon.png') }}{% endif %}"
|
||||||
class="rounded-circle mr-1" alt="{{ chat['id'] }}" width="40" height="40">
|
class="rounded-circle mr-1" alt="{{ chat['id'] }}" width="40" height="40">
|
||||||
</td>
|
</td>
|
||||||
<td><b>{{ chat['name'] }}</b></td>
|
|
||||||
<td><a href="{{ url_for('chats_explorer.chats_explorer_chat') }}?subtype={{ chat_instance['uuid'] }}&id={{ chat['id'] }}">{{ chat['id'] }}</a></td>
|
<td><a href="{{ url_for('chats_explorer.chats_explorer_chat') }}?subtype={{ chat_instance['uuid'] }}&id={{ chat['id'] }}">{{ chat['id'] }}</a></td>
|
||||||
|
<td><b>{{ chat['name'] }}</b></td>
|
||||||
|
<td>
|
||||||
|
{% if chat['username'] %}
|
||||||
|
{{ chat['username'] }}
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
<td>{{ chat['created_at'] }}</td>
|
<td>{{ chat['created_at'] }}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if chat['first_seen'] %}
|
{% if chat['first_seen'] %}
|
||||||
|
@ -114,7 +120,7 @@
|
||||||
$('#tablechats').DataTable({
|
$('#tablechats').DataTable({
|
||||||
"aLengthMenu": [[5, 10, 15, -1], [5, 10, 15, "All"]],
|
"aLengthMenu": [[5, 10, 15, -1], [5, 10, 15, "All"]],
|
||||||
"iDisplayLength": 10,
|
"iDisplayLength": 10,
|
||||||
"order": [[ 5, "desc" ]]
|
"order": [[ 6, "desc" ]]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue