|
|
|
@ -3,9 +3,12 @@ import { ReactiveVar } from 'meteor/reactive-var'; |
|
|
|
|
import { Session } from 'meteor/session'; |
|
|
|
|
import { Template } from 'meteor/templating'; |
|
|
|
|
import { TAPi18n } from 'meteor/tap:i18n'; |
|
|
|
|
import { roomTypes } from '../../../utils'; |
|
|
|
|
import { roomTypes, getURL } from '../../../utils'; |
|
|
|
|
import { Subscriptions } from '../../../models'; |
|
|
|
|
|
|
|
|
|
const getAvatarUrl = (username) => getURL(`/avatar/${ username }?_dc=undefined`); |
|
|
|
|
const getDMUrl = (username) => getURL(`/direct/${ username }`); |
|
|
|
|
|
|
|
|
|
Template.ChatpalSearchResultTemplate.onCreated(function() { |
|
|
|
|
this.badRequest = new ReactiveVar(false); |
|
|
|
|
this.resultType = new ReactiveVar(this.data.settings.DefaultResultType); |
|
|
|
@ -111,6 +114,7 @@ Template.ChatpalSearchSingleMessage.helpers({ |
|
|
|
|
date() { |
|
|
|
|
return DateFormat.formatDate(this.created); |
|
|
|
|
}, |
|
|
|
|
getAvatarUrl, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
Template.ChatpalSearchSingleRoom.helpers({ |
|
|
|
@ -131,4 +135,6 @@ Template.ChatpalSearchSingleUser.helpers({ |
|
|
|
|
cleanUsername() { |
|
|
|
|
return this.user_username.replace(/<\/?em>/ig, ''); |
|
|
|
|
}, |
|
|
|
|
getAvatarUrl, |
|
|
|
|
getDMUrl, |
|
|
|
|
}); |
|
|
|
|