From 8fed4d31dc1238e9e90c09bfd377611f871d1e12 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 9 Jul 2014 10:41:01 +0200 Subject: [PATCH] Fixing issue histoy when we had description changes --- app/coffee/modules/issues/detail.coffee | 7 +++++++ app/partials/views/modules/activity.jade | 6 ++++-- app/partials/views/modules/comment-activity.jade | 6 ++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/coffee/modules/issues/detail.coffee b/app/coffee/modules/issues/detail.coffee index 83b756e9..2194682f 100644 --- a/app/coffee/modules/issues/detail.coffee +++ b/app/coffee/modules/issues/detail.coffee @@ -74,6 +74,13 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin) loadHistory: -> return @rs.issues.history(@scope.issueId).then (history) => + _.each history.results, (historyResult) -> + #If description was modified take only the description_html field + if historyResult.values_diff.description? + historyResult.values_diff.description = historyResult.values_diff.description_html + delete historyResult.values_diff.description_html + delete historyResult.values_diff.description_diff + @scope.history = history.results @scope.comments = _.filter(history.results, (historyEntry) -> historyEntry.comment != "") diff --git a/app/partials/views/modules/activity.jade b/app/partials/views/modules/activity.jade index d896cf29..ce898a17 100644 --- a/app/partials/views/modules/activity.jade +++ b/app/partials/views/modules/activity.jade @@ -14,9 +14,11 @@ section.us-activity.hidden span(tg-bo-html="key") div.activity-fromto p - strong from
{{ ctrl.getChangeText(change[0]) }} + strong from
+ span(tg-bo-html="ctrl.getChangeText(change[0])") p - strong to
{{ ctrl.getChangeText(change[1]) }} + strong to
+ span(tg-bo-html="ctrl.getChangeText(change[1])") //a.more-activity(href="", title="show more comments") // span show previous activity diff --git a/app/partials/views/modules/comment-activity.jade b/app/partials/views/modules/comment-activity.jade index 68e09b72..dca7e845 100644 --- a/app/partials/views/modules/comment-activity.jade +++ b/app/partials/views/modules/comment-activity.jade @@ -9,6 +9,8 @@ div.us-activity span(tg-bo-html="key") div.activity-fromto p - strong from
{{ ctrl.getChangeText(change[0]) }} + strong from
+ span(tg-bo-html="ctrl.getChangeText(change[0])") p - strong to
{{ ctrl.getChangeText(change[1]) }} + strong to
+ span(tg-bo-html="ctrl.getChangeText(change[1])")