From 3965f9ea61a9baabf7fb1068c03fa7c1931fe488 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Mon, 29 Jun 2015 13:23:41 +0200 Subject: [PATCH] layout_ref: fix calendar subscriptions preview text --- .../app/controllers/layout_ref.js.coffee | 30 +++++++++++-------- .../profile/calendar_subscriptions.jst.eco | 5 +++- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/app/assets/javascripts/app/controllers/layout_ref.js.coffee b/app/assets/javascripts/app/controllers/layout_ref.js.coffee index 2eaba6877..923b7f89c 100644 --- a/app/assets/javascripts/app/controllers/layout_ref.js.coffee +++ b/app/assets/javascripts/app/controllers/layout_ref.js.coffee @@ -1472,23 +1472,27 @@ class calendarSubscriptionsRef extends App.ControllerContent own = data.filter((entry) -> entry.name.indexOf('own') >= 0) not_assigned = data.filter((entry) -> entry.name.indexOf('not_assigned') >= 0) - if own.length is optionCount - modules.push "all my" - else - modules.push.apply modules, own.map (entry) -> - [option, value] = entry.name.split('/') - return "#{ translationTable[value] } #{ translationTable[option] }" + if own.length > 0 + if own.length is optionCount + modules.push "all my tickets" + else + modules.push.apply modules, own.map (entry) -> + [option, value] = entry.name.split('/') + return "#{ translationTable[value] } #{ translationTable[option] }" + modules[modules.length-1] += " tickets" - if not_assigned.length is optionCount - modules.push "all not assigned" - else - modules.push.apply modules, not_assigned.map (entry) -> - [option, value] = entry.name.split('/') - return "#{ translationTable[value] } #{ translationTable[option] }" + if not_assigned.length > 0 + if not_assigned.length is optionCount + modules.push "all not assigned tickets" + else + modules.push.apply modules, not_assigned.map (entry) -> + [option, value] = entry.name.split('/') + return "#{ translationTable[value] } #{ translationTable[option] }" + modules[modules.length-1] += " tickets" @output .attr 'disabled', false - .text "Subscription to #{ @joinItems modules } tickets:" + .text "Subscription to #{ @joinItems modules }:" joinItems: (items) -> switch items.length diff --git a/app/assets/javascripts/app/views/profile/calendar_subscriptions.jst.eco b/app/assets/javascripts/app/views/profile/calendar_subscriptions.jst.eco index 9c2b2daa3..fe0998bf7 100644 --- a/app/assets/javascripts/app/views/profile/calendar_subscriptions.jst.eco +++ b/app/assets/javascripts/app/views/profile/calendar_subscriptions.jst.eco @@ -8,7 +8,10 @@

<%= @T('See your tickets from within your favorite calendar by adding the following url to your calendar app.') %>

<%= @T('URL') %>

- +
+ + +

<%= @T('Subscription Settings') %>