% if (loading === true) { %>
<%= i18n._('chargement') %>...
<% } else if (interaction === null) { %>
<%= i18n._('Aucune interaction sélectionnée') %>
<% } else {
var title="",
subtitle ="",
content='',
stateIcon={
wait: 'to-do',
work: 'in-progress',
done: 'done'
},
stateLabel={
wait: i18n._('select_state_wait'),
work: i18n._('select_state_work'),
done: i18n._('traite')
};
if (interaction.media.type === 'email' && interaction.media.is_draft) {
stateIcon = 'draft';
stateLabel = i18n._('select_state_draft');
} else {
stateIcon = stateIcon[interaction.state];
stateLabel = stateLabel[interaction.state];
}
if (interaction.label !== ''){
title = interaction.label;
} else if (interaction.media.type === 'email') {
if (interaction.media.direction == "out") {
if (interaction.media.to) {
title= i18n._p("destinataire","a")+ " : ";
_.each(interaction.media.to, function(to, index) {
if (index > 0) {
title+="; ";
}
if(to.name != ""){
title+= to.name + " <" + to.address + ">";
}
else{
title+= to.address;
}
})
} else {
title= i18n._('sans_destinataire');
}
} else {
if (interaction.media.from) {
if(interaction.media.from.name != ""){
title+= interaction.media.from.name + " <" + interaction.media.from.address + ">";
}
else{
title+= interaction.media.from.address;
}
} else {
title= i18n._('sans_destinataire');
}
}
} else if (interaction.media.type === 'call') {
title=interaction.media.cust_number;
if (interaction.state==="done"){
subtitle= i18n._('duree') + " : " + dateHelper.secondsToString(interaction.duration.work);
}
} else if (interaction.media.type === 'custom') {
title = i18n._('tache_personnalisee');
} else if (interaction.media.type === 'messaging'){
title = i18n._('messaging')
} else if (interaction.media.type === 'chat') {
title=i18n._('conversation_chat');
if (interaction.state==="done"){
subtitle= i18n._('duree') + " : " + dateHelper.secondsToString(interaction.duration.work);
}
}
var agentName;
if (interaction.current_agent.name === '') {
agentName = '-';
} else if (interaction.current_agent.id === agent.agentId) {
agentName = i18n._('vous');
} else {
agentName = interaction.current_agent.name;
}
%>
<% } %>