Skip to content
Snippets Groups Projects
Commit 4dbcdc36 authored by Gabriel Engel's avatar Gabriel Engel
Browse files

code cleanup

parent 9643da06
No related branches found
No related tags found
No related merge requests found
......@@ -2,14 +2,11 @@ Template.chatMessageDashboard.helpers
own: ->
return 'own' if this.u?._id is Meteor.userId()
messageDate: (date) ->
return moment(date).format('LL')
isSystemMessage: ->
return this.t in ['s', 'p', 'f', 'r', 'au', 'ru', 'ul', 'nu', 'wm', 'uj']
time: ->
return moment(this.ts).format('HH:mm')
isEditing: ->
return this._id is Session.get('editingMessageId')
date: ->
return moment(this.ts).format('LL')
message: ->
switch this.t
......@@ -28,8 +25,11 @@ Template.chatMessageDashboard.helpers
this.html = message.html.replace /\n/gm, '<br/>'
return this.html
time: ->
return moment(this.ts).format('HH:mm')
isSystemMessage: ->
return this.t in ['s', 'p', 'f', 'r', 'au', 'ru', 'ul', 'nu', 'wm', 'uj']
isEditing: ->
return this._id is Session.get('editingMessageId')
getPupupConfig: ->
template = Template.instance()
......
<template name="chatMessageDashboard">
{{#if ../dateSeparator}}
<li class="date">
<span>{{messageDate ts}}</span>
<span>{{date}}</span>
</li>
{{/if}}
<li id="{{_id}}" class="message {{#if ../single}}sequential{{/if}} {{own}} {{type}}" data-username="{{u.username}}">
<li id="{{_id}}" class="message {{#if ../single}}sequential{{/if}} {{own}} {{type}}" data-username="{{u.username}}" data-date="{{date}}">
{{#if isSystemMessage}}
<p class="system">{{{message}}}</p>
{{else}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment