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 ...@@ -2,14 +2,11 @@ Template.chatMessageDashboard.helpers
own: -> own: ->
return 'own' if this.u?._id is Meteor.userId() return 'own' if this.u?._id is Meteor.userId()
messageDate: (date) -> time: ->
return moment(date).format('LL') return moment(this.ts).format('HH:mm')
isSystemMessage: ->
return this.t in ['s', 'p', 'f', 'r', 'au', 'ru', 'ul', 'nu', 'wm', 'uj']
isEditing: -> date: ->
return this._id is Session.get('editingMessageId') return moment(this.ts).format('LL')
message: -> message: ->
switch this.t switch this.t
...@@ -28,8 +25,11 @@ Template.chatMessageDashboard.helpers ...@@ -28,8 +25,11 @@ Template.chatMessageDashboard.helpers
this.html = message.html.replace /\n/gm, '<br/>' this.html = message.html.replace /\n/gm, '<br/>'
return this.html return this.html
time: -> isSystemMessage: ->
return moment(this.ts).format('HH:mm') return this.t in ['s', 'p', 'f', 'r', 'au', 'ru', 'ul', 'nu', 'wm', 'uj']
isEditing: ->
return this._id is Session.get('editingMessageId')
getPupupConfig: -> getPupupConfig: ->
template = Template.instance() template = Template.instance()
......
<template name="chatMessageDashboard"> <template name="chatMessageDashboard">
{{#if ../dateSeparator}} {{#if ../dateSeparator}}
<li class="date"> <li class="date">
<span>{{messageDate ts}}</span> <span>{{date}}</span>
</li> </li>
{{/if}} {{/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}} {{#if isSystemMessage}}
<p class="system">{{{message}}}</p> <p class="system">{{{message}}}</p>
{{else}} {{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