summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/profile/profile.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/js/lib/views/profile/profile.js')
-rw-r--r--public/assets/js/lib/views/profile/profile.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/public/assets/js/lib/views/profile/profile.js b/public/assets/js/lib/views/profile/profile.js
index 2180532..34c8fba 100644
--- a/public/assets/js/lib/views/profile/profile.js
+++ b/public/assets/js/lib/views/profile/profile.js
@@ -18,7 +18,8 @@ var ProfileView = View.extend({
populate: function(user){
$("body").removeClass('loading')
var $table = this.$("table")
- this.$("img").attr("src", "/data/profile/" + sanitize(user.username) + ".jpg")
+ var username = sanitize(user.username)
+ this.$("img").attr("src", "/data/profile/" + username + ".jpg")
var fields = "username realname phone location".split(" ").map((key) => {
if (! user[key]) return;
var t = this.template.replace(/{{key}}/, sanitize(key))
@@ -32,6 +33,14 @@ var ProfileView = View.extend({
.replace(/{{value}}/, date[0] + ' <small>' + date[1] + '</small>')
$table.append(t)
})
+
+ var fields = "message".split(" ").map((key) => {
+ if (! user[key]) return;
+ var t = this.template.replace(/{{key}}/, "&nbsp;")
+ .replace(/{{value}}/, '<a href="/mail/compose/' + username + '">send ' + username + ' a message</a>')
+ $table.append(t)
+ })
+
},
})