Skip to content
Snippets Groups Projects
Commit 0492cf61 authored by Hermann's avatar Hermann
Browse files

show permissions of a group

parent fd99121e
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ import { ...@@ -9,7 +9,7 @@ import {
Icon, Icon,
IconButton IconButton
} from 'polythene-mithril'; } from 'polythene-mithril';
import { icons, Property } from '../views/elements'; import { icons, Property, DropdownCard } from '../views/elements';
import ItemView from '../views/itemView'; import ItemView from '../views/itemView';
import TableView from '../views/tableView'; import TableView from '../views/tableView';
import DatalistController from '../listcontroller'; import DatalistController from '../listcontroller';
...@@ -196,11 +196,19 @@ export default class viewGroup extends ItemView { ...@@ -196,11 +196,19 @@ export default class viewGroup extends ItemView {
icon: { svg: { content: m.trust(icons.cloud) } }, icon: { svg: { content: m.trust(icons.cloud) } },
inactive: true, inactive: true,
compact: true, compact: true,
}): '', }) : '',
]), ]),
m('div.viewcontainer', [ m('div.viewcontainer', [
// now-column layout: This first column are the members // now-column layout: This first column are the members
m('div.viewcontainercolumn', m(MembersTable, { group: this.data._id })), m('div.viewcontainercolumn', [
this.data.permissions ? m(
DropdownCard,
{ title: 'Permissions', style: { 'margin-bottom': '20px' } },
Object.keys(this.data.permissions)
.map(key => m(Property, { title: key }, this.data.permissions[key])),
) : '',
m(MembersTable, { group: this.data._id }),
]),
// the second column contains receive_from and forward_to emails // the second column contains receive_from and forward_to emails
m('div.viewcontainercolumn', [ m('div.viewcontainercolumn', [
m(EmailTable, { m(EmailTable, {
......
...@@ -200,7 +200,7 @@ export class DropdownCard { ...@@ -200,7 +200,7 @@ export class DropdownCard {
this.expand = false; this.expand = false;
} }
view({ attrs: { title }, children }) { view({ attrs: { title, ...kwargs }, children }) {
const toolbar = m(Toolbar, { const toolbar = m(Toolbar, {
compact: true, compact: true,
events: { onclick: () => { this.expand = !this.expand; } }, events: { onclick: () => { this.expand = !this.expand; } },
...@@ -213,12 +213,20 @@ export class DropdownCard { ...@@ -213,12 +213,20 @@ export class DropdownCard {
m(ToolbarTitle, { text: title }), m(ToolbarTitle, { text: title }),
]); ]);
const card = m(Card, { const content = [{ any: { content: toolbar } }];
style: { padding: '10px', 'font-size': '15sp' }, if (this.expand) {
content: children.map(child => ({ any: { content: child } })), content.push(...children.map(child => ({
}); any: {
style: {
'padding-left': '10px',
'padding-right': '10px',
},
content: child,
},
})));
}
return m('div', [toolbar, this.expand ? card : '']); return m(Card, { content, ...kwargs });
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment