Commit 461aaa508098d48e7645c90d423e68476b219bd3
1 parent
9e273998
Exists in
master
and in
38 other branches
Improve truncate function
Showing
4 changed files
with
5 additions
and
4 deletions
Show diff stats
bower.json
@@ -21,7 +21,8 @@ | @@ -21,7 +21,8 @@ | ||
21 | "ngstorage": "~0.3.10", | 21 | "ngstorage": "~0.3.10", |
22 | "bootswatch": "~3.3.6", | 22 | "bootswatch": "~3.3.6", |
23 | "angular-moment": "~0.10.3", | 23 | "angular-moment": "~0.10.3", |
24 | - "lodash": "3.10.1" | 24 | + "lodash": "3.10.1", |
25 | + "angular-filter": "~0.5.8" | ||
25 | }, | 26 | }, |
26 | "devDependencies": { | 27 | "devDependencies": { |
27 | "angular-mocks": "~1.4.2" | 28 | "angular-mocks": "~1.4.2" |
src/app/components/noosfero-activities/activity/create_article.html
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | <a ng-href="/{{vm.activity.target.article.profile.identifier}}/{{vm.activity.target.article.path}}">{{vm.activity.target.article.title}}</a> | 12 | <a ng-href="/{{vm.activity.target.article.profile.identifier}}/{{vm.activity.target.article.path}}">{{vm.activity.target.article.title}}</a> |
13 | </div> | 13 | </div> |
14 | <div class="lead small"> | 14 | <div class="lead small"> |
15 | - <div ng-bind-html="vm.activity.target.article.body | limitTo: 50"></div> | 15 | + <div ng-bind-html="vm.activity.target.article.body | stripTags | truncate: 100 : '...'"></div> |
16 | </div> | 16 | </div> |
17 | </div> | 17 | </div> |
18 | </div> | 18 | </div> |
src/app/components/noosfero-articles/blog/blog.html
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | <div ng-repeat="child in vm.article.children | orderBy: 'created_at':true"> | 11 | <div ng-repeat="child in vm.article.children | orderBy: 'created_at':true"> |
12 | <div class="page-header"> | 12 | <div class="page-header"> |
13 | <a ng-href="/{{vm.profile.identifier}}/{{child.path}}"><h4 ng-bind="child.title"></h4></a> | 13 | <a ng-href="/{{vm.profile.identifier}}/{{child.path}}"><h4 ng-bind="child.title"></h4></a> |
14 | - <div ng-bind-html="child.body | limitTo: 500"></div> | 14 | + <div ng-bind-html="child.body | truncate: 500: '...'"></div> |
15 | </div> | 15 | </div> |
16 | </div> | 16 | </div> |
17 | </div> | 17 | </div> |
src/app/index.module.js
@@ -5,6 +5,6 @@ | @@ -5,6 +5,6 @@ | ||
5 | .module('angular', ['ngAnimate', 'ngCookies', 'ngStorage', 'ngTouch', | 5 | .module('angular', ['ngAnimate', 'ngCookies', 'ngStorage', 'ngTouch', |
6 | 'ngSanitize', 'ngMessages', 'ngAria', 'restangular', | 6 | 'ngSanitize', 'ngMessages', 'ngAria', 'restangular', |
7 | 'ui.router', 'ui.bootstrap', 'toastr', | 7 | 'ui.router', 'ui.bootstrap', 'toastr', |
8 | - 'angularMoment']); | 8 | + 'angularMoment', 'angular.filter']); |
9 | 9 | ||
10 | })(); | 10 | })(); |