nitweb/angular: introduce entity-card directive
authorAlexandre Terrasa <alexandre@moz-code.org>
Wed, 1 Jun 2016 00:35:02 +0000 (20:35 -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/card.html [new file with mode: 0644]
share/nitweb/javascripts/entities.js
share/nitweb/stylesheets/nitweb.css

diff --git a/share/nitweb/directives/entity/card.html b/share/nitweb/directives/entity/card.html
new file mode 100644 (file)
index 0000000..aa9ccb3
--- /dev/null
@@ -0,0 +1,11 @@
+<div class='card'>
+       <div class='card-left text-center'>
+               <entity-tag mentity='mentity' />
+       </div>
+       <div class='card-body'>
+               <h5 class='card-heading'>
+                       <entity-signature mentity='mentity'/>
+               </h5>
+               <span class='synopsis' ng-bind-html='mentity.mdoc.html_synopsis' />
+       </div>
+</div>
index c689277..76ebcd9 100644 (file)
                                templateUrl: '/directives/entity/location.html'
                        };
                })
+
+               .directive('entityCard', function() {
+                       return {
+                               restrict: 'E',
+                               scope: {
+                                       mentity: '='
+                               },
+                               replace: true,
+                               templateUrl: '/directives/entity/card.html'
+                       };
+               })
 })();
index 2baad72..71c81c6 100644 (file)
@@ -48,11 +48,20 @@ a {
     width: 10000px;
 }
 
-.card-body {
+.card-body, .card-right, .card-left {
     display: table-cell;
     vertical-align: top;
 }
 
+.card-left, .card>.pull-left {
+    padding: 15px;
+       padding-right: 0px;
+}
+.card-right, .card>.pull-right {
+    padding: 15px;
+       padding-left: 0px;
+}
+
 /* doc */
 
 .nitdoc .synopsys {