List 5 events on homepage; move navigation / RSS feed links for events above "Upcomin...
authorJonathan S. Katz <jonathan.katz@excoventures.com>
Wed, 21 Aug 2013 03:14:21 +0000 (23:14 -0400)
committerJonathan S. Katz <jonathan.katz@excoventures.com>
Tue, 29 Oct 2013 15:55:23 +0000 (15:55 +0000)
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

pgweb/core/views.py
templates/index.html

index 9a5c670d27dc9d34a9ce4b305dc158e932e428a5..488afb88aaf881d4913ff24456283059a4279288 100644 (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
index 06a62bcea89d619955017608a9855f24944ab1ea..76868e5231bf504ed0a28fe9e2dd19f238ef017c 100644 (file)
             </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>
               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 -->