From ae25ecf98321953be70805a1f2c00617f4004d16 Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Tue, 31 May 2016 20:21:06 -0400 Subject: [PATCH] nitweb/angular: introduce entity-link directives Signed-off-by: Alexandre Terrasa --- share/nitweb/directives/entity/link.html | 3 +++ share/nitweb/index.html | 1 + share/nitweb/javascripts/entities.js | 30 ++++++++++++++++++++++++++++++ share/nitweb/stylesheets/nitweb.css | 4 ++++ 4 files changed, 38 insertions(+) create mode 100644 share/nitweb/directives/entity/link.html create mode 100644 share/nitweb/javascripts/entities.js diff --git a/share/nitweb/directives/entity/link.html b/share/nitweb/directives/entity/link.html new file mode 100644 index 0000000..740ea8b --- /dev/null +++ b/share/nitweb/directives/entity/link.html @@ -0,0 +1,3 @@ + + {{mentity.name}} + diff --git a/share/nitweb/index.html b/share/nitweb/index.html index e8d18ee..2a4bdde 100644 --- a/share/nitweb/index.html +++ b/share/nitweb/index.html @@ -39,5 +39,6 @@ + diff --git a/share/nitweb/javascripts/entities.js b/share/nitweb/javascripts/entities.js new file mode 100644 index 0000000..a2854aa --- /dev/null +++ b/share/nitweb/javascripts/entities.js @@ -0,0 +1,30 @@ +/* + * Copyright 2016 Alexandre Terrasa . + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +(function() { + angular + .module('entities', ['model', 'ui']) + + .directive('entityLink', function() { + return { + restrict: 'E', + scope: { + mentity: '=' + }, + templateUrl: '/directives/entity/link.html' + }; + }) +})(); diff --git a/share/nitweb/stylesheets/nitweb.css b/share/nitweb/stylesheets/nitweb.css index 5675cab..1f6d033 100644 --- a/share/nitweb/stylesheets/nitweb.css +++ b/share/nitweb/stylesheets/nitweb.css @@ -9,3 +9,7 @@ body { h1, h2, h3, h4, h5, h6 { color: #666; } + +a { + cursor: pointer; +} -- 1.7.9.5