Button for deleting chat history
This commit is contained in:
parent
c2a1675e37
commit
7965fd3fce
19
openslides/core/migrations/0007_manage_chat_permission.py
Normal file
19
openslides/core/migrations/0007_manage_chat_permission.py
Normal 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'))},
|
||||||
|
),
|
||||||
|
]
|
@ -287,7 +287,8 @@ class ChatMessage(RESTModelMixin, models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
default_permissions = ()
|
default_permissions = ()
|
||||||
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):
|
def __str__(self):
|
||||||
return 'Message {}'.format(self.timestamp)
|
return 'Message {}'.format(self.timestamp)
|
||||||
|
@ -1223,7 +1223,7 @@ img {
|
|||||||
border-color: #dddddd;
|
border-color: #dddddd;
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
box-shadow: -5px 5px 5px rgba(0, 0, 0, 0.2);
|
box-shadow: -5px 5px 5px rgba(0, 0, 0, 0.2);
|
||||||
height: 200px;
|
height: 234px;
|
||||||
padding: 0 10px 10px 10px;
|
padding: 0 10px 10px 10px;
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
}
|
}
|
||||||
|
@ -1296,6 +1296,10 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$scope.clearChatHistory = function () {
|
||||||
|
console.log("Clear");
|
||||||
|
};
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -63,6 +63,12 @@
|
|||||||
<button type="submit" class="btn btn-default" id="messageSendButton">
|
<button type="submit" class="btn btn-default" id="messageSendButton">
|
||||||
<i class="fa fa-comment"></i>
|
<i class="fa fa-comment"></i>
|
||||||
</button>
|
</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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -27,6 +27,7 @@ def create_builtin_groups_and_admin(**kwargs):
|
|||||||
'core.can_manage_config',
|
'core.can_manage_config',
|
||||||
'core.can_manage_projector',
|
'core.can_manage_projector',
|
||||||
'core.can_manage_tags',
|
'core.can_manage_tags',
|
||||||
|
'core.can_manage_chat',
|
||||||
'core.can_see_frontpage',
|
'core.can_see_frontpage',
|
||||||
'core.can_see_projector',
|
'core.can_see_projector',
|
||||||
'core.can_use_chat',
|
'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_projector'],
|
||||||
permission_dict['core.can_manage_tags'],
|
permission_dict['core.can_manage_tags'],
|
||||||
permission_dict['core.can_use_chat'],
|
permission_dict['core.can_use_chat'],
|
||||||
|
permission_dict['core.can_manage_chat'],
|
||||||
permission_dict['mediafiles.can_see'],
|
permission_dict['mediafiles.can_see'],
|
||||||
permission_dict['mediafiles.can_manage'],
|
permission_dict['mediafiles.can_manage'],
|
||||||
permission_dict['mediafiles.can_upload'],
|
permission_dict['mediafiles.can_upload'],
|
||||||
|
Loading…
Reference in New Issue
Block a user