예제 #1
0
def events(request, date=None):
    today = day = datetime.now().date()
    try:
        reqday = datetime.strptime(date, "%Y-%m-%d").date()
        if request.user.is_authenticated() or (reqday - day).days in range(7):
            day = reqday
    except:
        # just use today date
        pass
    days = helpers.get_days(0)
    daylabels = [(days[0], 'Today'), (days[1], 'Tomorrow')]
    for d in days[2:]:
        daylabels.append((d, d.strftime('%A')))
    article, tags = None, []
    show_edit_links = False
    if request.user.is_authenticated():
        show_edit_links = True
    article,tags=helpers.get_article(today)
    return  render_to_response(request, 'ladypenh/day.html',
                               dict(theme_name=helpers.get_theme(helpers.today()),
                                    day=day,                               
                                    daylabels=daylabels,
                                    highlights=helpers.get_highlights(days),
                                    events=helpers.get_events(day),
                                    reminders=helpers.get_reminders(day),
                                    show_edit_links=show_edit_links,
                                    article=article,
                                    tags=tags
                                    ))
예제 #2
0
파일: views.py 프로젝트: domeav/Lady-Penh
def article(request, nid):
    article, tags = helpers.get_article_by_id(nid)
    return  render_to_response(request, 'ladypenh/article.html',
                               dict(theme_name=helpers.get_theme(helpers.today()),
                                    article=article,
                                    tags=tags,
                                    ads=helpers.get_ads()))
예제 #3
0
def venue(request, key):
    days = helpers.get_days()
    key = db.Key(key)
    return render_to_response(request, 'ladypenh/venue.html',
                              dict(theme_name=helpers.get_theme(helpers.today()),
                                   events=helpers.get_venue_events(days, key),
                                   files=helpers.get_venue_files(days, key),
                                   venue=helpers.get_venue_by_key(key)))
예제 #4
0
def lpvenue(request, venue):
    days = helpers.get_days()
    venue = helpers.get_venue_by_name(venue)
    return render_to_response(request, 'ladypenh/venue.html',
                              dict(theme_name=helpers.get_theme(helpers.today()),
                                   events=helpers.get_venue_events(days, venue.key()),
                                   files=helpers.get_venue_files(days, venue.key()),
                                   venue=venue))
예제 #5
0
def friends(request):
    friends = helpers.get_friends()
    return  render_to_response(request, 'ladypenh/friends.html',
                               dict(friends=friends,
                                    theme_name=helpers.get_theme(helpers.today())))
예제 #6
0
def about(request):
    return  render_to_response(request, 'ladypenh/about.html',
                               dict(theme_name=helpers.get_theme(helpers.today())))
예제 #7
0
def archives(request, tag=None):
    return render_to_response(request, 'ladypenh/archives.html',
                              dict(theme_name=helpers.get_theme(helpers.today()),
                                   articles=helpers.get_articles(helpers.today(), tag),
                                   tags=helpers.get_tags()))