forked from 0x2620/pandora
make about page editable
This commit is contained in:
parent
cbfba515d0
commit
60df436529
2 changed files with 23 additions and 5 deletions
|
@ -16,6 +16,7 @@
|
|||
"canDeleteItems": {"admin": true},
|
||||
"canDownloadVideo": {"guest": 0, "member": 0, "friend": 4, "staff": 4, "admin": 4},
|
||||
"canEditMetadata": {"staff": true, "admin": true},
|
||||
"canEditSitePages": {"staff": true, "admin": true},
|
||||
"canEditUsers": {"admin": true},
|
||||
"canPlayClips": {"guest": 2, "member": 2, "friend": 4, "staff": 4, "admin": 4},
|
||||
"canPlayVideo": {"guest": 1, "member": 1, "friend": 4, "staff": 4, "admin": 4},
|
||||
|
|
|
@ -8,12 +8,29 @@ pandora.ui.siteDialog = function(section) {
|
|||
Ox.getObjectById(tabs, section).selected = true;
|
||||
var $tabPanel = Ox.TabPanel({
|
||||
content: function(id) {
|
||||
var content = Ox.Element().css({padding: '16px', overflowY: 'auto'});
|
||||
var $content = Ox.Element().css({padding: '16px', overflowY: 'auto'});
|
||||
if (id == 'contact') {
|
||||
content.append(pandora.ui.contactForm());
|
||||
$content.append(pandora.ui.contactForm());
|
||||
} else {
|
||||
pandora.api.getPage({name:id}, function(result) {
|
||||
content.html(result.data.body);
|
||||
pandora.api.getPage({name: id}, function(result) {
|
||||
Ox.print('DATA::', result.data)
|
||||
Ox.Editable({
|
||||
editable: pandora.site.capabilities.canEditSitePages[pandora.user.level],
|
||||
tooltip: 'Doubleclick to edit',
|
||||
type: 'textarea',
|
||||
value: result.data.body
|
||||
})
|
||||
.css({width: '100%'})
|
||||
.bindEvent({
|
||||
submit: function(data) {
|
||||
Ox.Request.clearCache('getPage');
|
||||
pandora.api.editPage({
|
||||
name: id,
|
||||
body: data.value
|
||||
});
|
||||
}
|
||||
})
|
||||
.appendTo($content)
|
||||
});
|
||||
}
|
||||
return Ox.SplitPanel({
|
||||
|
@ -31,7 +48,7 @@ pandora.ui.siteDialog = function(section) {
|
|||
size: 272
|
||||
},
|
||||
{
|
||||
element: content
|
||||
element: $content
|
||||
}
|
||||
],
|
||||
orientation: 'horizontal'
|
||||
|
|
Loading…
Reference in a new issue