Page d'accueil : ajout des activités récentes sur les jeux vidéos
This commit is contained in:
parent
ed9c81f0d9
commit
be6b7bfc99
@ -1,5 +1,6 @@
|
|||||||
Current version (0.2) :
|
Current version (0.2) :
|
||||||
|
|
||||||
|
- Ajout d'une page d'accueil listant les jeux vidéos en cours, la liste complète et les dernières activités sur ces derniers
|
||||||
- Nouveau champ 'note' pour la progression dans le jeu
|
- Nouveau champ 'note' pour la progression dans le jeu
|
||||||
- Omission de l'état "Nouveau" pour les jeux
|
- Omission de l'état "Nouveau" pour les jeux
|
||||||
- Traduction de l'interface en Français
|
- Traduction de l'interface en Français
|
||||||
|
@ -13,7 +13,7 @@ TIME_ZONE = 'UTC'
|
|||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
||||||
USE_L10N = False
|
USE_L10N = True
|
||||||
|
|
||||||
USE_TZ = False
|
USE_TZ = False
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: 0.1\n"
|
"Project-Id-Version: 0.1\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2017-08-31 13:13+0000\n"
|
"POT-Creation-Date: 2017-08-31 14:31+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: Olivier DOSSMANN <git@dossmann.net>\n"
|
"Last-Translator: Olivier DOSSMANN <git@dossmann.net>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
|
@ -7,8 +7,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: 0.1\n"
|
"Project-Id-Version: 0.1\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2017-08-31 13:13+0000\n"
|
"POT-Creation-Date: 2017-08-31 14:31+0000\n"
|
||||||
"PO-Revision-Date: 2017-08-31 15:15+0200\n"
|
"PO-Revision-Date: 2017-08-31 16:32+0200\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"Language: fr\n"
|
"Language: fr\n"
|
||||||
@ -136,3 +136,11 @@ msgstr "Aucun jeu en cours."
|
|||||||
#: games/templates/games/index.html:17
|
#: games/templates/games/index.html:17
|
||||||
msgid "Complete list"
|
msgid "Complete list"
|
||||||
msgstr "Liste complète"
|
msgstr "Liste complète"
|
||||||
|
|
||||||
|
#: games/templates/games/index.html:23
|
||||||
|
msgid "Memory Card"
|
||||||
|
msgstr "Carte mémoire"
|
||||||
|
|
||||||
|
#: games/templates/games/index.html:34
|
||||||
|
msgid "Empty memory."
|
||||||
|
msgstr "Mémoire vide."
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<h2>{% trans "Now playing" %}</h2>
|
<h2>{% trans "Now playing" %}</h2>
|
||||||
{% if playing_games %}
|
{% if playing_games %}
|
||||||
<ul>
|
<ul>
|
||||||
{% for playing in playing_games%}
|
{% for playing in playing_games %}
|
||||||
<li>{{ playing.name }}</li>
|
<li>{{ playing.name }}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
@ -20,4 +20,17 @@
|
|||||||
<li>{{ game.name }}</li>
|
<li>{{ game.name }}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
<h2>{% trans "Memory Card" %}</h2>
|
||||||
|
{% if last_timelines %}
|
||||||
|
<ul>
|
||||||
|
{% for timeline in last_timelines %}
|
||||||
|
<li>{{ timeline.date|date:"SHORT_DATE_FORMAT" }} -
|
||||||
|
<strong>{{ timeline.get_status_display }} :</strong> {{ timeline.item.name }}
|
||||||
|
({{ timeline.item.collection.name }})
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% else %}
|
||||||
|
<p>{% trans "Empty memory." %}</p>
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -1,21 +1,25 @@
|
|||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.views.generic import ListView
|
from django.views.generic import ListView
|
||||||
from django.utils.translation import ugettext as _
|
|
||||||
|
|
||||||
from .models import Game
|
from .models import Game, Timeline
|
||||||
|
|
||||||
|
|
||||||
class GameList(ListView):
|
class GameList(ListView):
|
||||||
model = Game
|
model = Game
|
||||||
context_object_name = 'non_excluded_games'
|
context_object_name = 'non_excluded_games'
|
||||||
template_name = 'games/index.html'
|
template_name = 'games/index.html'
|
||||||
queryset = Game.objects.filter(~Q(status=Game.EXCLUDED)).order_by('name')
|
queryset = Game.objects.filter(
|
||||||
|
~Q(status=Game.EXCLUDED) &
|
||||||
|
Q(wish=False)).order_by('name')
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
"""
|
"""
|
||||||
Add playing games list
|
Add playing games list.
|
||||||
|
Add 5 last current activities from Timeline
|
||||||
"""
|
"""
|
||||||
context = super(GameList, self).get_context_data(**kwargs)
|
context = super(GameList, self).get_context_data(**kwargs)
|
||||||
context['playing_games'] = Game.objects.filter(
|
context['playing_games'] = Game.objects.filter(
|
||||||
playing=True).order_by('name')
|
playing=True).order_by('name')
|
||||||
|
context['last_timelines'] = Timeline.objects.all().order_by(
|
||||||
|
'-date')[:5]
|
||||||
return context
|
return context
|
Loading…
Reference in New Issue
Block a user