Changeset 555
- Timestamp:
- 09/18/07 15:49:23 (1 year ago)
- Files:
-
- pagoda/trunk/Pagoda/pagoda/controllers/admin.py (modified) (3 diffs)
- pagoda/trunk/Pagoda/pagoda/models/container.py (added)
- pagoda/trunk/Pagoda/pagoda/models/node.py (modified) (3 diffs)
- pagoda/trunk/Pagoda/pagoda/models/revision.py (modified) (1 diff)
- pagoda/trunk/Pagoda/pagoda/models/template.py (modified) (1 diff)
- pagoda/trunk/Pagoda/pagoda/models/util.py (modified) (1 diff)
- pagoda/trunk/Pagoda/pagoda/plugins/controllers.py (modified) (3 diffs)
- pagoda/trunk/Pagoda/pagoda/plugins/models.py (modified) (2 diffs)
- pagoda/trunk/Pagoda/pagoda/templates/admin/admin.html (modified) (1 diff)
- pagoda/trunk/Pagoda/pagoda/templates/admin/schedule.html (modified) (4 diffs)
- pagoda/trunk/Pagoda/pagoda/widgets/admin/panels.py (modified) (5 diffs)
- pagoda/trunk/Pagoda/pagoda/widgets/admin/static/css/notifications.css (added)
- pagoda/trunk/Pagoda/pagoda/widgets/admin/static/css/site_tree.css (modified) (1 diff)
- pagoda/trunk/Pagoda/pagoda/widgets/admin/static/javascript/admin.js (modified) (1 diff)
- pagoda/trunk/Pagoda/pagoda/widgets/admin/static/javascript/edit.js (modified) (1 diff)
- pagoda/trunk/Pagoda/pagoda/widgets/admin/static/javascript/iframe_autosize.js (modified) (4 diffs)
- pagoda/trunk/Pagoda/pagoda/widgets/admin/static/javascript/notifications.js (added)
- pagoda/trunk/Pagoda/pagoda/widgets/admin/static/javascript/page_manager.js (deleted)
- pagoda/trunk/Pagoda/pagoda/widgets/admin/static/javascript/site_tree.js (modified) (5 diffs)
- pagoda/trunk/Pagoda/pagoda/widgets/admin/templates/notifications.html (added)
- pagoda/trunk/Pagoda/pagoda/widgets/admin/templates/tree.html (modified) (1 diff)
- pagoda/trunk/Pagoda/pagoda/widgets/admin/widgets.py (modified) (2 diffs)
- pagoda/trunk/TestProject/testproject/model.py (modified) (10 diffs)
- pagoda/trunk/setup.py (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pagoda/trunk/Pagoda/pagoda/controllers/admin.py
r551 r555 25 25 26 26 def __init__(self): 27 self.site_tree = widgets.admin.SiteTreePanel( 28 # TODO: Change this to 'site-tree' and update the ToscaWidgets 29 # version dependency when ToscaWidgets fixes its webpath bug. 30 'site_tree', 31 data_url='serialize_child_nodes', 32 root_url='serialize_root_node', 33 revision='latest' 34 ) 27 self.site_tree = None 28 29 def get_site_tree(self): 30 if self.site_tree is None: 31 self.site_tree = widgets.admin.SiteTreePanel( 32 # TODO: Change this to 'site-tree' and update the ToscaWidgets 33 # version dependency when ToscaWidgets fixes its webpath bug. 34 'site_tree', 35 edit_url=url('/edit'), 36 content_url=url('/content'), 37 data_url=url('/edit/serialize_child_nodes'), 38 root_url=url('/edit/serialize_root_node'), 39 revision='latest' 40 ) 41 return self.site_tree 35 42 36 43 @expose(format='json') 37 44 def serialize_root_node(self): 38 return self. site_tree.serialize_root()45 return self.get_site_tree().serialize_root() 39 46 40 47 @expose(format='json') 41 48 def serialize_child_nodes(self, node): 42 return self. site_tree.serialize_children(node)43 49 return self.get_site_tree().serialize_children(node) 50 44 51 @expose() 45 52 def index(self, *args, **kwargs): … … 57 64 content_controller = map_path_to_controller(root, *args, **kwargs) 58 65 content = content_controller.get_content() 59 return dict( 60 content=content, tree_panel=self.site_tree 61 ) 66 return dict(content=content, tree_panel=self.get_site_tree()) 62 67 63 68 class LiveController(Controller, identity.SecureResource): … … 93 98 return continue_with_controller(content_controller, *args, **kwargs) 94 99 95 class PublicationScheduleController(Controller ):96 #require = identity.has_permission('pagoda_admin')100 class PublicationScheduleController(Controller, identity.SecureResource): 101 require = identity.has_permission('pagoda_admin') 97 102 98 103 @expose(template="genshi:pagoda.templates.admin.schedule", format="html") pagoda/trunk/Pagoda/pagoda/models/node.py
r554 r555 11 11 Column('revision_id', None, primary_key=True), 12 12 Column('content_id', None, nullable=False), 13 Column(' url', String(255), nullable=True),13 Column('node_url', String(255), nullable=True), 14 14 Column('parent_id', None, ForeignKey('node_generic.content_id'), 15 15 nullable=True … … 49 49 ) 50 50 51 def get_absolute_url(self, revision): 52 url = self.node_url 53 if self.parent_id: 54 parent = self.query_parent(revision).selectone() 55 parent_url = parent.get_absolute_url(revision) 56 return '%s%s/' % (parent_url, url) 57 elif url: 58 return '/%s/' % url 59 else: 60 return '/' 61 51 62 def query_latest_children(self): 52 63 cls = self.__class__ … … 62 73 parent_id=self.content_id 63 74 ) 64 75 76 def query_latest_parent(self): 77 cls = self.__class__ 78 return cls.query_latest().filter_by(content_id=self.parent_id) 79 80 def query_active_parent(self): 81 cls = self.__class__ 82 return cls.query_active().filter_by(content_id=self.parent_id) 83 84 def query_parent(self, revision): 85 cls = self.__class__ 86 return cls.query_revision(revision).filter_by( 87 content_id=self.parent_id 88 ) 89 65 90 def delete_node(self, revision_status=workflow.PENDING): 66 91 return self.new_revision( pagoda/trunk/Pagoda/pagoda/models/revision.py
r551 r555 166 166 inherits=Content.mapper, 167 167 properties={ 168 ' author': relation(User, lazy=True)168 'revision_author': relation(User, lazy=True) 169 169 } 170 170 ) pagoda/trunk/Pagoda/pagoda/models/template.py
r394 r555 12 12 Column('template_name', Unicode(75), nullable=True), 13 13 Column('template_path', Unicode, nullable=True), 14 Column('template ', Unicode, nullable=True)14 Column('template_code', Unicode, nullable=True) 15 15 ) 16 16 pagoda/trunk/Pagoda/pagoda/models/util.py
r551 r555 3 3 4 4 __all__ = ['now', 'get_original_column', 'get_column_table', 5 'follow_foreign_key', 'get_instance_values'] 5 'follow_foreign_key', 'get_instance_values', 6 'filter_foreign_columns', 'filter_columns', 'get_foreign_tables'] 6 7 7 8 now = datetime.utcnow pagoda/trunk/Pagoda/pagoda/plugins/controllers.py
r550 r555 1 1 import pkg_resources 2 from cherrypy import request, HTTPError 2 3 from turbogears import expose, flash, redirect 3 4 from turbogears.database import metadata, session 4 5 from turbogears.controllers import Controller 6 from turbojson import jsonify 5 7 from pagoda import config, workflow 6 8 # Relative imports! … … 30 32 def create(self): 31 33 """Create a new instance of this content type.""" 32 34 pass 33 35 34 36 @expose() … … 44 46 45 47 """ 46 if not self.content.is_deleted: 47 transaction = models.session.create_transaction() 48 deleted_content = self.content.delete_node() 49 try: 50 transaction.commit() 51 except models.exceptions.SQLAlchemyError: 52 transaction.rollback() 53 result = dict(success=False) 48 if request.method == 'POST': 49 if not self.content.is_deleted: 50 transaction = models.session.create_transaction() 51 deleted_content = self.content.delete_node() 52 try: 53 transaction.commit() 54 except models.exceptions.SQLAlchemyError: 55 transaction.rollback() 56 result = dict(success=False) 57 else: 58 result = dict(success=True) 54 59 else: 55 60 result = dict(success=True) 61 return result 56 62 else: 57 result = dict(success=True) 58 return result 63 raise HTTPError( 64 status=400, 65 message="This resource makes modifications - use POST." 66 ) 59 67 60 68 @expose() pagoda/trunk/Pagoda/pagoda/plugins/models.py
r541 r555 46 46 """ 47 47 query = Node.query_revision(revision).filter_by( 48 url=url, parent_id=parent_id48 node_url=url, parent_id=parent_id 49 49 ) 50 50 try: … … 55 55 model = get_content_model(content_type) 56 56 content = model.query_revision(revision).get_by( 57 url=url, parent_id=parent_id57 node_url=url, parent_id=parent_id 58 58 ) 59 59 if content: pagoda/trunk/Pagoda/pagoda/templates/admin/admin.html
r553 r555 39 39 </li> 40 40 </ul> 41 <ul id="notifications"> 42 <script type="text/javascript"> 43 Ext.namespace("Pagoda", "Pagoda.panels"); 44 Ext.onReady(function() { 45 Pagoda.panels.notifications = new Pagoda.widgets.NotificationPanel('notifications'); 46 Pagoda.panels.notifications.hide(); 47 }); 48 </script> 49 </ul> 41 50 </div> 42 51 pagoda/trunk/Pagoda/pagoda/templates/admin/schedule.html
r528 r555 40 40 <li py:for="i, revision in revisions" class="${pagoda.util.even_odd(i)}" 41 41 py:with="schedule = bool(revision.revision_release_time and revision.revision_release_time >= pagoda.now)"> 42 <h3 class="title"><a title="Click to preview • ${revision. title}" href="${tg.url('/content/live/%s/%s/' % (revision.content_type, revision.revision_id))}">43 ${revision. title or "%s %d, revision %d" % (revision.content_type.title(), revision.content_id, revision.revision_id)}42 <h3 class="title"><a title="Click to preview • ${revision.node_title or revision.nav_title}" href="${tg.url('/content/live/%s/%s/' % (revision.content_type, revision.revision_id))}"> 43 ${revision.node_title or revision.nav_title or "%s %d, revision %d" % (revision.content_type.title(), revision.content_id, revision.revision_id)} 44 44 </a></h3> 45 45 <p class="status"> … … 57 57 <span py:when="False">new</span> 58 58 ${revision.content_type} 59 </strong> by ${revision. author.user_name}59 </strong> by ${revision.revision_author.user_name} 60 60 </p> 61 61 <p class="comment" py:if="revision.revision_comment.strip()"> … … 99 99 class="${pagoda.util.even_odd(i)} ${is_expiration and 'expire' or 'release'}"> 100 100 <h3 class="title"><a href="${tg.url('/content/live/%s/%s/' % (revision.content_type, revision.revision_id))}"> 101 ${revision. title}101 ${revision.node_title or revision.nav_title} 102 102 </a></h3> 103 103 <p class="status" py:choose="is_expiration"> … … 116 116 <span py:when="False, False">new</span> 117 117 ${revision.content_type} 118 </strong> by ${revision. author.user_name}118 </strong> by ${revision.revision_author.user_name} 119 119 </p> 120 120 <p class="comment" py:if="revision.revision_comment.strip()"> pagoda/trunk/Pagoda/pagoda/widgets/admin/panels.py
r554 r555 1 1 from toscawidgets.api import Widget, JSLink, CSSLink 2 from turbogears import url 3 from turbojson import jsonify 2 4 from pagoda.widgets.admin.widgets import * 3 from turbojson import jsonify4 5 from pagoda import plugins 5 6 … … 28 29 29 30 class SiteTreePanel(Widget): 30 params = [' data_url', 'root_url', 'revision']31 params = ['edit_url', 'content_url', 'data_url', 'root_url', 'revision'] 31 32 template = "genshi:pagoda.widgets.admin.templates.tree" 32 33 css = [panels_css, site_tree_css] … … 46 47 def controller_to_node(self, controller, descend=1): 47 48 content = controller.get_content() 49 revision = controller.get_revision() 48 50 children = controller.get_children() 49 51 node = { 50 'text': content. url or '/',52 'text': content.nav_title or content.node_title, 51 53 'id': content.content_id, 52 54 'cls': children and 'folder' or 'file', … … 54 56 'pagoda': { 55 57 'content_id': content.content_id, 58 'content_type': content.content_type, 56 59 'revision_id': content.revision_id, 57 60 'is_deleted': content.is_deleted, 58 'url': content.url, 59 61 'node_url': content.node_url, 62 'absolute_url': content.get_absolute_url(revision), 63 'manage_url': url( 64 '/content/%s/%s/manage/' % ( 65 content.content_type, content.revision_id 66 ) 67 ), 68 'nav_title': content.nav_title, 69 'nav_show': content.nav_show, 70 'node_title': content.node_title, 71 'content_locale': content.content_locale, 72 'parent_id': content.parent_id 60 73 } 61 74 } … … 65 78 controller_to_node(child, descend - 1) for child in children] 66 79 return node 80 81 notifications_css = CSSLink( 82 modname=module_name, filename='static/css/notifications.css', 83 css=[admin_css] 84 ) 85 86 notifications_base = JSLink( 87 modname=module_name, filename='static/javascript/notifications.js', 88 css=[notifications_css], 89 javascript=[admin_base] 90 ) 91 92 class NotificationPanel(Widget): 93 template = "genshi:pagoda.widgets.admin.templates.notifications" 94 css = [notifications_css] 95 javascript = [notifications_base] pagoda/trunk/Pagoda/pagoda/widgets/admin/static/css/site_tree.css
r554 r555 10 10 height: 16px; 11 11 background-image: url('../images/layout.png'); 12 } 13 14 #site_tree .x-tree-node .deleted { 15 opacity: 0.3; 16 } 17 18 #site_tree .x-tree-node .deleted a span { 19 color: #000; 12 20 } 13 21 pagoda/trunk/Pagoda/pagoda/widgets/admin/static/javascript/admin.js
r449 r555 12 12 Ext.namespace("Pagoda", "Pagoda.util"); 13 13 14 Ext.onReady(function() { 15 Pagoda.util.dateFormatter = Ext.util.Format.dateRenderer("F j, Y"); 16 17 Pagoda.MenuDialog = function(contentEl, buttonEl, config) { 18 if (typeof(config) == 'undefined') { 19 var config = {}; 20 } 21 if (typeof(config.shadow) == 'undefined') { 22 config.shadow = true; 23 } 24 if (typeof(config.alignPosition) == 'undefined') { 25 config.alignPosition = 'tr-br'; 26 } 27 this.alignPosition = config.alignPosition; 28 this.id = Ext.id(); 29 var el = this.el = new Ext.Layer(config, contentEl); 30 el.addClass('x-menu'); 31 var buttonEl = this.buttonEl = Ext.get(buttonEl); 32 this.addEvents({ 33 beforeshow: true, 34 beforehide: true, 35 hide: true, 36 show: true 37 }); 38 var menu = this; 39 buttonEl.addListener('mousedown', function(e) { 40 if (!menu.isVisible()) { 41 menu.show(); 42 } 43 }); 44 Ext.menu.MenuMgr.register(this); 14 // Extends Ext.data.Connection to add a responseJSON attribute to 15 // XmlHttpRequest response objects in the handleResponse method, 16 // and provides a default Accept header of 'text/json'. 17 Ext.data.JSONConnection = function(config) { 18 // call super's constructor 19 var config = config || {}; 20 var defaults = { 21 extraParams: {dummy: 'dummy'}, // Avoid 411 "Length Required" bug. 22 defaultHeaders: {'Accept': 'text/json'} 23 }; 24 Ext.applyIf(config, defaults); 25 Ext.data.JSONConnection.superclass.constructor.call(this, config); 26 } 27 Ext.extend(Ext.data.JSONConnection, Ext.data.Connection, { 28 handleResponse: function(response) { 29 // decode JSON 30 response.responseJSON = Ext.util.JSON.decode(response.responseText); 31 // call super 32 Ext.data.JSONConnection.superclass.handleResponse.call(this, response); 45 33 } 46 47 Ext.extend(Pagoda.MenuDialog, Ext.util.Observable, {48 hide: function(animate) {49 if (this.el && this.isVisible()) {50 this.fireEvent('beforehide', this);51 this.buttonEl.removeClass('open');52 this.el.hide(animate);53 this.fireEvent('hide', this);54 }55 },56 show: function(animate) {57 this.el.alignTo(this.buttonEl, this.alignPosition);58 this.fireEvent('beforeshow', this);59 this.buttonEl.addClass('open');60 this.el.show(animate);61 this.fireEvent('show', this);62 },63 isVisible: function() {64 return this.el.isVisible();65 }66 });67 68 34 }); 35 Pagoda.JSON = new Ext.data.JSONConnection(); pagoda/trunk/Pagoda/pagoda/widgets/admin/static/javascript/edit.js
r510 r555 49 49 50 50 // Automatically poll and resize iframe to fit contents 51 this.iframeautosizer = new Ext. IFrameAutoSize(this.iframe, {poll_interval: 500});51 this.iframeautosizer = new Ext.util.IFrameAutoSize(this.iframe, {poll_interval: 500}); 52 52 53 53 // Add handler to resize column heights on iframe resize pagoda/trunk/Pagoda/pagoda/widgets/admin/static/javascript/iframe_autosize.js
r488 r555 22 22 * resize(IFrameAutoSize this): Fires after the iframe is resized 23 23 */ 24 Ext. IFrameAutoSize = function(element, config) {24 Ext.util.IFrameAutoSize = function(element, config) { 25 25 // Allow Ext.Element constructor to run, using forceNew=true 26 26 // to ensure a new instance of this class is created 27 Ext. IFrameAutoSize.superclass.constructor.call(this, element, true);27 Ext.util.IFrameAutoSize.superclass.constructor.call(this, element, true); 28 28 29 29 // Raise error if element is not an IFRAME 30 30 if (!this.is('iframe')) { 31 throw "Ext. IFrameAutoSize Error: Element is not an IFrame."31 throw "Ext.util.IFrameAutoSize Error: Element is not an IFrame." 32 32 } 33 33 … … 60 60 61 61 // Extend with Element to support resizing a DOM element. 62 Ext.extend(Ext. IFrameAutoSize, Ext.Element, {62 Ext.extend(Ext.util.IFrameAutoSize, Ext.Element, { 63 63 // Schedule the next iframeAutoSize() call. 64 64 iframePoll: function() { … … 99 99 setHeight: function(height, animate) { 100 100 this.fireEvent('beforeresize', this); 101 Ext. IFrameAutoSize.superclass.setHeight.call(this, height, animate);101 Ext.util.IFrameAutoSize.superclass.setHeight.call(this, height, animate); 102 102 this.fireEvent('resize', this); 103 103 }, … … 135 135 136 136 // Extend with Observable to support custom events 137 Ext.apply(Ext. IFrameAutoSize.prototype, Ext.util.Observable.prototype);137 Ext.apply(Ext.util.IFrameAutoSize.prototype, Ext.util.Observable.prototype); pagoda/trunk/Pagoda/pagoda/widgets/admin/static/javascript/site_tree.js
r554 r555 3 3 4 4 // Constructor for SiteTree class. 5 // Config options: 6 // `edit_url` must be the absolute URL to the 'edit' controller. 5 7 // `tree_id` must be the ID of a block element on the page. 6 8 // `data_url` must be a URL pointing to a JSON controller from which to 7 9 // request node information. 10 // `root_url` is similar to `data_url` but is only used to request the root node. 8 11 9 Pagoda.widgets.SiteTree = function(tree_id, data_url, root_url) { 12 Pagoda.widgets.SiteTree = function(config) { 13 14 // Specify the events this object can fire. 15 this.addEvents({ 16 'before_page_edit': true, 17 'before_page_duplicate': true, 18 'before_page_delete': true, 19 'before_page_add': true, 20 'before_page_move': true, 21 'page_edit': true, 22 'page_duplicate': true, 23 'page_delete': true, 24 'page_add': true, 25 'page_move': true 26 }); 27 10 28 // Make an Ext.tree.TreePanel instance. 11 Pagoda.widgets.SiteTree.superclass.constructor.call( 12 this, tree_id, { 13 rootVisible: true, 14 animate: true, 15 loader: new Ext.tree.TreeLoader({ 16 dataUrl: data_url, 17 requestMethod: 'GET' 18 }), 19 enableDD: true, 20 selModel: new Ext.tree.MultiSelectionModel(), 21 containerScroll: false, 22 lines: false, 23 hlColor: 'e7ebe3' 24 } 25 ); 29 Ext.apply(config, { 30 rootVisible: true, 31 animate: true, 32 loader: new Ext.tree.TreeLoader({ 33 dataUrl: config.data_url, 34 requestMethod: 'GET' 35 }), 36 enableDD: true, 37 selModel: new Ext.tree.MultiSelectionModel(), 38 containerScroll: false, 39 lines: false, 40 hlColor: 'e7ebe3' 41 }); 42 Pagoda.widgets.SiteTree.superclass.constructor.call(this, config.tree_id, config); 26 43 27 44 // Request the root node and render tree on success. 28 45 conn = new Ext.data.Connection(); 29 46 conn.request({ 30 url: root_url,47 url: config.root_url, 31 48 callback: function(options, success, response) { 32 49 if (success) { … … 46 63 47 64 // Create a TreeMenu to show add/delete/remove/duplicate buttons 48 var menu_id = tree_id + '-menu';65 var menu_id = config.tree_id + '-menu'; 49 66 this.menu = new Ext.menu.TreeMenu({ 50 67 id: menu_id, … … 55 72 itemCls: 'edit', 56 73 handler: function() { 57 var selection = this.parentMenu.tree.getSelectionModel(); 58 var nodes = selection.getSelectedNodes(); 74 // Obtain reference to SiteTree 75 var site_tree = this.parentMenu.tree; 76 // Determine which page will be edited 77 var selection = site_tree.getSelectionModel(); 78 var node = selection.getSelectedNodes()[0]; 79 // Fire event indicating page is about to be edited 80 site_tree.fireEvent('before_page_edit', page); 81 // Redirect user to page for editing 82 window.location.href = site_tree.edit_url + nodes[0].attributes.pagoda.absolute_url; 59 83 } 60 84 }), … … 64 88 itemCls: 'add', 65 89 handler: function() { 66 var selection = this.parentMenu.tree.getSelectionModel(); 67 var nodes = selection.getSelectedNodes(); 90 // Obtain reference to SiteTree 91 var site_tree = this.parentMenu.tree; 92 // Determine which page will be edited 93 var selection = site_tree.getSelectionModel(); 94 var node = selection.getSelectedNodes()[0]; 95 // Fire event indicating `parent_page` is about to have a new child! 96 //site_tree.fireEvent('before_page_add', parent_page); 97 98 // Fire event indicating `new_page` has been created 99 //site_tree.fireEvent('page_add', new_page); 100 68 101 } 69 102 }), … … 82 115 itemCls: 'delete', 83 116 handler: function() { 84 var selection = this.parentMenu.tree.getSelectionModel(); 85 var nodes = selection.getSelectedNodes(); 117 // Obtain reference to SiteTree 118 var site_tree = this.parentMenu.tree; 119 // Determine which pages will be deleted 120 var selection = site_tree.getSelectionModel(); 121 var pages = selection.getSelectedNodes(); 122 // Fire event indicating `pages` are about to be deleted. 123 site_tree.fireEvent('before_page_delete', pages); 124 // Attempt to delete pages as indicated 125 var successes = new Array(); 126 var failures = new Array(); 127 for (var i = 0; i < pages.length; i++) { 128 var attributes = pages[i].attributes; 129 var delete_url = attributes.pagoda.manage_url + 'delete'; 130 Pagoda.JSON.request({ 131 url: delete_url, 132 method: 'POST', 133 scope: pages[i], 134 success: function(response, options) { 135 this.ui.addClass('deleted'); 136 successes.push({ 137 page: this, 138 response: response, 139 options: options 140 }); 141 }, 142 failure: function(response, options) { 143 failures.push({ 144 page: this, 145 response: response, 146 options: options 147 }); 148 } 149 }); 150 } 151 // Fire event indicating `pages` have been deleted 152 site_tree.fireEvent('page_delete', successes, failures); 86 153 } 87 154 }), pagoda/trunk/Pagoda/pagoda/widgets/admin/templates/tree.html
r459 r555 12 12 Ext.namespace("Pagoda", "Pagoda.panels"); 13 13 Ext.onReady(function() { 14 Pagoda.panels.site_tree = new Pagoda.widgets.SiteTree( 15 "${id}", "${data_url}", "${root_url}" 16 ); 14 Pagoda.panels.site_tree = new Pagoda.widgets.SiteTree({ 15 'tree_id': "${id}", 16 'edit_url': "${edit_url}", 17 'content_url': "${content_url}", 18 'data_url': "${data_url}", 19 'root_url': "${root_url}" 20 }); 17 21 }); 18 22 </script> pagoda/trunk/Pagoda/pagoda/widgets/admin/widgets.py
r514 r555 17 17 ) 18 18 19 notifications_css = CSSLink( 20 modname=module_name, filename='static/css/notifications.css', 21 css=[admin_css] 22 ) 23 24 notifications_base = JSLink( 25 modname=module_name, filename='static/javascript/notifications.js', 26 css=[notifications_css], 27 javascript=[admin_base] 28 ) 29 19 30 edit_css = CSSLink( 20 31 modname=module_name, filename='static/css/edit.css', … … 24 35 edit_base = JSLink( 25 36 modname=module_name, filename='static/javascript/edit.js', 26 css=[edit_css], javascript=[admin_base, iframe_autosize] 37 css=[edit_css], 38 javascript=[admin_base, iframe_autosize, notifications_base] 27 39 ) 28 40 pagoda/trunk/TestProject/testproject/model.py
r554 r555 32 32 33 33 home_page = Page( 34 url=None, parent_id=None, content_locale='en_US',34 node_url=None, parent_id=None, content_locale='en_US', 35 35 node_title="Home", nav_show=True, revision_author_id=brian.user_id, 36 36 content_type='page', revision_status=workflow.APPROVED … … 40 40 41 41 pagoda_page = Page( 42 url='pagoda', parent_id=home_page.content_id, content_locale='en_US',42 node_url='pagoda', parent_id=home_page.content_id, content_locale='en_US', 43 43 node_title="Welcome", nav_show=True, revision_author_id=brian.user_id, 44 44 content_type='page', revision_status=workflow.APPROVED … … 48 48 49 49 tests_page = Page( 50 url='tests', parent_id=pagoda_page.content_id, content_locale='en_US',50 node_url='tests', parent_id=pagoda_page.content_id, content_locale='en_US', 51 51 node_title="Unit tests", nav_show=True, revision_author_id=brian.user_id, 52 52 content_type='page', revision_status=workflow.APPROVED … … 54 54 55 55 templates_page = Page( 56 url='templates', parent_id=pagoda_page.content_id, content_locale='en_US',56 node_url='templates', parent_id=pagoda_page.content_id, content_locale='en_US', 57 57 node_title="Genshi templates", nav_show=True, 58 58 revision_author_id=brian.user_id, content_type='page', … … 62 62 63 63 ets_page = Page( 64 url='eatthesandwich', parent_id=home_page.content_id,64 node_url='eatthesandwich', parent_id=home_page.content_id, 65 65 content_locale='en_US', node_title="Eat it", nav_show=True, 66 66 revision_author_id=brian.user_id, content_type='page', … … 75 75 document_id=pagoda_page.content_id, 76 76 content_locale=pagoda_page.content_locale, 77 revision_author_id=ian.user_id, 77 78 text_type='html', 78 79 text=""" … … 85 86 document_id=pagoda_page.content_id, 86 87 content_locale=pagoda_page.content_locale, 88 revision_author_id=ian.user_id, 87 89 text_type='html', 88 90 text=""" … … 98 100 document_id=pagoda_page.content_id, 99 101 content_locale=pagoda_page.content_locale, 102 revision_author_id=ian.user_id, 100 103 text_type='html', 101 104 text=""" … … 108 111 pagoda_page_revised = Page( 109 112 content_id=pagoda_page.content_id, 110 url='pagoda', parent_id=home_page.content_id, content_locale='en_US',113 node_url='pagoda', parent_id=home_page.content_id, content_locale='en_US', 111 114 nav_show=True, revision_author_id=brian.user_id, 112 115 content_type='page', revision_status=workflow.PENDING, … … 120 123 document_id=pagoda_page.content_id, 121 124 content_locale=pagoda_page.content_locale, 125 revision_author_id=brian.user_id, 122 126 text_type='html', 123 127 text="""
