summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/profile/profile.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-12-14 06:48:53 +0100
committerJules Laplace <julescarbon@gmail.com>2017-12-14 06:48:53 +0100
commitf9a0743696c5e21d81ae0e215e36358788e708df (patch)
tree07bc648b9b4f16999caa669ed5faf40f92d0345f /public/assets/js/lib/views/profile/profile.js
parent54b4af27409fba0032faf4c8bed825ce2bc71cce (diff)
profile form
Diffstat (limited to 'public/assets/js/lib/views/profile/profile.js')
-rw-r--r--public/assets/js/lib/views/profile/profile.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/public/assets/js/lib/views/profile/profile.js b/public/assets/js/lib/views/profile/profile.js
index d8bc535..1b3e496 100644
--- a/public/assets/js/lib/views/profile/profile.js
+++ b/public/assets/js/lib/views/profile/profile.js
@@ -19,7 +19,13 @@ var ProfileView = View.extend({
$("body").removeClass('loading')
var $table = this.$("table")
var username = sanitize(user.username)
- this.$("img").attr("src", "/data/profile/" + username + ".jpg")
+ var is_own_profile = (username === auth.user.username)
+ if (is_own_profile) {
+ $(".edit_profile a").attr("href", "/profile/" + username + "/edit")
+ } else {
+ $(".edit_profile").hide()
+ }
+ this.$("img").attr("src", profile_image(username))
var fields = "username realname phone location".split(" ").map((key) => {
if (! user[key]) return;
var t = this.template.replace(/{{key}}/, sanitize(key))