From 075debb28033ad023a2ef4168955d37645ec85ee Mon Sep 17 00:00:00 2001 From: Till Breuer Date: Mon, 6 Jan 2014 11:14:39 +0100 Subject: [PATCH] Render general timeline columns --- .../javascripts/angular/filters/column_filters.js | 14 ++++++++++++++ public/templates/timelines/tree.html | 9 +++------ 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 app/assets/javascripts/angular/filters/column_filters.js diff --git a/app/assets/javascripts/angular/filters/column_filters.js b/app/assets/javascripts/angular/filters/column_filters.js new file mode 100644 index 0000000000..dabfda3268 --- /dev/null +++ b/app/assets/javascripts/angular/filters/column_filters.js @@ -0,0 +1,14 @@ +timelinesApp + .filter('getOptionColumn', function() { + var map = { + "type": "getTypeName", + "status": "getStatusName", + "responsible": "getResponsibleName", + "assigned_to": "getAssignedName", + "project": "getProjectName" + }; + + return function(nodeData, option) { + return nodeData[map[option]](); + }; + }); diff --git a/public/templates/timelines/tree.html b/public/templates/timelines/tree.html index bbd31137ec..3565e3555a 100644 --- a/public/templates/timelines/tree.html +++ b/public/templates/timelines/tree.html @@ -27,13 +27,10 @@ - - - {{node[option]}} + + {{node.payload | getOptionColumn:option}} +