-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move import users button to .object-tools list in upper right corner …
…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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |