Ejemplo n.º 1
0
def home(request):
    now = datetime.now()
    later = now + timedelta(seconds=30 * 86400)
    upcoming_events = mybb.get_events_in_range("Default Calendar", now, later)[:7]
    latest_article = mybb.get_threads(
        forum_name="News and Announcements", count=1, orderby="mybb_threads.dateline", sort="DESC"
    )[0]
    recent_articles = mybb.get_threads(
        forum_name="News and Announcements", count=7, offsetby=1, orderby="mybb_threads.dateline", sort="DESC"
    )
    recent_discussions = mybb.get_threads(
        forum_name=settings.DISCUSSION_FORUMS, count=7, orderby="mybb_threads.dateline", sort="DESC"
    )

    ladder_na = get_leaderboard(region=BATTLENET_REGION_NA, orderby="ladder_points", sort="DESC", count=10)
    ladder_eu = get_leaderboard(region=BATTLENET_REGION_EU, orderby="ladder_points", sort="DESC", count=10)
    ladder_kr = get_leaderboard(region=BATTLENET_REGION_KR, orderby="ladder_points", sort="DESC", count=10)
    return render(
        request,
        "site_home.html",
        dict(
            upcoming_events=upcoming_events,
            latest_article=latest_article,
            recent_articles=recent_articles,
            recent_discussions=recent_discussions,
            ladder_na=ladder_na,
            ladder_eu=ladder_eu,
            ladder_kr=ladder_kr,
        ),
    )
Ejemplo n.º 2
0
def starbowmodweb(request):
    now = datetime.now()
    later = now+timedelta(seconds=30*86400)
    return dict(
        ABOUT_PAGES=settings.ABOUT_PAGES,
        recent_articles=mybb.get_threads(forum_name="News and Announcements", orderby="mybb_threads.dateline", sort="DESC", count=7),
        upcoming_events=mybb.get_events_in_range("Default Calendar", now, later)[:7],
    )
Ejemplo n.º 3
0
def starbowmodweb(request):
    now = datetime.now()
    later = now + timedelta(seconds=30 * 86400)
    return dict(
        ABOUT_PAGES=settings.ABOUT_PAGES,
        recent_articles=mybb.get_threads(forum_name="News and Announcements",
                                         orderby="mybb_threads.dateline",
                                         sort="DESC",
                                         count=7),
        upcoming_events=mybb.get_events_in_range("Default Calendar", now,
                                                 later)[:7],
    )
Ejemplo n.º 4
0
def home(request):
    now = datetime.now()
    later = now + timedelta(seconds=30 * 86400)
    upcoming_events = mybb.get_events_in_range("Default Calendar", now,
                                               later)[:7]
    latest_article = mybb.get_threads(forum_name="News and Announcements",
                                      count=1,
                                      orderby="mybb_threads.dateline",
                                      sort="DESC")[0]
    recent_articles = mybb.get_threads(forum_name="News and Announcements",
                                       count=7,
                                       offsetby=1,
                                       orderby="mybb_threads.dateline",
                                       sort="DESC")
    recent_discussions = mybb.get_threads(
        forum_name=settings.DISCUSSION_FORUMS,
        count=7,
        orderby="mybb_threads.dateline",
        sort="DESC")

    ladder_na = get_leaderboard(region=BATTLENET_REGION_NA,
                                orderby='ladder_points',
                                sort="DESC",
                                count=10)
    ladder_eu = get_leaderboard(region=BATTLENET_REGION_EU,
                                orderby='ladder_points',
                                sort="DESC",
                                count=10)
    ladder_kr = get_leaderboard(region=BATTLENET_REGION_KR,
                                orderby='ladder_points',
                                sort="DESC",
                                count=10)
    return render(
        request, 'site_home.html',
        dict(
            upcoming_events=upcoming_events,
            latest_article=latest_article,
            recent_articles=recent_articles,
            recent_discussions=recent_discussions,
            ladder_na=ladder_na,
            ladder_eu=ladder_eu,
            ladder_kr=ladder_kr,
        ))
Ejemplo n.º 5
0
def view_events(request):
    now = datetime.utcnow()
    later = now + timedelta(seconds=30*86400)
    events = mybb.get_events_in_range("Default Calendar", now, later)
    return render(request, 'events.html', dict(events=events))
Ejemplo n.º 6
0
def view_events(request):
    now = datetime.utcnow()
    later = now + timedelta(seconds=30 * 86400)
    events = mybb.get_events_in_range("Default Calendar", now, later)
    return render(request, 'events.html', dict(events=events))