buttons for add friend and send message

v1.18.x
Baris Usakli 12 years ago
parent 527547b4a4
commit b13b74dadb

@ -12,10 +12,16 @@
<span id="editLink" class="pull-right"><a href="/users/{username}/edit">edit</a></span> <span id="editLink" class="pull-right"><a href="/users/{username}/edit">edit</a></span>
</div> </div>
<div class="row-fluid">
<div class="span3" style="text-align: center; margin-bottom:20px;">
<div class="account-picture-block"> <div class="account-picture-block">
<img src="{picture}" class="user-profile-picture"/> <img src="{picture}" class="user-profile-picture"/>
</div> </div>
</div>
<div class="span9">
<div class="inline-block">
<div class="account-bio-block"> <div class="account-bio-block">
<span class="account-bio-label">email</span> <span class="account-bio-label">email</span>
<span>{email}</span> <span>{email}</span>
@ -48,25 +54,32 @@
<span class="account-bio-label">posts</span> <span class="account-bio-label">posts</span>
<span id='postcount'>{postcount}</span> <span id='postcount'>{postcount}</span>
</div> </div>
<!-- END user -->
</div> </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"> <script type="text/javascript">
var yourid = '{yourid}'; var yourid = '{yourid}';
var theirid = '{theirid}'; var theirid = '{theirid}';
(function() { (function() {
function addCommas(text) { function addCommas(text) {
return text.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"); return text.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
} }
$(document).ready(function() { $(document).ready(function() {
var rep = $('#reputation'); var rep = $('#reputation');
rep.html(addCommas(rep.html())); rep.html(addCommas(rep.html()));
@ -74,8 +87,26 @@ var theirid = '{theirid}';
postcount.html(addCommas(postcount.html())); postcount.html(addCommas(postcount.html()));
var editLink = $('#editLink'); var editLink = $('#editLink');
if( yourid !== theirid) var addFriendBtn = $('#add-friend-btn');
editLink.addClass('hidden'); 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() { $(document).ready(function() {
$('#uploadForm').submit(function() { $('#uploadForm').submit(function() {
status('uploading the file ...'); status('uploading the file ...');

Loading…
Cancel
Save