2015-09-07 23:53:43 +02:00
|
|
|
/*
|
|
|
|
* vim: ts=4:sw=4:expandtab
|
2015-01-09 23:53:39 +01:00
|
|
|
*/
|
|
|
|
(function () {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
window.Whisper = window.Whisper || {};
|
|
|
|
|
|
|
|
Whisper.GroupUpdateView = Backbone.View.extend({
|
|
|
|
tagName: "div",
|
|
|
|
className: "group-update",
|
|
|
|
render: function() {
|
|
|
|
//TODO l10n
|
2015-02-16 21:47:36 +01:00
|
|
|
if (this.model.left) {
|
|
|
|
this.$el.text(this.model.left + ' left the group');
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2015-01-09 23:53:39 +01:00
|
|
|
var messages = ['Updated the group.'];
|
|
|
|
if (this.model.name) {
|
|
|
|
messages.push("Title is now '" + this.model.name + "'.");
|
|
|
|
}
|
|
|
|
if (this.model.joined) {
|
2015-01-29 09:52:24 +01:00
|
|
|
messages.push(this.model.joined.join(', ') + ' joined the group');
|
2015-01-09 23:53:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
this.$el.text(messages.join(' '));
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
})();
|