VRFS-2701 wip UI changes for musician profile enhancements
This commit is contained in:
parent
500af2bc05
commit
20baeb8bd3
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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('<span class="friend-count">' + user.friend_count + '</span>' + text);
|
||||
|
|
@ -369,6 +371,9 @@
|
|||
text = user.follower_count > 1 || user.follower_count === 0 ? " Followers" : " Follower";
|
||||
$('#profile-follower-stats').html('<span class="follower-count">' + user.follower_count + '</span>' + text);
|
||||
|
||||
// text = user.following_count > 1 || user.following_count === 0 ? " Followings" : " Following";
|
||||
// $('#profile-following-stats').html('<span class="following-count">' + user.following_count + '</span>' + 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();
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
<form id="account-edit-profile-form">
|
||||
|
||||
<h2>profile:</h2>
|
||||
<h2>edit profile: basics</h2>
|
||||
|
||||
<div class="location w30 left">
|
||||
<a href="#" class="avatar_large"><img src="{photoUrl}" id="profile-avatar" /></a>
|
||||
|
|
|
|||
|
|
@ -13,8 +13,10 @@
|
|||
<form id="profile-form" class="inner-content">
|
||||
<div class="profile-header profile-head">
|
||||
|
||||
<!-- profile name -->
|
||||
<h2 id="profile-username"></h2>
|
||||
<div class="left">
|
||||
<h2 id="profile-username"></h2>
|
||||
<%= link_to("EDIT PROFILE", '/client#/account/profile', :id => "btn-profile-edit", :class => "button-orange") %>
|
||||
</div>
|
||||
|
||||
<!-- profile status -->
|
||||
<div class="profile-status">
|
||||
|
|
@ -25,7 +27,6 @@
|
|||
<a id="btn-add-friend" class="button-orange">ADD FRIEND</a>
|
||||
<a id="btn-follow-user" class="button-orange">FOLLOW</a>
|
||||
<a id="btn-message-user" class="button-orange">MESSAGE</a>
|
||||
<%= link_to("EDIT PROFILE", '/client#/account/profile', :id => "btn-profile-edit", :class => "button-orange") %>
|
||||
</div>
|
||||
<br clear="all" /><br />
|
||||
|
||||
|
|
@ -52,23 +53,25 @@
|
|||
<div class="profile-wrapper">
|
||||
<div class="profile-about-left">
|
||||
<h3>Location:</h3><br />
|
||||
<span id="profile-location"></span><br /><br /><br />
|
||||
<span id="profile-location"></span><br />
|
||||
<span id="profile-age"></span><br /><br />
|
||||
<h3>Stats:</h3><br />
|
||||
<span id="profile-friend-stats"></span><br />
|
||||
<span id="profile-follower-stats"></span><br />
|
||||
<span id="profile-following-stats"></span><br />
|
||||
<span id="profile-favorite-stats"></span><br />
|
||||
<span id="profile-session-stats"></span><br />
|
||||
<span id="profile-recording-stats"></span><br />
|
||||
<span id="profile-following-stats"></span><br />
|
||||
<span id="profile-favorite-stats"></span><br />
|
||||
</div>
|
||||
<div class="profile-about-right">
|
||||
<div class="section">Bio</div>
|
||||
<div class="no-bio">
|
||||
<span>You have no bio to describe yourself as a musician. <a href="#" class="enter-bio">Enter one now!</a></span>
|
||||
<span>Not specified. <a href="#" class="enter-bio">Edit Bio</a></span>
|
||||
</div>
|
||||
<div class="have-bio">
|
||||
<p id="profile-biography"></p><a id="profile-edit-biography" class="button-orange right" href="#">EDIT BIO</a>
|
||||
<p id="profile-biography"></p>
|
||||
</div>
|
||||
<div class="update-biography">
|
||||
<!-- <div class="update-biography">
|
||||
<div class="field">
|
||||
<textarea name="biography" class="user-biography"></textarea>
|
||||
</div>
|
||||
|
|
@ -80,7 +83,7 @@
|
|||
<a id="btn-cancel-user-biography" layout-action="close" class="button-grey">CANCEL</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
</div>
|
||||
</div> -->
|
||||
<br />
|
||||
<div id="profile-instruments"></div>
|
||||
<br />
|
||||
|
|
|
|||
Loading…
Reference in New Issue