<% var streamIcon={ 'twitter' : 'fab fa-twitter', 'facebook' : 'fab fa-facebook-f', 'generic': 'fas fa-mobile-alt' }%>
<% if (loading) { %>

<%= i18n._('chargement')%>...

<% } else if (_.size(messages) === 0) { %>

<%= i18n._('aucune_donnee') %>

<% } else { %> <% var date=moment(messages[0].sent_at).format('L') %> <% _.each(messages, function (message,index) { %> <% if (index === 0 || moment(message.sent_at).format('L') !== date){%>
<%- moment(message.sent_at).format('L') %>
<%}%> <% // Recherche du connecteur du message dans la collection connectors var connector = connectors.findWhere({id: message.connector_id}); var messageIcon = ''; if (message.type === 'facebook' || message.type === 'twitter') { messageIcon = streamIcon[message.type] } else if (connector !== undefined && connector.get('icon')) { messageIcon = connector.get('icon'); } %>
<% if (message.content !== ''){ %>
<%= urlifyHelper.urlify(message.content) %>
<% } if (message.richContent !== undefined) { for (const property in message.richContent) { let richContent = message.richContent[property]; switch (`${property}`) { case 'location': case 'fallback': case 'unknown': if (richContent.url !== undefined) { %> <% } else { %>
<%= i18n._('format_de_message_inconnu') %>
<% } break; } } } if (message.content !== '' || message.richContent !== ''){ %>
<% if (message.status === 'sending'){ %> <%= i18n._('envoi_en_cours') %> - <% } %> <% if (message.status !== 'received'){ %> <%- message.type %> - <%- message.from.name %> <% } %>
<% if (message.status === 'received'){ %> <%} else {%> <% } %>
<%- moment(message.sent_at).format('LT') %>
<% if (message.status === 'sent') { %> <% } %> <% } %>
<% var messageAttachments = attachments.where({messageId:message.id}); %> <% _.each(messageAttachments, function (attachment,index) { %>
<% if(attachment.get('storage') === 'url'){%> <% link = attachment.get('link').href; %> <%} else { %> <% link = attachment.get('link').href+'?token='+ token; %> <% } %> <%- attachment.get('name') %> <% if (attachment.get('storage') !== 'local'){%> <%}%>
<% if (message.status === 'sending'){%> <%= i18n._('envoi_en_cours') %> - <%}%> <% if (message.status !== 'received'){%> <%- message.type %> - <%- message.from.name %> <%}%>
<% if (message.status === 'received'){%> <%} else {%> <% } %>
<%- moment(message.sent_at).format('LT') %>
<% if (message.status === 'sent') { %> <% } %>
<% }); %> <% date = moment(message.sent_at).format('L') %> <% }); %> <% } %>