not fixed
This commit is contained in:
23
rowers/templates/menuscript.html
Normal file
23
rowers/templates/menuscript.html
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<script
|
||||||
|
type='text/javascript'
|
||||||
|
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
$(".has-children").each(
|
||||||
|
function(i, obj) {
|
||||||
|
var theid = $(this).attr('id');
|
||||||
|
var state = localStorage.getItem(theid);
|
||||||
|
if (state !== null) {
|
||||||
|
$(this).find('input:first').prop("checked",state);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$(function() {
|
||||||
|
$(".has-children").click( function() {
|
||||||
|
var theid = $(this).attr('id');
|
||||||
|
var state = $(this).find('input:first').is(':checked');
|
||||||
|
localStorage.setItem(theid,state);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -834,7 +834,11 @@ def rdata(file,rower=rrower()):
|
|||||||
def get_my_teams(user):
|
def get_my_teams(user):
|
||||||
try:
|
try:
|
||||||
therower = Rower.objects.get(user=user)
|
therower = Rower.objects.get(user=user)
|
||||||
teams1 = therower.team.all()
|
try:
|
||||||
|
teams1 = therower.team.all()
|
||||||
|
except AttributeError:
|
||||||
|
teams1 = []
|
||||||
|
|
||||||
teams2 = Team.objects.filter(manager=user)
|
teams2 = Team.objects.filter(manager=user)
|
||||||
teams = list(set(teams1).union(set(teams2)))
|
teams = list(set(teams1).union(set(teams2)))
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
|||||||
Reference in New Issue
Block a user