diff --git a/ruby/lib/jam_ruby/models/user.rb b/ruby/lib/jam_ruby/models/user.rb index fe912bd64..08091e3e9 100644 --- a/ruby/lib/jam_ruby/models/user.rb +++ b/ruby/lib/jam_ruby/models/user.rb @@ -348,7 +348,7 @@ module JamRuby def age now = Time.now.utc.to_date - self.birth_date.nil? ? "unspecified" : now.year - self.birth_date.year - (self.birth_date.to_date.change(:year => now.year) > now ? 1 : 0) + self.birth_date.nil? ? "" : now.year - self.birth_date.year - (self.birth_date.to_date.change(:year => now.year) > now ? 1 : 0) end def session_count diff --git a/web/app/assets/javascripts/profile.js b/web/app/assets/javascripts/profile.js index 49543492d..cd5be333c 100644 --- a/web/app/assets/javascripts/profile.js +++ b/web/app/assets/javascripts/profile.js @@ -362,6 +362,8 @@ // location $('#profile-location').html(user.location); + $('#profile-age').html(user.age ? user.age + " years old" : ""); + // stats var text = user.friend_count > 1 || user.friend_count === 0 ? " Friends" : " Friend"; $('#profile-friend-stats').html('' + user.friend_count + '' + text); @@ -369,6 +371,9 @@ text = user.follower_count > 1 || user.follower_count === 0 ? " Followers" : " Follower"; $('#profile-follower-stats').html('' + user.follower_count + '' + text); + // text = user.following_count > 1 || user.following_count === 0 ? " Followings" : " Following"; + // $('#profile-following-stats').html('' + user.following_count + '' + text); + if (isMusician()) { text = user.session_count > 1 || user.session_count === 0 ? " Sessions" : " Session"; $('#profile-session-stats').html(user.session_count + text); @@ -400,12 +405,6 @@ if(user.biography) { $showBio.show(); - if(isCurrentUser()) { - $editBiographyButton.show(); - } - else { - $editBiographyButton.hide(); - } $biographyText.text(user.biography).show(); } else { @@ -419,26 +418,16 @@ var $showBio = $('.have-bio', profileScreen); var $noBio = $('.no-bio', profileScreen); var $biographyEditor = $('.update-biography', profileScreen); - var $addBiographyButton = $('a.enter-bio', profileScreen); - var $editBiographyButton = $('#profile-edit-biography', profileScreen); var $submitBiographyButton = $('#btn-update-user-biography', profileScreen); var $cancelBiographyButton = $('#btn-cancel-user-biography', profileScreen); var $biographyText = $('#profile-biography', profileScreen); initializeBioVisibility(); - $addBiographyButton.unbind('click').click(function() { - $biographyEditor.val(user.biography).show(); - return false; - }); - - $editBiographyButton.unbind('click').click(function() { - $editBiographyButton.hide(); - $biographyText.hide(); - $bioTextArea.val(user.biography); - $biographyEditor.show(); - return false; - }) + // $addBiographyButton.unbind('click').click(function() { + // $biographyEditor.val(user.biography).show(); + // return false; + // }); $submitBiographyButton.unbind('click').click(function() { var bio = $bioTextArea.val(); diff --git a/web/app/assets/stylesheets/client/profile.css.scss b/web/app/assets/stylesheets/client/profile.css.scss index b19b16f9e..c260b7e26 100644 --- a/web/app/assets/stylesheets/client/profile.css.scss +++ b/web/app/assets/stylesheets/client/profile.css.scss @@ -19,14 +19,20 @@ } .profile-header { padding:10px 20px; -// height:120px; } .profile-header h2 { font-weight:200; font-size: 28px; float:left; - margin: 0px 150px 0px 0px; + margin: 0px 0px 0px 0px; +} + +.profile-about-right .section { + font-weight:bold; + font-size:20px; + float:left; + margin: 0px 0px 0px 0px; } .profile-status { diff --git a/web/app/views/clients/_account_profile.html.erb b/web/app/views/clients/_account_profile.html.erb index af76ee2e7..d95a6d5b8 100644 --- a/web/app/views/clients/_account_profile.html.erb +++ b/web/app/views/clients/_account_profile.html.erb @@ -27,7 +27,7 @@