summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/index/lastlog.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-09-06 11:48:08 -0400
committerJules Laplace <jules@okfoc.us>2015-09-06 11:48:08 -0400
commitabe12120374d07cf5f87192964a9d1c10741e475 (patch)
tree48a5c09e51863fe1508e7404cec2a9340e29f686 /public/assets/js/lib/views/index/lastlog.js
parent5b1461e7b4d32e96eaa8386b4b7ea96ec4b18d5a (diff)
header
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
+ },
+
+})