From 9929182534faac2408bffc386e4394eeecc1a03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Wed, 28 Jan 2015 17:01:03 +0100 Subject: [PATCH] Fix tg-2084: broken activity list --- app/coffee/modules/common/history.coffee | 11 ++++------- app/partials/common/history/history-activity.jade | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/coffee/modules/common/history.coffee b/app/coffee/modules/common/history.coffee index 12af04e9..39540efa 100644 --- a/app/coffee/modules/common/history.coffee +++ b/app/coffee/modules/common/history.coffee @@ -181,11 +181,8 @@ HistoryDirective = ($log, $loading, $qqueue, $template, $confirm) -> to = formatChange(value[1]) return templateChangeGeneric({name:name, from:from, to: to}) - renderChangeEntries = (change, join=true) -> - entries = _.map(change.values_diff, (value, field) -> renderChangeEntry(field, value)) - if join - return entries.join("\n") - return entries + renderChangeEntries = (change) -> + return _.map(change.values_diff, (value, field) -> renderChangeEntry(field, value)) renderChangesHelperText = (change) -> size = countChanges(change) @@ -209,7 +206,7 @@ HistoryDirective = ($log, $loading, $qqueue, $template, $confirm) -> creationDate: moment(comment.created_at).format("DD MMM YYYY HH:mm") comment: comment.comment_html changesText: renderChangesHelperText(comment) - changes: renderChangeEntries(comment, false) + changes: renderChangeEntries(comment) mode: "comment" deleteCommentDate: moment(comment.delete_comment_date).format("DD MMM YYYY HH:mm") if comment.delete_comment_date deleteCommentUser: comment.delete_comment_user.name if comment.delete_comment_user?.name @@ -223,7 +220,7 @@ HistoryDirective = ($log, $loading, $qqueue, $template, $confirm) -> userFullName: change.user.name creationDate: moment(change.created_at).format("DD MMM YYYY HH:mm") comment: change.comment_html - changes: renderChangeEntries(change, false) + changes: renderChangeEntries(change) changesText: "" mode: "activity" deleteCommentDate: moment(change.delete_comment_date).format("DD MMM YYYY HH:mm") if change.delete_comment_date diff --git a/app/partials/common/history/history-activity.jade b/app/partials/common/history/history-activity.jade index 0f1a48ee..83cdb260 100644 --- a/app/partials/common/history/history-activity.jade +++ b/app/partials/common/history/history-activity.jade @@ -31,5 +31,5 @@ div(class!="activity-single <%- mode %>") <% } %> <% _.each(changes, function(change) { %> | <%= change %> - <% }) %> + <% }) %> <% } %>