Fixes #2930 - CTI Callerlog signaling hides "+" for new ticket if more than one user is found

This commit is contained in:
Romit Choudhary 2021-07-28 15:57:23 +02:00 committed by Thorsten Eckel
parent e9a442160b
commit 520d834c1c
2 changed files with 53 additions and 47 deletions

View file

@ -9,56 +9,56 @@
<div class="btn btn--text js-remove" title="<%- @Ti('Remove') %>"><%- @Icon('diagonal-cross') %></div> <div class="btn btn--text js-remove" title="<%- @Ti('Remove') %>"><%- @Icon('diagonal-cross') %></div>
--> -->
</div> </div>
<div class="horizontal center"> <% user = undefined %>
<% user = undefined %> <% shown = false %>
<% shown = false %> <% if item.preferences.from && !_.isEmpty(item.preferences.from): %>
<% if item.preferences.from && !_.isEmpty(item.preferences.from): %> <% for caller_id in item.preferences.from: %>
<% for caller_id in item.preferences.from: %> <% if caller_id.user_id && App.User.exists(caller_id.user_id): %>
<% if caller_id.user_id && App.User.exists(caller_id.user_id): %> <% user = App.User.fullLocal(caller_id.user_id) %>
<% user = App.User.fullLocal(caller_id.user_id) %> <% classes = ['user-popover', 'u-textTruncate'] %>
<% classes = ['user-popover', 'u-textTruncate'] %> <% classes.push('is-inactive') if !user.active %>
<% classes.push('is-inactive') if !user.active %> <% if shown: %><div class="spacer"></div><% end %>
<% if shown: %><div class="spacer"></div><% end %> <div class="user-card">
<div class="user-card"> <a href="<%- user.uiUrl() %>"><%- user.avatar() %></a>
<a href="<%- user.uiUrl() %>"><%- user.avatar() %></a> <div class="<%= classes.join(' ') %>" data-id="<%- user.id %>"><% if caller_id.level isnt 'known': %><%- @T('maybe') %>: <% end %><%= user.displayNameLong() %></div>
<div class="<%= classes.join(' ') %>" data-id="<%- user.id %>"><% if caller_id.level isnt 'known': %><%- @T('maybe') %>: <% end %><%= user.displayNameLong() %></div> <span class="text-muted"><%= item.from_pretty %></span>
<span class="text-muted"><%= item.from_pretty %></span> <div class="btn btn--small btn--quad btn--create space-left js-newTicket" title="<%- @Ti('New Ticket') %>" data-user-id="<% if user: %><%- user.id %><% end %>"><%- @Icon('plus') %></div>
</div> </div>
<% shown = true %> <% shown = true %>
<% else if !_.isEmpty(caller_id.comment): %> <% else if !_.isEmpty(caller_id.comment): %>
<% shown = true %> <% shown = true %>
<div class="user-card"> <div class="user-card">
<%- @unique_avatar(caller_id.comment, caller_id.comment.split(" ").map((name) -> name[0]).join("")) %> <%- @unique_avatar(caller_id.comment, caller_id.comment.split(" ").map((name) -> name[0]).join("")) %>
<%- @T('maybe') %>: <%= caller_id.comment %><br> <%- @T('maybe') %>: <%= caller_id.comment %><br>
<span class="text-muted"><%= item.from_pretty %></span> <span class="text-muted"><%= item.from_pretty %></span>
</div> <div class="btn btn--small btn--quad btn--create space-left js-newTicket" title="<%- @Ti('New Ticket') %>" data-user-id="<% if user: %><%- user.id %><% end %>"><%- @Icon('plus') %></div>
<% end %> </div>
<% end %> <% end %>
<% end %> <% end %>
<% if !shown && !_.isEmpty(item.from_comment): %> <% end %>
<% shown = true %> <% if !shown && !_.isEmpty(item.from_comment): %>
<div class="user-card"> <% shown = true %>
<%- @unique_avatar(item.from_comment, item.from_comment.split(" ").map((name) -> name[0]).join("")) %> <div class="user-card">
<%= item.from_comment %><br> <%- @unique_avatar(item.from_comment, item.from_comment.split(" ").map((name) -> name[0]).join("")) %>
<span class="text-muted"><%= item.from_pretty %></span> <%= item.from_comment %><br>
</div> <span class="text-muted"><%= item.from_pretty %></span>
<% end %> <div class="btn btn--small btn--quad btn--create space-left js-newTicket" title="<%- @Ti('New Ticket') %>" data-user-id="<% if user: %><%- user.id %><% end %>"><%- @Icon('plus') %></div>
<% if !shown: %> </div>
<div class="user-card"> <% end %>
<%- @unique_avatar(item.from_pretty || item.from, '??') %> <% if !shown: %>
<% if !_.isEmpty(item.from_pretty): %> <div class="user-card">
<a class="inherit-color" href="<%- App.Utils.phoneify(item.from_pretty) %>"><%= item.from_pretty %></a> <%- @unique_avatar(item.from_pretty || item.from, '??') %>
<% if item.direction is 'in': %> <% if !_.isEmpty(item.from_pretty): %>
<div class="btn btn--text btn--create no-padding js-newUser" href="#" data-phone="<%= item.from_pretty %>"><%- @Icon('plus-small') %> <span><%- @T('New User') %></div> <a class="inherit-color" href="<%- App.Utils.phoneify(item.from_pretty) %>"><%= item.from_pretty %></a>
<% end %> <% if item.direction is 'in': %>
<% else: %> <div class="btn btn--text btn--create no-padding js-newUser" href="#" data-phone="<%= item.from_pretty %>"><%- @Icon('plus-small') %> <span><%- @T('New User') %></div>
<a class="inherit-color" href="<%- App.Utils.phoneify(item.from) %>"><%= item.from %></a>
<% end %> <% end %>
</div> <% else: %>
<a class="inherit-color" href="<%- App.Utils.phoneify(item.from) %>"><%= item.from %></a>
<% end %> <% end %>
<div class="flex-spacer"></div> <div class="btn btn--small btn--quad btn--create space-left js-newTicket" title="<%- @Ti('New Ticket') %>" data-user-id="<% if user: %><%- user.id %><% end %>"><%- @Icon('plus') %></div>
<div class="btn btn--small btn--quad btn--create space-left js-newTicket" title="<%- @Ti('New Ticket') %>" data-user-id="<% if user: %><%- user.id %><% end %>"><%- @Icon('plus') %></div> </div>
</div> <% end %>
</div> </div>
<% end %> <% end %>
</div> </div>

View file

@ -5543,16 +5543,22 @@ footer {
padding: 2px 0 0 50px; padding: 2px 0 0 50px;
position: relative; position: relative;
min-height: 40px; min-height: 40px;
max-width: 192px; padding-right: 48px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
min-width: 192px;
.avatar { .avatar {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
} }
.btn.js-newTicket {
position: absolute;
right: 0;
}
} }
.stat-icon { .stat-icon {