nitweb/angular: add /group/:full_name page
authorAlexandre Terrasa <alexandre@moz-code.org>
Wed, 1 Jun 2016 02:26:51 +0000 (22:26 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Wed, 1 Jun 2016 03:54:06 +0000 (23:54 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

share/nitweb/directives/group-block.html [new file with mode: 0644]
share/nitweb/javascripts/nitweb.js
share/nitweb/views/group.html [new file with mode: 0644]

diff --git a/share/nitweb/directives/group-block.html b/share/nitweb/directives/group-block.html
new file mode 100644 (file)
index 0000000..ad7f00e
--- /dev/null
@@ -0,0 +1,21 @@
+<div class='media'>
+       <div class='media-left text-center' ng-if='mentity.visibility' ng-class='{
+                       "text-success": mentity.visibility == "public",
+                       "text-warning": mentity.visibility == "protected",
+                       "text-danger": mentity.visibility == "private",
+       }'>
+               <span class="glyphicon glyphicon-tag"></span>
+       </div>
+       <div class='media-body'>
+               <h5 class='media-heading'>
+                       <entity-signature mentity='mentity'/>
+               </h5>
+               <span class='synopsis'>{{mentity.mdoc.synopsis}}</span>
+               <div ng-if='recursive && mentity.mgroups'>
+                       <group-block mentity-id='mgroup' ng-repeat='mgroup in mentity.mgroups' />
+               </div>
+               <div ng-if='recursive && mentity.mmodules'>
+                       <module-block mentity-id='mmodule' ng-repeat='mmodule in mentity.mmodules' />
+               </div>
+       </div>
+</div>
index f5e06b2..da5af24 100644 (file)
                                controller: 'EntityCtrl',
                                controllerAs: 'entityCtrl'
                        })
+                       .when('/group/:id', {
+                               templateUrl: 'views/group.html',
+                               controller: 'EntityCtrl',
+                               controllerAs: 'entityCtrl'
+                       })
                        .otherwise({
                                redirectTo: '/'
                        });
diff --git a/share/nitweb/views/group.html b/share/nitweb/views/group.html
new file mode 100644 (file)
index 0000000..ef07e48
--- /dev/null
@@ -0,0 +1,21 @@
+<div class='container-fluid'>
+               <div class='page-header'>
+                       <h2><entity-signature mentity='mentity' /></h2>
+                       <entity-link mentity='mentity.mpackage' /> :: {{mentity.name}}
+               </div>
+
+               <ul class='nav nav-tabs'>
+                       <li class='active'>
+                               <a data-toggle='tab' data-target='#doc'>
+                                       <span class='glyphicon glyphicon-book'/> Doc
+                               </a>
+                       </li>
+               </ul>
+
+               <div class='tab-content'>
+                       <div class='tab-pane fade in active' id='doc'>
+                               <entity-doc mentity='mentity'/>
+                       </div>
+               </div>
+       </div>
+</div>