Show phone numbers in contact selector

This commit is contained in:
lilia 2015-02-04 09:23:00 -10:00
parent c7550aa9ae
commit 5e3ed1658b
3 changed files with 11 additions and 1 deletions

View file

@ -42,6 +42,7 @@
<h3 class='contact-name'>
{{ contact_name }}
</h3>
<p class='number'>{{ number }}</p>
<p class='last-message'>
{{ last_message }}
</p>

View file

@ -135,6 +135,14 @@
getTitle: function() {
return this.get('name') || this.get('members') || this.id;
},
getNumber: function() {
if (this.get('type') === 'private') {
return this.id;
} else {
return '';
}
}
});

View file

@ -54,7 +54,8 @@ var Whisper = Whisper || {};
Mustache.render(this.template, {
contact_name: this.model.getTitle(),
last_message: this.model.get('lastMessage'),
last_message_timestamp: moment(this.model.get('timestamp')).format('MMM D')
last_message_timestamp: moment(this.model.get('timestamp')).format('MMM D'),
number: this.model.getNumber()
})
);
if (this.model.get('avatar')) {