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

diff --git a/share/nitweb/directives/entity/tag.html b/share/nitweb/directives/entity/tag.html
new file mode 100644 (file)
index 0000000..7c69f1e
--- /dev/null
@@ -0,0 +1,5 @@
+<span class="glyphicon glyphicon-tag" ng-class='{
+               "text-success": mentity.visibility == "public",
+               "text-warning": mentity.visibility == "protected",
+               "text-danger": mentity.visibility == "private",
+}' />
index 4fe181b..2fd481c 100644 (file)
                                templateUrl: '/directives/entity/signature.html'
                        };
                })
+
+               .directive('entityTag', function() {
+                       return {
+                               restrict: 'E',
+                               scope: {
+                                       mentity: '='
+                               },
+                               replace: true,
+                               templateUrl: '/directives/entity/tag.html'
+                       };
+               })
 })();