From 6b727914308c33b6a1ab382867d53a5f53c483ea Mon Sep 17 00:00:00 2001 From: Florian Aucomte <33633200+faucomte97@users.noreply.github.com> Date: Mon, 10 Dec 2018 16:38:35 +0000 Subject: [PATCH] Created template tag to find user's playable game (#919) * Added template tag for getting a user's playable games. --- aimmo/templatetags/players_utils.py | 9 +++++---- version.txt | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/aimmo/templatetags/players_utils.py b/aimmo/templatetags/players_utils.py index 0232e9dd7..d87770dc1 100644 --- a/aimmo/templatetags/players_utils.py +++ b/aimmo/templatetags/players_utils.py @@ -1,15 +1,16 @@ from django import template -from aimmo import app_settings - register = template.Library() @register.inclusion_tag('players/dropdown.html', takes_context=True) def game_dropdown_list(context, base_url): + return get_user_playable_games(context, base_url) + + +def get_user_playable_games(context, base_url): user = context.request.user return { 'base_url': base_url, - 'open_play_games': user.playable_games.all() if user.is_authenticated() else None, - 'level_numbers': xrange(1, app_settings.MAX_LEVEL+1), + 'open_play_games': user.playable_games.all() if user.is_authenticated() else None } diff --git a/version.txt b/version.txt index 2411653a5..09a3acfa1 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.5.2 \ No newline at end of file +0.6.0 \ No newline at end of file