Beispiel #1
0
def create_calendar_context_params():
  from citytree.utils.hebCalView import (FRONTPAGE_URL_TYPE,
    CALENDAR_URL_TYPE_REGISTRY, makeHebBGColorProcessor,
        makeHebCalRequestContext, makeHebCalLinks)
  import workshop.util as workshop_util
  #------------ Create Objects for Hebrew Calender ----
  calLinkType     = FRONTPAGE_URL_TYPE
  calLinkTemplate = CALENDAR_URL_TYPE_REGISTRY[calLinkType]
  
  dateToShow = date.today()

  bgColorProcessor = makeHebBGColorProcessor( dateToShow )
  dayLinks = makeHebCalLinks( calLinkTemplate, engDate=dateToShow )
  workshopLinks = workshop_util.makeHebCalLinks(dateToShow)
  dayLinks.update(workshopLinks)
  calender = makeHebCalRequestContext(dayLinks, engDate=dateToShow, 
                   urlType=calLinkType,highlightToday=True)
  #def debugme(*args, **kw):
  #  import pdb; pdb.set_trace()
  #  return calendar(*args, **kw)
  return [calender, bgColorProcessor]
Beispiel #2
0
          testDate1 = testDate + timedelta(1) #next day
          
          pageObj = FrontPage.objects.filter( date__lte=testDate1, draft=False ).latest()
          dateToShow = testDate
    except Exception, e: #In case of invalid GET string - don't do anything
        #DEBUG
        print "Exception retrieving object, reverting to today, %r"%e
        pass
  
  #------------ Create Objects for Hebrew Calender ----
  calLinkType     = FRONTPAGE_URL_TYPE
  calLinkTemplate = CALENDAR_URL_TYPE_REGISTRY[calLinkType]
  
  bgColorProcessor = makeHebBGColorProcessor( dateToShow )
  dayLinks = makeHebCalLinks( calLinkTemplate, engDate=dateToShow )
  workshopLinks = workshop_util.makeHebCalLinks(dateToShow)
  dayLinks.update(workshopLinks)
  calender = makeHebCalRequestContext(dayLinks, engDate=dateToShow, 
                            urlType=calLinkType, highlightToday=True)

  displayed_blogs = Blog.objects.filter(display_in_menu=True)

  return render_to_response('frontpage/frontpage.html', 
    {'content':pageObj, 'blogs': Blog.objects.all(),
     'subjects' : Subject.objects.all(),
     'events': WorkshopEvent.future_events(),
     'displayed_blogs': displayed_blogs
    },
    context_instance=RequestContext(request, {}, [calender,bgColorProcessor]))