summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/index/lastlog.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/js/lib/views/index/lastlog.js')
-rw-r--r--public/assets/js/lib/views/index/lastlog.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/public/assets/js/lib/views/index/lastlog.js b/public/assets/js/lib/views/index/lastlog.js
new file mode 100644
index 0000000..2f7b224
--- /dev/null
+++ b/public/assets/js/lib/views/index/lastlog.js
@@ -0,0 +1,34 @@
+/*
+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)).join(', ')
+ this.$el.html(s)
+ },
+
+ parse: function(user){
+ 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
+ },
+
+})