/* age_class views_class comments_class size_class files_class */ var LastLog = View.extend({ el: ".lastlog", events: { }, initialize: function(){ this.__super__.initialize.call(this) this.template = this.$(".template").html() }, load: function(lastlog){ var s = lastlog.map(this.parse.bind(this)).filter(s => s).join(', ') this.$el.html(s) }, parse: function(user){ if (Date.now()/1000 - user.lastseen > 86400 * 14 *10000) return '' var t = this.template .replace(/{{username}}/g, user.username) .replace(/{{age}}/g, get_age(user.lastseen) ) .replace(/{{age_class}}/g, carbon_date(user.lastseen) ) .trim() return t }, })