diff --git a/static/js/pandora/siteDialog.js b/static/js/pandora/siteDialog.js index ca393c637..951c3e3f1 100644 --- a/static/js/pandora/siteDialog.js +++ b/static/js/pandora/siteDialog.js @@ -28,6 +28,7 @@ pandora.ui.siteDialog = function(section) { pandora.$ui.contactForm = pandora.ui.contactForm().appendTo($content); } else { pandora.api.getPage({name: id}, function(result) { + var $column, risk; Ox.Editable({ clickLink: pandora.clickLink, editable: pandora.site.capabilities.canEditSitePages[pandora.user.level], @@ -35,7 +36,13 @@ pandora.ui.siteDialog = function(section) { type: 'textarea', value: result.data.body }) - .css({width: '100%'/*, height: '100%'*/}) + .css(id == 'rights' ? { + // this will get applied twice, + // total is 144px + marginRight: '72px' + } : { + width: '100%' + }) .bindEvent({ submit: function(data) { Ox.Request.clearCache('getPage'); @@ -45,7 +52,38 @@ pandora.ui.siteDialog = function(section) { }); } }) - .appendTo($content) + .appendTo($content); + if (id == 'rights') { + $column = $('
') + .css({position: 'absolute', top: '16px', right: '16px', width: '128px'}) + .appendTo($content); + $('') + .attr({src: '/static/png/rights.png'}) + .css({width: '128px', height: '128px', marginBottom: '8px'}) + .appendTo($column); + risk = ['Unknown', 'Severe', 'High', 'Significant', 'General', 'Low']; + Ox.merge( + ['Unknown'], + pandora.site.rightsLevels.map(function(rightsLevel) { + return rightsLevel.name; + }).reverse() + ).forEach(function(name, i) { + Ox.Theme.formatColor(330 + 30 * i, 'gradient') + .css({ + padding: '4px', + marginTop: '8px', + }) + .html( + '' + name + '
' + + risk[i] + ' Risk' + + (i % 3 == 0 ? '
of ' : ' of
') + + 'Legal Action
' + ) + .appendTo($column); + }) + pandora.site.rightsLevels.forEach(function(rightsLevel) { + }); + } }); } return Ox.SplitPanel({