Changeset 555

Show
Ignore:
Timestamp:
09/18/07 15:49:23 (1 year ago)
Author:
brian
Message:

notifications widget, container model

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pagoda/trunk/Pagoda/pagoda/controllers/admin.py

    r551 r555  
    2525     
    2626    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 
    3542     
    3643    @expose(format='json') 
    3744    def serialize_root_node(self): 
    38         return self.site_tree.serialize_root() 
     45        return self.get_site_tree().serialize_root() 
    3946     
    4047    @expose(format='json') 
    4148    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     
    4451    @expose() 
    4552    def index(self, *args, **kwargs): 
     
    5764        content_controller = map_path_to_controller(root, *args, **kwargs) 
    5865        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()) 
    6267 
    6368class LiveController(Controller, identity.SecureResource): 
     
    9398        return continue_with_controller(content_controller, *args, **kwargs) 
    9499 
    95 class PublicationScheduleController(Controller): 
    96     # require = identity.has_permission('pagoda_admin') 
     100class PublicationScheduleController(Controller, identity.SecureResource): 
     101    require = identity.has_permission('pagoda_admin') 
    97102     
    98103    @expose(template="genshi:pagoda.templates.admin.schedule", format="html") 
  • pagoda/trunk/Pagoda/pagoda/models/node.py

    r554 r555  
    1111    Column('revision_id', None, primary_key=True), 
    1212    Column('content_id', None, nullable=False), 
    13     Column('url', String(255), nullable=True), 
     13    Column('node_url', String(255), nullable=True), 
    1414    Column('parent_id', None, ForeignKey('node_generic.content_id'), 
    1515        nullable=True 
     
    4949        ) 
    5050     
     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     
    5162    def query_latest_children(self): 
    5263        cls = self.__class__ 
     
    6273            parent_id=self.content_id 
    6374        ) 
    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     
    6590    def delete_node(self, revision_status=workflow.PENDING): 
    6691        return self.new_revision( 
  • pagoda/trunk/Pagoda/pagoda/models/revision.py

    r551 r555  
    166166    inherits=Content.mapper, 
    167167    properties={ 
    168         'author': relation(User, lazy=True) 
     168        'revision_author': relation(User, lazy=True) 
    169169    } 
    170170) 
  • pagoda/trunk/Pagoda/pagoda/models/template.py

    r394 r555  
    1212    Column('template_name', Unicode(75), nullable=True), 
    1313    Column('template_path', Unicode, nullable=True), 
    14     Column('template', Unicode, nullable=True) 
     14    Column('template_code', Unicode, nullable=True) 
    1515) 
    1616 
  • pagoda/trunk/Pagoda/pagoda/models/util.py

    r551 r555  
    33 
    44__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'] 
    67 
    78now = datetime.utcnow 
  • pagoda/trunk/Pagoda/pagoda/plugins/controllers.py

    r550 r555  
    11import pkg_resources 
     2from cherrypy import request, HTTPError 
    23from turbogears import expose, flash, redirect 
    34from turbogears.database import metadata, session 
    45from turbogears.controllers import Controller 
     6from turbojson import jsonify 
    57from pagoda import config, workflow 
    68# Relative imports! 
     
    3032    def create(self): 
    3133        """Create a new instance of this content type.""" 
    32          
     34        pass 
    3335 
    3436    @expose() 
     
    4446         
    4547        """ 
    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) 
    5459            else: 
    5560                result = dict(success=True) 
     61            return result 
    5662        else: 
    57             result = dict(success=True) 
    58         return result 
     63            raise HTTPError( 
     64                status=400, 
     65                message="This resource makes modifications - use POST." 
     66            ) 
    5967 
    6068    @expose() 
  • pagoda/trunk/Pagoda/pagoda/plugins/models.py

    r541 r555  
    4646    """ 
    4747    query = Node.query_revision(revision).filter_by( 
    48         url=url, parent_id=parent_id 
     48        node_url=url, parent_id=parent_id 
    4949    ) 
    5050    try: 
     
    5555        model = get_content_model(content_type) 
    5656        content = model.query_revision(revision).get_by( 
    57             url=url, parent_id=parent_id 
     57            node_url=url, parent_id=parent_id 
    5858        ) 
    5959        if content: 
  • pagoda/trunk/Pagoda/pagoda/templates/admin/admin.html

    r553 r555  
    3939        </li> 
    4040    </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> 
    4150</div> 
    4251 
  • pagoda/trunk/Pagoda/pagoda/templates/admin/schedule.html

    r528 r555  
    4040                <li py:for="i, revision in revisions" class="${pagoda.util.even_odd(i)}" 
    4141                    py:with="schedule = bool(revision.revision_release_time and revision.revision_release_time >= pagoda.now)"> 
    42                     <h3 class="title"><a title="Click to preview &bull; ${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 &bull; ${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)} 
    4444                    </a></h3> 
    4545                    <p class="status"> 
     
    5757                            <span py:when="False">new</span> 
    5858                            ${revision.content_type} 
    59                         </strong> by ${revision.author.user_name} 
     59                        </strong> by ${revision.revision_author.user_name} 
    6060                    </p> 
    6161                    <p class="comment" py:if="revision.revision_comment.strip()"> 
     
    9999                    class="${pagoda.util.even_odd(i)} ${is_expiration and 'expire' or 'release'}"> 
    100100                    <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} 
    102102                    </a></h3> 
    103103                    <p class="status" py:choose="is_expiration"> 
     
    116116                            <span py:when="False, False">new</span> 
    117117                            ${revision.content_type} 
    118                         </strong> by ${revision.author.user_name} 
     118                        </strong> by ${revision.revision_author.user_name} 
    119119                    </p> 
    120120                    <p class="comment" py:if="revision.revision_comment.strip()"> 
  • pagoda/trunk/Pagoda/pagoda/widgets/admin/panels.py

    r554 r555  
    11from toscawidgets.api import Widget, JSLink, CSSLink 
     2from turbogears import url 
     3from turbojson import jsonify 
    24from pagoda.widgets.admin.widgets import * 
    3 from turbojson import jsonify 
    45from pagoda import plugins 
    56 
     
    2829 
    2930class SiteTreePanel(Widget): 
    30     params = ['data_url', 'root_url', 'revision'] 
     31    params = ['edit_url', 'content_url', 'data_url', 'root_url', 'revision'] 
    3132    template = "genshi:pagoda.widgets.admin.templates.tree" 
    3233    css = [panels_css, site_tree_css] 
     
    4647    def controller_to_node(self, controller, descend=1): 
    4748        content = controller.get_content() 
     49        revision = controller.get_revision() 
    4850        children = controller.get_children() 
    4951        node = { 
    50             'text': content.url or '/'
     52            'text': content.nav_title or content.node_title
    5153            'id': content.content_id, 
    5254            'cls': children and 'folder' or 'file', 
     
    5456            'pagoda': { 
    5557                'content_id': content.content_id, 
     58                'content_type': content.content_type, 
    5659                'revision_id': content.revision_id, 
    5760                '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 
    6073            } 
    6174        } 
     
    6578                controller_to_node(child, descend - 1) for child in children] 
    6679        return node 
     80 
     81notifications_css = CSSLink( 
     82    modname=module_name, filename='static/css/notifications.css', 
     83    css=[admin_css] 
     84) 
     85 
     86notifications_base = JSLink( 
     87    modname=module_name, filename='static/javascript/notifications.js', 
     88    css=[notifications_css],  
     89    javascript=[admin_base] 
     90) 
     91 
     92class 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  
    1010    height: 16px; 
    1111    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; 
    1220} 
    1321 
  • pagoda/trunk/Pagoda/pagoda/widgets/admin/static/javascript/admin.js

    r449 r555  
    1212Ext.namespace("Pagoda", "Pagoda.util"); 
    1313 
    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'. 
     17Ext.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
     27Ext.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); 
    4533    } 
    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      
    6834}); 
     35Pagoda.JSON = new Ext.data.JSONConnection(); 
  • pagoda/trunk/Pagoda/pagoda/widgets/admin/static/javascript/edit.js

    r510 r555  
    4949 
    5050        // 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}); 
    5252 
    5353        // Add handler to resize column heights on iframe resize 
  • pagoda/trunk/Pagoda/pagoda/widgets/admin/static/javascript/iframe_autosize.js

    r488 r555  
    2222 *     resize(IFrameAutoSize this): Fires after the iframe is resized 
    2323 */ 
    24 Ext.IFrameAutoSize = function(element, config) { 
     24Ext.util.IFrameAutoSize = function(element, config) { 
    2525    // Allow Ext.Element constructor to run, using forceNew=true 
    2626    // 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); 
    2828 
    2929    // Raise error if element is not an IFRAME 
    3030    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." 
    3232    } 
    3333 
     
    6060 
    6161// Extend with Element to support resizing a DOM element. 
    62 Ext.extend(Ext.IFrameAutoSize, Ext.Element, { 
     62Ext.extend(Ext.util.IFrameAutoSize, Ext.Element, { 
    6363    // Schedule the next iframeAutoSize() call. 
    6464    iframePoll: function() { 
     
    9999    setHeight: function(height, animate) { 
    100100        this.fireEvent('beforeresize', this); 
    101         Ext.IFrameAutoSize.superclass.setHeight.call(this, height, animate); 
     101        Ext.util.IFrameAutoSize.superclass.setHeight.call(this, height, animate); 
    102102        this.fireEvent('resize', this); 
    103103    }, 
     
    135135 
    136136// Extend with Observable to support custom events 
    137 Ext.apply(Ext.IFrameAutoSize.prototype, Ext.util.Observable.prototype); 
     137Ext.apply(Ext.util.IFrameAutoSize.prototype, Ext.util.Observable.prototype); 
  • pagoda/trunk/Pagoda/pagoda/widgets/admin/static/javascript/site_tree.js

    r554 r555  
    33 
    44// Constructor for SiteTree class. 
     5// Config options: 
     6// `edit_url` must be the absolute URL to the 'edit' controller. 
    57// `tree_id` must be the ID of a block element on the page. 
    68// `data_url` must be a URL pointing to a JSON controller from which to 
    79// request node information. 
     10// `root_url` is similar to `data_url` but is only used to request the root node. 
    811 
    9 Pagoda.widgets.SiteTree = function(tree_id, data_url, root_url) {     
     12Pagoda.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     
    1028    // 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); 
    2643 
    2744    // Request the root node and render tree on success. 
    2845    conn = new Ext.data.Connection(); 
    2946    conn.request({ 
    30         url: root_url, 
     47        url: config.root_url, 
    3148        callback: function(options, success, response) { 
    3249            if (success) { 
     
    4663 
    4764    // 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'; 
    4966    this.menu = new Ext.menu.TreeMenu({ 
    5067        id: menu_id, 
     
    5572                itemCls: 'edit', 
    5673                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; 
    5983                } 
    6084            }), 
     
    6488                itemCls: 'add', 
    6589                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 
    68101                } 
    69102            }), 
     
    82115                itemCls: 'delete', 
    83116                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); 
    86153                } 
    87154            }), 
  • pagoda/trunk/Pagoda/pagoda/widgets/admin/templates/tree.html

    r459 r555  
    1212        Ext.namespace("Pagoda", "Pagoda.panels"); 
    1313        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            }); 
    1721        }); 
    1822    </script> 
  • pagoda/trunk/Pagoda/pagoda/widgets/admin/widgets.py

    r514 r555  
    1717) 
    1818 
     19notifications_css = CSSLink( 
     20    modname=module_name, filename='static/css/notifications.css', 
     21    css=[admin_css] 
     22) 
     23 
     24notifications_base = JSLink( 
     25    modname=module_name, filename='static/javascript/notifications.js', 
     26    css=[notifications_css], 
     27    javascript=[admin_base] 
     28) 
     29 
    1930edit_css = CSSLink( 
    2031    modname=module_name, filename='static/css/edit.css', 
     
    2435edit_base = JSLink( 
    2536    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] 
    2739) 
    2840 
  • pagoda/trunk/TestProject/testproject/model.py

    r554 r555  
    3232     
    3333    home_page = Page( 
    34         url=None, parent_id=None, content_locale='en_US', 
     34        node_url=None, parent_id=None, content_locale='en_US', 
    3535        node_title="Home", nav_show=True, revision_author_id=brian.user_id, 
    3636        content_type='page', revision_status=workflow.APPROVED 
     
    4040     
    4141    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', 
    4343        node_title="Welcome", nav_show=True, revision_author_id=brian.user_id, 
    4444        content_type='page', revision_status=workflow.APPROVED 
     
    4848 
    4949    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', 
    5151        node_title="Unit tests", nav_show=True, revision_author_id=brian.user_id, 
    5252        content_type='page', revision_status=workflow.APPROVED 
     
    5454     
    5555    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', 
    5757        node_title="Genshi templates", nav_show=True, 
    5858        revision_author_id=brian.user_id, content_type='page', 
     
    6262     
    6363    ets_page = Page( 
    64         url='eatthesandwich', parent_id=home_page.content_id, 
     64        node_url='eatthesandwich', parent_id=home_page.content_id, 
    6565        content_locale='en_US', node_title="Eat it", nav_show=True, 
    6666        revision_author_id=brian.user_id, content_type='page', 
     
    7575        document_id=pagoda_page.content_id, 
    7676        content_locale=pagoda_page.content_locale, 
     77        revision_author_id=ian.user_id, 
    7778        text_type='html', 
    7879        text=""" 
     
    8586        document_id=pagoda_page.content_id, 
    8687        content_locale=pagoda_page.content_locale, 
     88        revision_author_id=ian.user_id, 
    8789        text_type='html', 
    8890        text=""" 
     
    98100        document_id=pagoda_page.content_id, 
    99101        content_locale=pagoda_page.content_locale, 
     102        revision_author_id=ian.user_id, 
    100103        text_type='html', 
    101104        text=""" 
     
    108111    pagoda_page_revised = Page( 
    109112        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', 
    111114        nav_show=True, revision_author_id=brian.user_id, 
    112115        content_type='page', revision_status=workflow.PENDING, 
     
    120123        document_id=pagoda_page.content_id, 
    121124        content_locale=pagoda_page.content_locale, 
     125        revision_author_id=brian.user_id, 
    122126        text_type='html', 
    123127        text=""" 

Log in as guest/pagoda to create tickets