nitweb/angular: unify documentation packages
authorAlexandre Terrasa <alexandre@moz-code.org>
Tue, 21 Jun 2016 15:50:23 +0000 (11:50 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Wed, 22 Jun 2016 01:26:49 +0000 (21:26 -0400)
no more /package /group etc...

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

share/nitweb/javascripts/nitweb.js
share/nitweb/views/doc.html [new file with mode: 0644]

index 93b7c3a..94c9d9a 100644 (file)
                                controller: 'IndexCtrl',
                                controllerAs: 'indexCtrl'
                        })
-                       .when('/package/:id', {
-                               templateUrl: 'views/package.html',
-                               controller: 'EntityCtrl',
-                               controllerAs: 'entityCtrl'
-                       })
-                       .when('/group/:id', {
-                               templateUrl: 'views/group.html',
-                               controller: 'EntityCtrl',
-                               controllerAs: 'entityCtrl'
-                       })
-                       .when('/module/:id', {
-                               templateUrl: 'views/module.html',
-                               controller: 'EntityCtrl',
-                               controllerAs: 'entityCtrl'
-                       })
-                       .when('/class/:id', {
-                               templateUrl: 'views/class.html',
-                               controller: 'EntityCtrl',
-                               controllerAs: 'entityCtrl'
-                       })
-                       .when('/classdef/:id', {
-                               templateUrl: 'views/classdef.html',
-                               controller: 'EntityCtrl',
-                               controllerAs: 'entityCtrl'
-                       })
-                       .when('/property/:id', {
-                               templateUrl: 'views/property.html',
-                               controller: 'EntityCtrl',
-                               controllerAs: 'entityCtrl'
-                       })
-                       .when('/propdef/:id', {
-                               templateUrl: 'views/propdef.html',
+                       .when('/doc/:id', {
+                               templateUrl: 'views/doc.html',
                                controller: 'EntityCtrl',
                                controllerAs: 'entityCtrl'
                        })
diff --git a/share/nitweb/views/doc.html b/share/nitweb/views/doc.html
new file mode 100644 (file)
index 0000000..0362502
--- /dev/null
@@ -0,0 +1,29 @@
+<div class='container-fluid'>
+       <div class='page-header'>
+               <h2><entity-signature mentity='mentity' /></h2>
+               <entity-namespace mentity='mentity' />
+       </div>
+       <div ng-switch='mentity.class_name'>
+               <div ng-switch-when='MPackage'>
+                       <div ng-include src='"/views/package.html"' />
+               </div>
+               <div ng-switch-when='MGroup'>
+                       <div ng-include src='"/views/group.html"' />
+               </div>
+               <div ng-switch-when='MModule'>
+                       <div ng-include src='"/views/module.html"' />
+               </div>
+               <div ng-switch-when='MClass'>
+                       <div ng-include src='"/views/class.html"' />
+               </div>
+               <div ng-switch-when='MClassDef'>
+                       <div ng-include src='"/views/classdef.html"' />
+               </div>
+               <div ng-switch-when='MMethod' ng-switch-when='MAttribute' ng-switch-when='MVirtualTypeProp'>
+                       <div ng-include src='"/views/property.html"' />
+               </div>
+               <div ng-switch-when='MMethodDef' ng-switch-when='MAttributeDef' ng-switch-when='MVirtualTypeDef'>
+                       <div ng-include src='"/views/propdef.html"' />
+               </div>
+       </div>
+</div>