var app = angular.module('materialscommons', ['CornerCouch', 'ui', 'Filter', 'materialsCommonsServices', 'materialsdirective', 'jqyoui', 'AngularStomp', 'ui.bootstrap', 'smartTable.table','smartTable.column','flash']);

app.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
    Stomp.WebSocketClass = SockJS;
    $routeProvider.
        when('/home', {templateUrl: 'partials/home.html', controller: HomeController}).
        when('/data', {templateUrl: 'partials/under-construction.html', controller: DataSearchController}).
        when('/models', {templateUrl: 'partials/under-construction.html', controller: ModelsSearchController}).
        when('/mylab/:tab/:subpage/:id', {templateUrl: 'partials/mylab/mylab.html', controller: MyLabTabController}).
        when('/searchindex/:subpage/:name', {templateUrl: 'partials/search_repository.html', controller: SearchIndexController}).
        when('/login', {templateUrl: 'partials/login.html', controller: LoginController}).
        when('/logout', {templateUrl: 'partials/about.html', controller: LogOutController}).
        when('/explore', {templateUrl: 'partials/under-construction.html', controller: ExploreController}).
        when('/about', {templateUrl: 'partials/about.html', controller: AboutController}).
        when('/contact', {templateUrl: 'partials/under-construction.html', controller: ContactController}).
        when('/help', {templateUrl: 'partials/under-construction.html', controller: HelpController}).
        when('/search', {templateUrl: 'partials/search_repository.html', controller: SearchIndexController}).
        when('/datagroups', {templateUrl: 'partials/datagroups/my_data_groups.html', controller: DataGroupController}).
        when('/my_data', {templateUrl: 'partials/datagroups/my_data.html', controller: DataGroupController}).
        when('/my_lab', {templateUrl: 'partials/datagroups/my_lab.html', controller: DataGroupController}).
        when('/results_by_date', {templateUrl: 'partials/datagroups/results_by_date.html', controller: DataGroupController}).

        when('/user_functions', {templateUrl: 'partials/user_functions.html', controller: FrontPageController}).
        when('/create-account', {templateUrl: 'partials/create-account.html', controller: AccountController}).
        otherwise({redirectTo: '/home'});
}
]);
app.run(function($rootScope, $location, User) {
    $rootScope.$on('$routeChangeStart', function(event, next, current) {
        //console.dir(next);
        //console.log(next.templateUrl);
        //console.log(next.controller);
        if (matchesPartial(next, "partials/front-page", "ignore")) {
            setActiveMainNav("#home-nav");
        }
        else if (matchesPartial(next, "partials/user_functions", "UserFunctionsController")) {
            setActiveMainNav("#user-nav");
        }
        else if (matchesPartial(next, "partials/explore", "ExploreController")) {
            setActiveMainNav("#explore-nav");
        }
        else if (matchesPartial(next, "partials/about", "AboutController")) {
            setActiveMainNav('#about-nav');
        }
        else if (matchesPartial(next, "partials/contact", "ContactController")) {
            setActiveMainNav('#contact-nav');
        }
        else if (matchesPartial(next, "partials/help", "HelpController")) {
            setActiveMainNav("#help-nav");
        }
//        else if (matchesPartial(next, "partials/data", "DataSearchController")) {
//            setActiveMainNav("#finddata");
//        }
//        else if (matchesPartial(next, "partials/models", "ModelsSearchController")) {
//            setActiveMainNav("#findmodels");
//        }

        if (true) {
        //    return;
        }

        if (!User.isAuthenticated()) {
            if (next.templateUrl && next.templateUrl.indexOf("partials/user_functions") != -1) {
                $location.path("/login");
            }
        }
        else {
            //console.log("  User is authenticated");
        }
    });

});

function matchesPartial(next, what, controller) {
    if (!next.templateUrl) {
        return false;
    }
    else {
        var value = next.templateUrl.indexOf(what) != -1;
        /*
        Hack to look at controller name to figure out tab. We do this so that partials can be
        shared by controllers, but we need to show which tab is active. So, we look at the
        name of the controller (only if controller != 'ignore').
         */
        if (controller == "ignore") {
            return value;
        }
        else if (value) {
            return true;
        }
        else {
            return next.controller.toString().indexOf(controller) != -1;
        }
    }
}

@@ -1353,34 +1353,23 @@
 artials/
-under-construction
+contact
 .html', 
@@ -1447,34 +1447,20 @@
 artials/
-under-construction
+help
 .html', 
@@ -2461,118 +2461,8 @@
 ) %7B%0A
-        //console.dir(next);%0A        //console.log(next.templateUrl);%0A        //console.log(next.controller);%0A
     
@@ -2514,22 +2514,30 @@
 page%22, %22
-ignore
+HomeController
 %22)) %7B%0A  
@@ -3544,24 +3544,24 @@
 ndmodels%22);%0A
+
 //        %7D%0A
@@ -3565,61 +3565,8 @@
  %7D%0A%0A
-        if (true) %7B%0A        //    return;%0A        %7D%0A%0A
     

Add in login and contact partials. Fix up two tab highlighting.