new timeline escaped content
parent
d27f612bb8
commit
df53cbd0ac
|
@ -61,7 +61,7 @@ timelineType = (timeline, event) ->
|
||||||
key: 'TIMELINE.NEW_COMMENT_US',
|
key: 'TIMELINE.NEW_COMMENT_US',
|
||||||
translate_params: ['username', 'obj_name'],
|
translate_params: ['username', 'obj_name'],
|
||||||
description: (timeline) ->
|
description: (timeline) ->
|
||||||
return taiga.stripTags(timeline.data.comment_html, 'br|p')
|
return timeline.data.comment
|
||||||
},
|
},
|
||||||
{ # NewIssueComment
|
{ # NewIssueComment
|
||||||
check: (timeline, event) ->
|
check: (timeline, event) ->
|
||||||
|
@ -69,8 +69,7 @@ timelineType = (timeline, event) ->
|
||||||
key: 'TIMELINE.NEW_COMMENT_ISSUE',
|
key: 'TIMELINE.NEW_COMMENT_ISSUE',
|
||||||
translate_params: ['username', 'obj_name'],
|
translate_params: ['username', 'obj_name'],
|
||||||
description: (timeline) ->
|
description: (timeline) ->
|
||||||
text = taiga.replaceTags(timeline.data.comment_html, 'h1|h2|h3', 'p')
|
return timeline.data.comment
|
||||||
return taiga.stripTags(text, 'br|p')
|
|
||||||
},
|
},
|
||||||
{ # NewTask
|
{ # NewTask
|
||||||
check: (timeline, event) ->
|
check: (timeline, event) ->
|
||||||
|
@ -78,7 +77,7 @@ timelineType = (timeline, event) ->
|
||||||
key: 'TIMELINE.NEW_COMMENT_TASK'
|
key: 'TIMELINE.NEW_COMMENT_TASK'
|
||||||
translate_params: ['username', 'obj_name'],
|
translate_params: ['username', 'obj_name'],
|
||||||
description: (timeline) ->
|
description: (timeline) ->
|
||||||
return taiga.stripTags(timeline.data.comment_html, 'br|p')
|
return timeline.data.comment
|
||||||
},
|
},
|
||||||
{ # UsToMilestone
|
{ # UsToMilestone
|
||||||
check: (timeline, event, field_name) ->
|
check: (timeline, event, field_name) ->
|
||||||
|
@ -107,7 +106,7 @@ timelineType = (timeline, event) ->
|
||||||
key: 'TIMELINE.BLOCKED',
|
key: 'TIMELINE.BLOCKED',
|
||||||
translate_params: ['username', 'obj_name'],
|
translate_params: ['username', 'obj_name'],
|
||||||
description: (timeline) ->
|
description: (timeline) ->
|
||||||
return taiga.stripTags(timeline.data.values_diff.blocked_note_html[1], 'br')
|
return $(timeline.data.values_diff.blocked_note_html[1]).text()
|
||||||
},
|
},
|
||||||
{ # UnBlocked
|
{ # UnBlocked
|
||||||
check: (timeline, event) ->
|
check: (timeline, event) ->
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
class UserTimelineItemController
|
class UserTimelineItemController
|
||||||
@.$inject = [
|
@.$inject = [
|
||||||
"$sce",
|
|
||||||
"tgUserTimelineItemType",
|
"tgUserTimelineItemType",
|
||||||
"tgUserTimelineItemTitle"
|
"tgUserTimelineItemTitle"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@sce, @userTimelineItemType, @userTimelineItemTitle) ->
|
constructor: (@userTimelineItemType, @userTimelineItemTitle) ->
|
||||||
timeline = @.timeline.toJS()
|
timeline = @.timeline.toJS()
|
||||||
event = @.parseEventType(timeline.event_type)
|
event = @.parseEventType(timeline.event_type)
|
||||||
type = @userTimelineItemType.getType(timeline, event)
|
type = @userTimelineItemType.getType(timeline, event)
|
||||||
|
@ -20,7 +19,7 @@ class UserTimelineItemController
|
||||||
@.activity.obj = @.getObject(timeline, event)
|
@.activity.obj = @.getObject(timeline, event)
|
||||||
|
|
||||||
if type.description
|
if type.description
|
||||||
@.activity.description = @sce.trustAsHtml(type.description(timeline))
|
@.activity.description = type.description(timeline)
|
||||||
|
|
||||||
if type.member
|
if type.member
|
||||||
@.activity.member = type.member(timeline)
|
@.activity.member = type.member(timeline)
|
||||||
|
|
|
@ -99,6 +99,6 @@ describe "UserTimelineItemController", ->
|
||||||
|
|
||||||
myCtrl = controller("UserTimelineItem", {$scope: scope}, {timeline: timeline_immutable})
|
myCtrl = controller("UserTimelineItem", {$scope: scope}, {timeline: timeline_immutable})
|
||||||
|
|
||||||
expect(myCtrl.activity.description).to.be.an('object') # $sce.trustAsHtml
|
expect(myCtrl.activity.description).to.be.equal(description)
|
||||||
expect(myCtrl.activity.member).to.be.equal(member)
|
expect(myCtrl.activity.member).to.be.equal(member)
|
||||||
expect(myCtrl.activity.attachments).to.be.equal(attachment)
|
expect(myCtrl.activity.attachments).to.be.equal(attachment)
|
||||||
|
|
|
@ -8,7 +8,7 @@ div.activity-item
|
||||||
p(tg-compile-html="vm.activity.title")
|
p(tg-compile-html="vm.activity.title")
|
||||||
|
|
||||||
blockquote.activity-comment-quote(ng-if="::vm.activity.description")
|
blockquote.activity-comment-quote(ng-if="::vm.activity.description")
|
||||||
p(ng-bind-html="vm.activity.description")
|
| {{::vm.activity.description | limitTo:300}}
|
||||||
|
|
||||||
.activity-member-view(ng-if="::vm.activity.member")
|
.activity-member-view(ng-if="::vm.activity.member")
|
||||||
.profile-member-picture
|
.profile-member-picture
|
||||||
|
|
|
@ -18,9 +18,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
blockquote {
|
blockquote {
|
||||||
|
line-height: 2em;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
margin-left: calc(35px + 1rem);
|
margin-left: calc(35px + 1rem);
|
||||||
margin-top: .5rem;
|
margin-top: .5rem;
|
||||||
|
overflow-x: auto;
|
||||||
|
overflow-y: hidden;
|
||||||
|
white-space: pre-line;
|
||||||
}
|
}
|
||||||
img {
|
img {
|
||||||
max-height: 640px;
|
max-height: 640px;
|
||||||
|
|
Loading…
Reference in New Issue