changed friends to following/followers, updated routes and the user.js functions
parent
417034b60a
commit
44d07ea543
@ -0,0 +1,29 @@
|
|||||||
|
(function() {
|
||||||
|
|
||||||
|
var yourid = templates.get('yourid'),
|
||||||
|
theirid = templates.get('theirid'),
|
||||||
|
followersCount = templates.get('followersCount');
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
if(parseInt(followersCount, 10) === 0) {
|
||||||
|
$('#no-followers-notice').show();
|
||||||
|
}
|
||||||
|
var editLink = $('#editLink');
|
||||||
|
|
||||||
|
if(yourid !== theirid) {
|
||||||
|
editLink.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.reputation').each(function(index, element) {
|
||||||
|
$(element).html(app.addCommas($(element).html()));
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.postcount').each(function(index, element) {
|
||||||
|
$(element).html(app.addCommas($(element).html()));
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}());
|
@ -0,0 +1,44 @@
|
|||||||
|
(function() {
|
||||||
|
|
||||||
|
var yourid = templates.get('yourid'),
|
||||||
|
theirid = templates.get('theirid'),
|
||||||
|
followingCount = templates.get('followingCount');
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
if(parseInt(followingCount, 10) === 0) {
|
||||||
|
$('#no-following-notice').show();
|
||||||
|
}
|
||||||
|
var editLink = $('#editLink');
|
||||||
|
|
||||||
|
if(yourid !== theirid) {
|
||||||
|
editLink.hide();
|
||||||
|
$('.unfollow-btn').hide();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('.unfollow-btn').on('click',function(){
|
||||||
|
|
||||||
|
var removeBtn = $(this);
|
||||||
|
var followingUid = $(this).attr('followingUid');
|
||||||
|
|
||||||
|
$.post('/users/unfollow', {uid: followingUid},
|
||||||
|
function(data) {
|
||||||
|
removeBtn.parent().remove();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.reputation').each(function(index, element) {
|
||||||
|
$(element).html(app.addCommas($(element).html()));
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.postcount').each(function(index, element) {
|
||||||
|
$(element).html(app.addCommas($(element).html()));
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}());
|
@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
<div class="well">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="account-username-box">
|
||||||
|
<span class="account-username">
|
||||||
|
<a href="/users/{username}">{username}</a> >
|
||||||
|
<a href="/users/{username}/followers">followers</a>
|
||||||
|
</span>
|
||||||
|
<div class="account-sub-links inline-block pull-right">
|
||||||
|
<span id="followersLink" class="pull-right"><a href="/users/{username}/followers">followers</a></span>
|
||||||
|
<span id="followingLink" class="pull-right"><a href="/users/{username}/following">following</a></span>
|
||||||
|
<span id="editLink" class="pull-right"><a href="/users/{username}/edit">edit</a></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<!-- BEGIN followers -->
|
||||||
|
|
||||||
|
<div class="users-box well">
|
||||||
|
<a href="/users/{followers.username}">
|
||||||
|
<img src="{followers.picture}" class="user-8080-picture"/>
|
||||||
|
</a>
|
||||||
|
<br/>
|
||||||
|
<a href="/users/{followers.username}">{followers.username}</a>
|
||||||
|
<br/>
|
||||||
|
<div title="reputation">
|
||||||
|
<span class='reputation'>{followers.reputation}</span>
|
||||||
|
<i class='icon-star'></i>
|
||||||
|
</div>
|
||||||
|
<div title="post count">
|
||||||
|
<span class='postcount'>{followers.postcount}</span>
|
||||||
|
<i class='icon-pencil'></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- END followers -->
|
||||||
|
</div>
|
||||||
|
<div id="no-followers-notice" class="alert alert-warning hide">This user doesn't have any followers :(</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="hidden" template-variable="yourid" value="{yourid}" />
|
||||||
|
<input type="hidden" template-variable="theirid" value="{theirid}" />
|
||||||
|
<input type="hidden" template-variable="followersCount" value="{followersCount}" />
|
||||||
|
|
||||||
|
<script type="text/javascript" src="/src/forum/followers.js"></script>
|
@ -0,0 +1,48 @@
|
|||||||
|
|
||||||
|
<div class="well">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="account-username-box">
|
||||||
|
<span class="account-username">
|
||||||
|
<a href="/users/{username}">{username}</a> >
|
||||||
|
<a href="/users/{username}/following">following</a>
|
||||||
|
</span>
|
||||||
|
<div class="account-sub-links inline-block pull-right">
|
||||||
|
<span id="followersLink" class="pull-right"><a href="/users/{username}/followers">followers</a></span>
|
||||||
|
<span id="followingLink" class="pull-right"><a href="/users/{username}/following">following</a></span>
|
||||||
|
<span id="editLink" class="pull-right"><a href="/users/{username}/edit">edit</a></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<!-- BEGIN following -->
|
||||||
|
|
||||||
|
<div class="users-box well">
|
||||||
|
<a href="/users/{following.username}">
|
||||||
|
<img src="{following.picture}" class="user-8080-picture"/>
|
||||||
|
</a>
|
||||||
|
<br/>
|
||||||
|
<a href="/users/{following.username}">{following.username}</a>
|
||||||
|
<br/>
|
||||||
|
<div title="reputation">
|
||||||
|
<span class='reputation'>{following.reputation}</span>
|
||||||
|
<i class='icon-star'></i>
|
||||||
|
</div>
|
||||||
|
<div title="post count">
|
||||||
|
<span class='postcount'>{following.postcount}</span>
|
||||||
|
<i class='icon-pencil'></i>
|
||||||
|
</div>
|
||||||
|
<a id="unfollow-btn" href="#" class="btn unfollow-btn" followingUid="{following.uid}">Unfollow</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- END following -->
|
||||||
|
</div>
|
||||||
|
<div id="no-following-notice" class="alert alert-warning hide">This user isn't following anyone :(</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="hidden" template-variable="yourid" value="{yourid}" />
|
||||||
|
<input type="hidden" template-variable="theirid" value="{theirid}" />
|
||||||
|
<input type="hidden" template-variable="followingCount" value="{followingCount}" />
|
||||||
|
|
||||||
|
<script type="text/javascript" src="/src/forum/following.js"></script>
|
@ -1,47 +0,0 @@
|
|||||||
|
|
||||||
<div class="well">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="account-username-box">
|
|
||||||
<span class="account-username">
|
|
||||||
<a href="/users/{username}">{username}</a> >
|
|
||||||
<a href="/users/{username}/friends">friends</a>
|
|
||||||
</span>
|
|
||||||
<div class="account-sub-links inline-block pull-right">
|
|
||||||
<span id="friendsLink" class="pull-right"><a href="/users/{username}/friends">friends</a></span>
|
|
||||||
<span id="editLink" class="pull-right"><a href="/users/{username}/edit">edit</a></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<!-- BEGIN friends -->
|
|
||||||
|
|
||||||
<div class="users-box well">
|
|
||||||
<a href="/users/{friends.username}">
|
|
||||||
<img src="{friends.picture}" class="user-8080-picture"/>
|
|
||||||
</a>
|
|
||||||
<br/>
|
|
||||||
<a href="/users/{friends.username}">{friends.username}</a>
|
|
||||||
<br/>
|
|
||||||
<div title="reputation">
|
|
||||||
<span class='reputation'>{friends.reputation}</span>
|
|
||||||
<i class='icon-star'></i>
|
|
||||||
</div>
|
|
||||||
<div title="post count">
|
|
||||||
<span class='postcount'>{friends.postcount}</span>
|
|
||||||
<i class='icon-pencil'></i>
|
|
||||||
</div>
|
|
||||||
<a id="remove-friend-btn" href="#" class="btn remove-friend-btn" friendid="{friends.uid}">Unfollow</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- END friends -->
|
|
||||||
</div>
|
|
||||||
<div id="no-friend-notice" class="alert alert-warning hide">This user doesn't have any friends :(</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<input type="hidden" template-variable="yourid" value="{yourid}" />
|
|
||||||
<input type="hidden" template-variable="theirid" value="{theirid}" />
|
|
||||||
<input type="hidden" template-variable="friendCount" value="{friendCount}" />
|
|
||||||
|
|
||||||
<script type="text/javascript" src="/src/forum/friends.js"></script>
|
|
Loading…
Reference in New Issue