nitweb/angular: introduce entity-list directive
authorAlexandre Terrasa <alexandre@moz-code.org>
Wed, 1 Jun 2016 00:37:09 +0000 (20:37 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Thu, 2 Jun 2016 03:55:40 +0000 (23:55 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

share/nitweb/directives/entity/list.html [new file with mode: 0644]
share/nitweb/javascripts/entities.js
share/nitweb/stylesheets/nitweb.css

diff --git a/share/nitweb/directives/entity/list.html b/share/nitweb/directives/entity/list.html
new file mode 100644 (file)
index 0000000..9e40d82
--- /dev/null
@@ -0,0 +1,11 @@
+<div ng-if='listEntities.length > 0'>
+       <h3 id={{listId}}>
+               <span>{{listTitle}}</span>
+       </h3>
+               <div class='card-list'>
+                       <entity-card
+                               mentity='mentity'
+                               ng-repeat='mentity in listEntities' />
+               </div>
+       </div>
+</div>
index 76ebcd9..e56d676 100644 (file)
                                templateUrl: '/directives/entity/card.html'
                        };
                })
+
+               .directive('entityList', function() {
+                       return {
+                               restrict: 'E',
+                               scope: {
+                                       listEntities: '=',
+                                       listTitle: '@',
+                               },
+                               templateUrl: '/directives/entity/list.html',
+                       };
+               })
 })();
index 71c81c6..ccecb1b 100644 (file)
@@ -62,6 +62,19 @@ a {
        padding-left: 0px;
 }
 
+.card-list {
+       margin-top: 10px;
+}
+
+.card-list > .card:first-child {
+       border-top: 1px solid #ccc;
+}
+
+.card-list > .card {
+       margin-top: 0;
+       border-top: none;
+}
+
 /* doc */
 
 .nitdoc .synopsys {