Commit af7485cb8a9c42a7c18f4d8331fd2463cfbc33b0
1 parent
2709e359
Exists in
master
and in
1 other branch
Add filter to replace noosfero template attributes
Showing
3 changed files
with
14 additions
and
2 deletions
Show diff stats
src/app/components/noosfero-blocks/link-list/link-list.html
| 1 | <div ng-repeat="link in vm.links"> | 1 | <div ng-repeat="link in vm.links"> |
| 2 | - <a class="icon-{{link.icon}}" ng-href="{{link.address}}">{{link.name}}</a> | 2 | + <a class="icon-{{link.icon}}" ng-href="{{link.address | noosferoTemplateFilter:{profile: vm.owner.identifier} }}">{{link.name}}</a> |
| 3 | </div> | 3 | </div> |
| @@ -0,0 +1,13 @@ | @@ -0,0 +1,13 @@ | ||
| 1 | +(function() { | ||
| 2 | + 'use strict'; | ||
| 3 | + angular | ||
| 4 | + .module("angular") | ||
| 5 | + .filter("noosferoTemplateFilter", function() { | ||
| 6 | + return function(text, options) { | ||
| 7 | + for(var option in options) { | ||
| 8 | + text = text.replace('{'+option+'}', options[option]); | ||
| 9 | + } | ||
| 10 | + return text; | ||
| 11 | + } | ||
| 12 | + }) | ||
| 13 | +})(); |
src/app/views/profile/block.html
| @@ -3,7 +3,6 @@ | @@ -3,7 +3,6 @@ | ||
| 3 | <h3 class="panel-title">{{block.title}}</h3> | 3 | <h3 class="panel-title">{{block.title}}</h3> |
| 4 | </div> | 4 | </div> |
| 5 | <div class="panel-body"> | 5 | <div class="panel-body"> |
| 6 | - <pre>{{block}}</pre> | ||
| 7 | <noosfero-block block="block" owner="main.owner"></noosfero-block> | 6 | <noosfero-block block="block" owner="main.owner"></noosfero-block> |
| 8 | </div> | 7 | </div> |
| 9 | </div> | 8 | </div> |