diff --git a/app/assets/javascripts/app/controllers/cti.coffee b/app/assets/javascripts/app/controllers/cti.coffee index c65900f1f..ffc5579c7 100644 --- a/app/assets/javascripts/app/controllers/cti.coffee +++ b/app/assets/javascripts/app/controllers/cti.coffee @@ -123,25 +123,21 @@ class App.CTI extends App.Controller "#{mins}:#{secs}" for item in @list + item.status_class = '' + if item.state is 'newCall' item.state_human = 'ringing' + item.status_class = 'neutral' else if item.state is 'answer' item.state_human = 'connected' + item.status_class = 'ok' else if item.state is 'hangup' - if item.comment is 'cancel' - item.state_human = 'not reached' - else if item.comment is 'noAnswer' - item.state_human = 'not reached' - else if item.comment is 'congestion' - item.state_human = 'not reached' - else if item.comment is 'busy' - item.state_human = 'busy' - else if item.comment is 'notFound' - item.state_human = 'not exist' - else if item.comment is 'normalClearing' - item.state_human = '' - else - item.state_human = item.comment + item.state_human = switch item.comment + when 'cancel', 'noAnswer', 'congestion' then 'not reached' + when 'busy' then 'busy' + when 'notFound' then 'not exist' + when 'normalClearing' then '' + else item.comment else item.state_human = item.state if item.comment diff --git a/app/assets/javascripts/app/views/cti/index.jst.eco b/app/assets/javascripts/app/views/cti/index.jst.eco index 7fdfab427..50ff63788 100644 --- a/app/assets/javascripts/app/views/cti/index.jst.eco +++ b/app/assets/javascripts/app/views/cti/index.jst.eco @@ -5,18 +5,24 @@
+ | <%- @T('From') %> | <%- @T('To') %> | -+ | <%- @T('Status') %> | <%- @T('Duration') %> | <%- @T('Time') %> | ||
---|---|---|---|---|---|---|---|---|
<% if item.state is 'hangup': %>checked<% end %>><% end %> + | ||||||||
+ + |
<% shown = false %>
<% if item.preferences.from && !_.isEmpty(item.preferences.from): %>
@@ -36,7 +42,7 @@
<% if item.from_comment: %><%= item.from_comment %><% end %>
<% end %> - <%= item.from %> + <%= item.from %> |
<% shown = false %>
@@ -57,11 +63,15 @@
<% if item.to_comment: %><%= item.to_comment %><% end %>
<% end %> - <%= item.to %> + <%= item.to %> |
- <%- @T(item.state_human) %> | -<%= item.duration %> | -<%- @humanTime(item.created_at) %> | ++ <% if item.state_human: %> + <%- @Icon('status', "#{item.status_class} inline") %> <%- @T(item.state_human) %> + <% end %> + | +<%= item.duration %> | +<%- @humanTime(item.created_at) %> |