Beispiel #1
0
def hangar(request):
    context = user_menu(request)

    divisions = Divisions()
    context['avion'] = divisions.get_division_by_name(context['division'].name)['plane_type']

    user_division = UserDivision.objects.get(user=context['userprofile'])

    weapons = UserWeapons.objects.filter(user=user_division)

    context['max_load'] = divisions.get_division_by_name(context['division'].name)['max_weapons']

    context['weapons'] = weapons
    context['use_weapons'] = weapons.filter(on=True)

    return render_to_response('hangar.html',
        context,
        context_instance=RequestContext(request))
Beispiel #2
0
def hangar(request):
    context = user_menu(request)

    divisions = Divisions()
    context['avion'] = divisions.get_division_by_name(
        context['division'].name)['plane_type']

    user_division = UserDivision.objects.get(user=context['userprofile'])

    weapons = UserWeapons.objects.filter(user=user_division)

    context['max_load'] = divisions.get_division_by_name(
        context['division'].name)['max_weapons']

    context['weapons'] = weapons
    context['use_weapons'] = weapons.filter(on=True)

    return render_to_response('hangar.html',
                              context,
                              context_instance=RequestContext(request))
Beispiel #3
0
def start(request):
    context = user_menu(request)


    divisions = Divisions()
    prev_division, next_division = divisions.next_division(context['division'].name)

    context['next_division'] = next_division
    context['prev_division'] = prev_division

    context['avion'] = divisions.get_division_by_name(context['division'].name)['plane_type']

    division_users = UserDivision.objects.filter(name=context['division'].name).order_by('-points', '-user__lvl', '-matches_played', 'user__user__user__username')

    context['division_users'] = division_users[:5]
    context['my_division'] = divisions.get_division_by_name(context['division'].name)
    remaining_games = context['my_division']['matches'] - context['division'].matches_played
    context['remaining_games'] = remaining_games
    return render_to_response('game.html',
                              context,
                              context_instance=RequestContext(request))
Beispiel #4
0
def initiate_new_game(request):
    context = user_menu(request)
    return render_to_response('multiplayer_game.html',
        context,
        context_instance=RequestContext(request))
Beispiel #5
0
def shop(request):
    context = user_menu(request)

    return render_to_response('shop.html',
        context,
        context_instance=RequestContext(request))
Beispiel #6
0
def shop(request):
    context = user_menu(request)

    return render_to_response('shop.html',
                              context,
                              context_instance=RequestContext(request))