buttons for add friend and send message

v1.18.x
Baris Usakli
parent 527547b4a4
commit b13b74dadb

@ -12,10 +12,16 @@
<span id="editLink" class="pull-right"><a href="/users/{username}/edit">edit</a></span>
</div>
<div class="row-fluid">
<div class="span3" style="text-align: center; margin-bottom:20px;">
<div class="account-picture-block">
<img src="{picture}" class="user-profile-picture"/>
</div>
</div>
<div class="span9">
<div class="inline-block">
<div class="account-bio-block">
<span class="account-bio-label">email</span>
<span>{email}</span>
@ -48,25 +54,32 @@
<span class="account-bio-label">posts</span>
<span id='postcount'>{postcount}</span>
</div>
<!-- END user -->
</div>
</div>
</div>
<div id="user-actions" class="container">
<a id="add-friend-btn" href="#" class="btn">Add Friend</a>
<a id="send-message-btn" href="#" class="btn">Send Message</a>
</div>
</div>
<script type="text/javascript">
var yourid = '{yourid}';
var theirid = '{theirid}';
(function() {
function addCommas(text) {
return text.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
}
$(document).ready(function() {
var rep = $('#reputation');
rep.html(addCommas(rep.html()));
@ -74,8 +87,26 @@ var theirid = '{theirid}';
postcount.html(addCommas(postcount.html()));
var editLink = $('#editLink');
if( yourid !== theirid)
editLink.addClass('hidden');
var addFriendBtn = $('#add-friend-btn');
var sendMessageBtn = $('#send-message-btn');
if( yourid !== theirid) {
editLink.hide();
addFriendBtn.show();
sendMessageBtn.show();
}
else {
addFriendBtn.hide();
sendMessageBtn.hide();
}
addFriendBtn.on('click', function() {
return false;
});
sendMessageBtn.on('click', function() {
return false;
});
});

@ -136,6 +136,8 @@ var uploadedPicture = '{uploadedpicture}';
$(document).ready(function() {
$('#uploadForm').submit(function() {
status('uploading the file ...');

Loading…
Cancel
Save