diff --git a/app/assets/javascripts/app/index.js.coffee b/app/assets/javascripts/app/index.js.coffee index c4046e373..c7ea196c3 100644 --- a/app/assets/javascripts/app/index.js.coffee +++ b/app/assets/javascripts/app/index.js.coffee @@ -108,12 +108,11 @@ class App extends Spine.Controller else if attribute_config.tag is 'datetime' isHtmlEscape = true timestamp = App.i18n.translateTimestamp(result) - escalation = undefined - if attribute_config.class is 'escalation' - escalation + escalation = false + if attribute_config.class && attribute_config.class.match 'escalation' + escalation = true humanTime = App.PrettyDate.humanTime(result, escalation) - result = "#{humanTime}" - #result = App.i18n.translateTimestamp(result) + result = "" if !isHtmlEscape && typeof result is 'string' result = App.Utils.htmlEscape(result) @@ -222,12 +221,12 @@ class App extends Spine.Controller App.Utils.humanFileSize(size) # define pretty/human time helper - params.humanTime = ( time, escalation ) -> - App.PrettyDate.humanTime(time, escalation) - - # define pretty/human time helper - params.timestamp = ( time ) -> - App.i18n.translateTimestamp(time) + params.humanTime = ( time, escalation = false, cssClass = '') -> + timestamp = App.i18n.translateTimestamp(time) + if escalation + cssClass += ' escalation' + humanTime = App.PrettyDate.humanTime(time, escalation) + "" # define template JST["app/views/#{name}"](params) diff --git a/app/assets/javascripts/app/views/dashboard/activity_stream.jst.eco b/app/assets/javascripts/app/views/dashboard/activity_stream.jst.eco index af16e255f..825d6e473 100644 --- a/app/assets/javascripts/app/views/dashboard/activity_stream.jst.eco +++ b/app/assets/javascripts/app/views/dashboard/activity_stream.jst.eco @@ -5,7 +5,7 @@ <%= @item.created_by.displayName() %> <%- @T( @item.type ) %> <%- @T( @item.object_name ) %><% if @item.title: %> (<%= @item.title %>)<% end %> - <%- @humanTime(@item.created_at) %> + <%- @humanTime(@item.created_at, false, 'activity-time') %> diff --git a/app/assets/javascripts/app/views/generic/history.jst.eco b/app/assets/javascripts/app/views/generic/history.jst.eco index 281923ec8..d074af13d 100644 --- a/app/assets/javascripts/app/views/generic/history.jst.eco +++ b/app/assets/javascripts/app/views/generic/history.jst.eco @@ -5,7 +5,7 @@ <% for item in @items: %> <%= item.created_by.displayName() %> - - <%- @humanTime(item.created_at) %> + <%- @humanTime(item.created_at) %>