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

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

diff --git a/share/nitweb/directives/entity/location.html b/share/nitweb/directives/entity/location.html
new file mode 100644 (file)
index 0000000..7e817c6
--- /dev/null
@@ -0,0 +1,5 @@
+<span ng-if='mentity.location'>
+       <a ng-href="{{mentity.web_url}}">{{mentity.location.file}}
+               <span ng-if='mentity.location.line_start'>:{{mentity.location.line_start}}</span>
+       </a>
+</span>
index 2fd481c..c689277 100644 (file)
                                templateUrl: '/directives/entity/tag.html'
                        };
                })
+
+               .directive('entityLocation', function() {
+                       return {
+                               restrict: 'E',
+                               scope: {
+                                       mentity: '='
+                               },
+                               templateUrl: '/directives/entity/location.html'
+                       };
+               })
 })();