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.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))