List 5 events on homepage; move navigation / RSS feed links for events above "Upcoming Training"

List 5 events on homepage; move navigation / RSS feed links for events above "Upcoming Training"
To maintain the balance of the end columns, this patch also extends the list of
News articles and Planet postings to 7
This commit is contained in:
Jonathan S. Katz
2013-08-20 23:14:21 -04:00
parent ac0905a07c
commit 3c543b357e
2 changed files with 17 additions and 17 deletions

View File

@ -36,15 +36,15 @@ from django.template.context import RequestContext
# Front page view
@cache(minutes=10)
def home(request):
news = NewsArticle.objects.filter(approved=True)[:5]
events = Event.objects.select_related('country').filter(approved=True, training=False, enddate__gte=date.today).order_by('enddate', 'startdate')[:3]
news = NewsArticle.objects.filter(approved=True)[:7]
events = Event.objects.select_related('country').filter(approved=True, training=False, enddate__gte=date.today).order_by('enddate', 'startdate')[:5]
try:
quote = Quote.objects.filter(approved=True).order_by('?')[0]
except:
# if there is no quote available, just ignore error
quote = None
versions = Version.objects.filter(supported=True)
planet = ImportedRSSItem.objects.filter(feed__internalname="planet").order_by("-posttime")[:5]
planet = ImportedRSSItem.objects.filter(feed__internalname="planet").order_by("-posttime")[:7]
traininginfo = Event.objects.filter(approved=True, training=True).extra(where=("startdate <= (CURRENT_DATE + '6 Months'::interval) AND enddate >= CURRENT_DATE",)).aggregate(Count('id'), Count('country', distinct=True))
# can't figure out how to make django do this

View File

@ -150,6 +150,20 @@
</p>
{% endfor %}
</div>
<div style="margin-bottom: 10px;">
<img class="pgArrowImage" src="/media/img/layout/blt_blu_arrow.png" width="6" height="5" alt="" />
<ul class="pgRSSBottomList">
<li>
<a href="/about/events/" title="More Events">More</a>
</li>
<li>
<a href="/account/events/new/">Submit Event</a>
</li>
<li class="last-child">
<a href="/events.rss" title="Events RSS Feed"><img class="pgRSSImage" src="/media/img/misc/ico_rss.png" width="28" height="13" alt="Events RSS Feed" /></a>
</li>
</ul>
</div>
<a href="/about/events/">
<img src="/media/img/hdr/hdr_upcomingtraining.png" width="140" height="10" alt="Upcoming training" />
</a>
@ -170,20 +184,6 @@
There are no training events currently scheduled.
{%endif%}
</div>
<div>
<img class="pgArrowImage" src="/media/img/layout/blt_blu_arrow.png" width="6" height="5" alt="" />
<ul class="pgRSSBottomList">
<li>
<a href="/about/events/" title="More Events">More</a>
</li>
<li>
<a href="/account/events/new/">Submit Event</a>
</li>
<li class="last-child">
<a href="/events.rss" title="Events RSS Feed"><img class="pgRSSImage" src="/media/img/misc/ico_rss.png" width="28" height="13" alt="Events RSS Feed" /></a>
</li>
</ul>
</div>
</div> <!-- pgNewsEventsWrap -->
</div> <!-- pgFrontEvent -->
</div> <!-- pgFrontBottomContainer -->