Compare commits

...

2 commits

Author SHA1 Message Date
j
5aed135906 dont hide group 2018-06-05 13:16:09 +02:00
j
7acc562b53 only admins can change rightslevel 2018-05-31 17:27:05 +02:00
3 changed files with 22 additions and 14 deletions

View file

@ -362,7 +362,7 @@ def editUser(request, data):
response = json_response(status=403, text='email already in use') response = json_response(status=403, text='email already in use')
return render_to_json_response(response) return render_to_json_response(response)
user.email = data['email'] user.email = data['email']
if 'level' in data: if 'level' in data and request.user.profile.get_level() == 'admin':
profile.set_level(data['level']) profile.set_level(data['level'])
if 'notes' in data: if 'notes' in data:
profile.notes = data['notes'] profile.notes = data['notes']

View file

@ -444,7 +444,7 @@ pandora.ui.listGeneralPanel = function(listData) {
return listData.status == 'private' ? 160 : 136; return listData.status == 'private' ? 160 : 136;
} }
function getDescriptionTop() { function getDescriptionTop() {
return listData.status == 'private' ? 64 : 88; return listData.status == 'private' ? 112 : 136;
} }
function getSubscribersAction() { function getSubscribersAction() {
return listData.status == 'private' ? 'hide' : 'show'; return listData.status == 'private' ? 'hide' : 'show';

View file

@ -680,7 +680,8 @@ pandora.ui.usersDialog = function() {
} }
}), }),
Ox.Select({ pandora.user.level == 'admin'
? Ox.Select({
id: 'level', id: 'level',
items: pandora.site.userLevels.slice(1).map(function(level) { items: pandora.site.userLevels.slice(1).map(function(level) {
return { return {
@ -692,6 +693,13 @@ pandora.ui.usersDialog = function() {
labelWidth: 80, labelWidth: 80,
value: user.level, value: user.level,
width: formWidth - 16 width: formWidth - 16
}) : Ox.Input({
disabled: true,
id: 'level',
label: Ox._('Level'),
labelWidth: 80,
value: Ox.toTitleCase(user.level),
width: formWidth - 16
}), }),
Ox.Checkbox({ Ox.Checkbox({
id: 'newsletter', id: 'newsletter',