From af7485cb8a9c42a7c18f4d8331fd2463cfbc33b0 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Thu, 7 Jan 2016 17:31:35 -0300 Subject: [PATCH] Add filter to replace noosfero template attributes --- src/app/components/noosfero-blocks/link-list/link-list.html | 2 +- src/app/components/noosfero/noosfero-template.filter.js | 13 +++++++++++++ src/app/views/profile/block.html | 1 - 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 src/app/components/noosfero/noosfero-template.filter.js diff --git a/src/app/components/noosfero-blocks/link-list/link-list.html b/src/app/components/noosfero-blocks/link-list/link-list.html index 2bc871f..8ed43c8 100644 --- a/src/app/components/noosfero-blocks/link-list/link-list.html +++ b/src/app/components/noosfero-blocks/link-list/link-list.html @@ -1,3 +1,3 @@
- {{link.name}} + {{link.name}}
diff --git a/src/app/components/noosfero/noosfero-template.filter.js b/src/app/components/noosfero/noosfero-template.filter.js new file mode 100644 index 0000000..0128d91 --- /dev/null +++ b/src/app/components/noosfero/noosfero-template.filter.js @@ -0,0 +1,13 @@ +(function() { + 'use strict'; + angular + .module("angular") + .filter("noosferoTemplateFilter", function() { + return function(text, options) { + for(var option in options) { + text = text.replace('{'+option+'}', options[option]); + } + return text; + } + }) +})(); diff --git a/src/app/views/profile/block.html b/src/app/views/profile/block.html index 19d380b..4fcc85b 100644 --- a/src/app/views/profile/block.html +++ b/src/app/views/profile/block.html @@ -3,7 +3,6 @@

{{block.title}}

-
{{block}}
-- libgit2 0.21.2