/**
 * This view shows a list of global navigation links that should be
 * displayed at all times.
 */
girder.views.LayoutGlobalNavView = girder.View.extend({
    events: {
        'click .g-nav-link': function (event) {
            var link = $(event.currentTarget);

            girder.router.navigate(link.attr('g-target'), {trigger: true});

            // Must call this after calling navigateTo, since that
            // deactivates all global nav links.
            link.parent().addClass('g-active');
        }
    },

    initialize: function () {
        girder.events.on('g:highlightItem', this.selectForView, this);
        girder.events.on('g:login', this.render, this);
    },

    render: function () {
        var navItems = [{
            name: 'Collections',
            icon: 'icon-sitemap',
            target: 'collections'
        }, {
            name: 'Users',
            icon: 'icon-user',
            target: 'users'
        }, {
            name: 'Groups',
            icon: 'icon-users',
            target: 'groups'
        }];
        if (girder.currentUser && girder.currentUser.get('admin')) {
            navItems.push({
                name: 'Admin console',
                icon: 'icon-wrench',
                target: 'admin'
            });
        }
        this.$el.html(jade.templates.layoutGlobalNav({
            navItems: navItems
        }));

        if (Backbone.history.fragment) {
            this.$('[g-target="' + Backbone.history.fragment + '"]')
                .parent().addClass('g-active');
        }

        return this;
    },

    /**
     * Highlight the item with the given target attribute, which is the name
     * of the view it navigates to.
     */
    selectForView: function (viewName) {
        this.deactivateAll();
        this.$('[g-name="' + viewName.slice(0, -4) + '"]').parent().addClass('g-active');
    },

    deactivateAll: function () {
        this.$('.g-global-nav-li').removeClass('g-active');
    }
});

@@ -539,32 +539,40 @@
 lize: function (
+settings
 ) %7B%0A        gird
@@ -690,39 +690,114 @@
 s);%0A
+%0A
     
-%7D,%0A%0A    render: function ()
+   if (settings && settings.navItems) %7B%0A            this.navItems = settings.navItems;%0A        %7D else
  %7B%0A 
@@ -803,20 +803,25 @@
         
-var 
+    this.
 navItems
@@ -826,16 +826,20 @@
 ms = %5B%7B%0A
+    
         
@@ -867,32 +867,36 @@
 s',%0A            
+   
+ 
 icon: 'icon-site
@@ -901,16 +901,20 @@
 temap',%0A
+    
         
@@ -939,37 +939,45 @@
 ctions'%0A        
+   
+ 
 %7D, %7B%0A
+    
             name
@@ -991,32 +991,36 @@
 s',%0A            
+  
+  
 icon: 'icon-user
@@ -1026,32 +1026,36 @@
 r',%0A            
+    
 target: 'users'%0A
@@ -1054,37 +1054,45 @@
 'users'%0A        
+  
+  
 %7D, %7B%0A
+    
             name
@@ -1107,32 +1107,36 @@
 s',%0A            
+ 
+   
 icon: 'icon-user
@@ -1143,32 +1143,36 @@
 s',%0A            
+    
 target: 'groups'
@@ -1184,12 +1184,20 @@
     
+ 
+   
 %7D%5D;%0A
+    
     
@@ -1265,32 +1265,41 @@
 ) %7B%0A            
+    this.
 navItems.push(%7B%0A
@@ -1298,16 +1298,20 @@
 .push(%7B%0A
+    
         
@@ -1349,32 +1349,36 @@
                 
+  
+  
 icon: 'icon-wren
@@ -1390,32 +1390,36 @@
                 
+    
 target: 'admin'%0A
@@ -1430,16 +1430,20 @@
         
+  
+  
 %7D);%0A    
@@ -1442,25 +1442,75 @@
 %7D);%0A        
-%7D
+    %7D%0A        %7D%0A%0A     %7D,%0A%0A    render: function () %7B
 %0A        thi
@@ -1575,16 +1575,21 @@
 vItems: 
+this.
 navItems

allow navItems to be customized