2 * Copyright 2016 Alexandre Terrasa <alexandre@moz-code.org>.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 .module('entities', ['ui', 'model'])
21 .controller('EntityCtrl', ['Model', '$routeParams', '$scope', function(Model
, $routeParams
, $scope
) {
22 this.loadEntityLinearization
= function() {
23 Model
.loadEntityLinearization($routeParams
.id
,
25 $scope
.linearization
= data
;
31 Model
.loadEntity($routeParams
.id
,
33 $scope
.mentity
= data
;
39 .directive('entityLink', function() {
45 templateUrl
: '/directives/entity/link.html'
49 .directive('entityDoc', function() {
55 templateUrl
: '/directives/entity/doc.html'
59 .directive('entitySignature', function() {
65 templateUrl
: '/directives/entity/signature.html'
69 .directive('entityTag', function() {
76 templateUrl
: '/directives/entity/tag.html'
80 .directive('entityLocation', function() {
86 templateUrl
: '/directives/entity/location.html'
90 .directive('entityCard', function() {
97 templateUrl
: '/directives/entity/card.html'
101 .directive('entityList', function() {
108 listObjectFilter
: '=',
110 templateUrl
: '/directives/entity/list.html',
111 link
: function ($scope
, element
, attrs
) {
112 $scope
.showFilters
= false;
113 if(!$scope
.listObjectFilter
) {
114 $scope
.listObjectFilter
= {};
116 if(!$scope
.visibilityFilter
) {
117 $scope
.visibilityFilter
= {
123 $scope
.toggleFilters
= function() {
124 $scope
.showFilters
= !$scope
.showFilters
;