Commit a5c8af32b873ae59c3edb0bcde46ff65c37ca370
1 parent
57ff7b38
Exists in
master
and in
2 other branches
Filter tags
Showing
2 changed files
with
19 additions
and
15 deletions
Show diff stats
ConfJuvApp/www/html/_proposal.html
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 | |
24 | 24 | <p class="proposal-badges"> |
25 | 25 | <img ng-src="img/badge-{{proposal.topic.id}}.svg" alt="" /> |
26 | - <img ng-repeat="tag in proposal.tag_list" ng-src="https://img.shields.io/badge/tag-{{tag}}-4db6ac.svg" alt="" /> | |
26 | + <img ng-repeat="tag in proposal.tag_list" ng-src="https://img.shields.io/badge/tag-{{tag | tagFilter}}-4db6ac.svg" alt="" /> | |
27 | 27 | </p> |
28 | 28 | |
29 | 29 | <p>{{proposal.body | htmlToPlainText}}</p> | ... | ... |
ConfJuvApp/www/js/filters.js
1 | 1 | angular.module('confjuvapp.filters', []). |
2 | - filter('htmlToPlainText', function() { | |
3 | - return function(text) { | |
4 | - return String(text).replace(/<[^>]+>/gm, ''); | |
5 | - }; | |
6 | - } | |
7 | -).filter('categoryType', function() { | |
8 | - return function(categories, type) { | |
9 | - for (var i = 0; i < categories.length; i++) { | |
10 | - if(categories[i].type.toLowerCase() == type){ | |
11 | - return categories[i].name; | |
12 | - } | |
2 | +filter('htmlToPlainText', function() { | |
3 | + return function(text) { | |
4 | + return String(text).replace(/<[^>]+>/gm, ''); | |
5 | + }; | |
6 | +}). | |
7 | +filter('categoryType', function() { | |
8 | + return function(categories, type) { | |
9 | + for (var i = 0; i < categories.length; i++) { | |
10 | + if (categories[i].type.toLowerCase() == type) { | |
11 | + return categories[i].name; | |
13 | 12 | } |
14 | - }; | |
15 | - } | |
16 | -); | |
13 | + } | |
14 | + }; | |
15 | +}). | |
16 | +filter('tagFilter', function() { | |
17 | + return function(text) { | |
18 | + return String(text).replace(/#/gm, ''); | |
19 | + }; | |
20 | +}); | ... | ... |