Skip to content

Commit

Permalink
move import users button to .object-tools list in upper right corner …
Browse files Browse the repository at this point in the history
…of admin, also hide it on user detail view
  • Loading branch information
Christian Glatthard committed Aug 9, 2015
1 parent 237abf5 commit 3f858bc
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ipynbsrv/admin/static/admin/js/user_import.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
(function($) {
$(document).ready(function($) {
$("#content-main").append('<div class="module"><a href="/admin/auth/user/import_users/"><button>Import all users from User Backend</button></a></div>');
// check if history link exists in site, if yes, we are on the user detail site and don't want to include the button
if ($(".historylink").length == 0) {
// check if .object-tools exists
if ($(".object-tools").length == 0) {
$("#content-main").prepend('<ul class="object-tools"><li><a class="addlink" href="/admin/auth/user/import_users/">Import all users from User Backend</a></li></ul>');
} else {
$(".object-tools").prepend('<li><a class="addlink" href="/admin/auth/user/import_users/">Import all users from User Backend</a></li>');
}
}

});
})(django.jQuery);
})(django.jQuery);

0 comments on commit 3f858bc

Please sign in to comment.