Michael Hall has proposed merging lp:~mhall119/loco-directory/fixes-619883 into
lp:loco-directory.
Requested reviews:
loco-directory-dev (loco-directory-dev)
Related bugs:
#619883 Mainpage only show 2 global and 5 team events
https://bugs.launchpad.net/bugs/619883
I had initially limited the upcoming events because I was going to display team
events. Since we're not doing that, I don't think we need a limit. Also,
instead of passing the entire list of team events to the template context, I'm
only passing the count now.
--
https://code.launchpad.net/~mhall119/loco-directory/fixes-619883/+merge/33008
Your team loco-directory-dev is requested to review the proposed merge of
lp:~mhall119/loco-directory/fixes-619883 into lp:loco-directory.
=== modified file 'loco_directory/common/views.py'
--- loco_directory/common/views.py 2010-08-15 20:11:04 +0000
+++ loco_directory/common/views.py 2010-08-18 14:36:44 +0000
@@ -8,9 +8,9 @@
def index(request):
from events.models import GlobalEvent, TeamEvent
- team_event_list = TeamEvent.objects.next_events()[:5]
- global_event_list = GlobalEvent.objects.next_events()[:2]
- context = {'team_event_list': team_event_list,
+ team_event_count = TeamEvent.objects.next_events().count()
+ global_event_list = GlobalEvent.objects.next_events()[:5]
+ context = {'team_event_count': team_event_count,
'global_event_list': global_event_list,}
return render_to_response('index.html', context,
=== modified file 'loco_directory/templates/index.html'
--- loco_directory/templates/index.html 2010-08-17 15:09:14 +0000
+++ loco_directory/templates/index.html 2010-08-18 14:36:44 +0000
@@ -65,8 +65,8 @@
{% endif %}
<br />
- {% if team_event_list %}
- <h3><a href="{% url event-list %}">{{ team_event_list.count }} {% trans "Upcoming Team Events" %}</a>
+ {% if team_event_count %}
+ <h3><a href="{% url event-list %}">{{ team_event_count }} {% trans "Upcoming Team Events" %}</a>
<a class="teams_event_ical" href="{% url teams-event-list-ical %}">
<img src="/media/images/ical.png" title="{% trans "Team Events as ical" %}"/></a></h3>
{% else %}
_______________________________________________
Mailing list: https://launchpad.net/~loco-directory-dev
Post to : [email protected]
Unsubscribe : https://launchpad.net/~loco-directory-dev
More help : https://help.launchpad.net/ListHelp