mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-12 04:08:29 +01:00
Require login for the tags button
@DanBurton
This commit is contained in:
parent
972fc5ae18
commit
9fe7d95389
@ -1,4 +1,5 @@
|
||||
$(function(){
|
||||
var loggedIn = $('.user-handle').length > 0;
|
||||
var tags = Object.create(null);
|
||||
$('.tags').find('.tag').each(function(){
|
||||
tags[$(this).find('a').text()] = true;
|
||||
@ -13,8 +14,6 @@ $(function(){
|
||||
}
|
||||
});
|
||||
$('#like').click(function(){
|
||||
var loggedIn = $('.user-handle').length > 0;
|
||||
|
||||
var $this = $(this);
|
||||
|
||||
if (loggedIn) {
|
||||
@ -39,10 +38,11 @@ $(function(){
|
||||
$.post("@{PackageUnlikeR pn}");
|
||||
}
|
||||
} else {
|
||||
window.location.href = '@{AuthR LoginR}';
|
||||
login();
|
||||
}
|
||||
});
|
||||
$('#add-tag').click(function(){
|
||||
if (!loggedIn) login();
|
||||
$('#add-tag-form').toggleClass('hidden');
|
||||
$('#new-tag').focus();
|
||||
});
|
||||
@ -105,3 +105,7 @@ if( Object.create === undefined ) {
|
||||
return new F();
|
||||
};
|
||||
}
|
||||
|
||||
function login(){
|
||||
window.location.href = '@{AuthR LoginR}';
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user