From 1d8b44c9a6a5de419e739b6ba98be6d048311616 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 11 Aug 2016 15:43:55 +0200 Subject: [PATCH] Fixed print of boolean's. --- app/assets/javascripts/app/index.coffee | 9 ++++++++- .../javascripts/app/models/_application_model.coffee | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/index.coffee b/app/assets/javascripts/app/index.coffee index 40b13500e..e5d4afc94 100644 --- a/app/assets/javascripts/app/index.coffee +++ b/app/assets/javascripts/app/index.coffee @@ -52,7 +52,7 @@ class App extends Spine.Controller @viewPrintItem: (item, attribute_config = {}, valueRef) -> return '-' if item is undefined return '-' if item is '' - return item if !item + return item if item is null result = item # lookup relation @@ -92,6 +92,13 @@ class App extends Spine.Controller if attribute_config.options[result] result = attribute_config.options[result] + # transform boolean + if attribute_config.tag is 'boolean' + if result is true + result = 'yes' + else if result is false + result = 'no' + # translate content if attribute_config.translate || (isObject && item.translate && item.translate()) isHtmlEscape = true diff --git a/app/assets/javascripts/app/models/_application_model.coffee b/app/assets/javascripts/app/models/_application_model.coffee index 7ccf21ea2..62f2fd297 100644 --- a/app/assets/javascripts/app/models/_application_model.coffee +++ b/app/assets/javascripts/app/models/_application_model.coffee @@ -472,7 +472,7 @@ class App.Model extends Spine.Model unsubscribe from model or collection - App.Model.unsubscribe( @subscribeId ) + App.Model.unsubscribe(@subscribeId) ###