Button for deleting chat history

This commit is contained in:
FinnStutzenstein 2016-10-17 12:00:18 +02:00
parent c2a1675e37
commit 7965fd3fce
6 changed files with 34 additions and 2 deletions

View File

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-17 09:50
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0006_multiprojector'),
]
operations = [
migrations.AlterModelOptions(
name='chatmessage',
options={'default_permissions': (), 'permissions': (('can_use_chat', 'Can use the chat'), ('can_manage_chat', 'Can manage the chat'))},
),
]

View File

@ -287,7 +287,8 @@ class ChatMessage(RESTModelMixin, models.Model):
class Meta:
default_permissions = ()
permissions = (
('can_use_chat', 'Can use the chat'),)
('can_use_chat', 'Can use the chat'),
('can_manage_chat', 'Can manage the chat'),)
def __str__(self):
return 'Message {}'.format(self.timestamp)

View File

@ -1223,7 +1223,7 @@ img {
border-color: #dddddd;
border-width: 1px;
box-shadow: -5px 5px 5px rgba(0, 0, 0, 0.2);
height: 200px;
height: 234px;
padding: 0 10px 10px 10px;
z-index: 5;
}

View File

@ -1296,6 +1296,10 @@ angular.module('OpenSlidesApp.core.site', [
}
}
});
$scope.clearChatHistory = function () {
console.log("Clear");
};
}
])

View File

@ -63,6 +63,12 @@
<button type="submit" class="btn btn-default" id="messageSendButton">
<i class="fa fa-comment"></i>
</button>
<button os-perms="core.can_manage_chat" type="button"
class="btn btn-default btn-danger" id="clearchatHistory"
ng-bootbox-confirm="{{ 'Are you sure to delete the chat history?' | translate }}"
ng-bootbox-confirm-action="clearChatHistory()">
<i class="fa fa-trash"></i>
</button>
</span>
</div>
</form>

View File

@ -27,6 +27,7 @@ def create_builtin_groups_and_admin(**kwargs):
'core.can_manage_config',
'core.can_manage_projector',
'core.can_manage_tags',
'core.can_manage_chat',
'core.can_see_frontpage',
'core.can_see_projector',
'core.can_use_chat',
@ -102,6 +103,7 @@ def create_builtin_groups_and_admin(**kwargs):
permission_dict['core.can_manage_projector'],
permission_dict['core.can_manage_tags'],
permission_dict['core.can_use_chat'],
permission_dict['core.can_manage_chat'],
permission_dict['mediafiles.can_see'],
permission_dict['mediafiles.can_manage'],
permission_dict['mediafiles.can_upload'],