Пример #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,
        ),
    )
Пример #2
0
def home(request):
    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=['division__ladder_group', 'ladder_points'],
        sort="DESC",
        count=10)
    ladder_eu = get_leaderboard(
        region=BATTLENET_REGION_EU,
        orderby=['division__ladder_group', 'ladder_points'],
        sort="DESC",
        count=10)
    ladder_kr = get_leaderboard(
        region=BATTLENET_REGION_KR,
        orderby=['division__ladder_group', 'ladder_points'],
        sort="DESC",
        count=10)
    online_streams = StreamInfo.objects.filter(
        online=True).order_by('-viewers')[:7]

    return render(
        request, 'site_home.html',
        dict(
            recent_discussions=recent_discussions,
            ladder_na=ladder_na,
            ladder_eu=ladder_eu,
            ladder_kr=ladder_kr,
            online_streams=online_streams,
        ))
Пример #3
0
def home(request):
    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=['division__ladder_group', 'ladder_points'], sort="DESC", count=10)
    ladder_eu = get_leaderboard(region=BATTLENET_REGION_EU, orderby=['division__ladder_group', 'ladder_points'], sort="DESC", count=10)
    ladder_kr = get_leaderboard(region=BATTLENET_REGION_KR, orderby=['division__ladder_group', 'ladder_points'], sort="DESC", count=10)
    return render(request, 'site_home.html', dict(
        recent_discussions=recent_discussions,
        ladder_na=ladder_na,
        ladder_eu=ladder_eu,
        ladder_kr=ladder_kr,
    ))
Пример #4
0
def show_ladders(request):
    ladder_na = get_leaderboard(region=BATTLENET_REGION_NA,
                                orderby='ladder_points',
                                sort="DESC",
                                count=50)
    ladder_eu = get_leaderboard(region=BATTLENET_REGION_EU,
                                orderby='ladder_points',
                                sort="DESC",
                                count=50)
    return render(request, 'ladder_home.html',
                  dict(ladder_na=ladder_na, ladder_eu=ladder_eu))
Пример #5
0
def home(request):
    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=['division__ladder_group', 'ladder_points'], sort="DESC", count=10)
    ladder_eu = get_leaderboard(region=BATTLENET_REGION_EU, orderby=['division__ladder_group', 'ladder_points'], sort="DESC", count=10)
    ladder_kr = get_leaderboard(region=BATTLENET_REGION_KR, orderby=['division__ladder_group', 'ladder_points'], sort="DESC", count=10)
    online_streams = StreamInfo.objects.filter(online=True).order_by('-viewers')[:7]

    return render(request, 'site_home.html', dict(
        recent_discussions=recent_discussions,
        ladder_na=ladder_na,
        ladder_eu=ladder_eu,
        ladder_kr=ladder_kr,
        online_streams=online_streams,
    ))
Пример #6
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,
        ))
Пример #7
0
def show_ladders(request):
    ladder_na = get_leaderboard(region=BATTLENET_REGION_NA, orderby='ladder_points', sort="DESC", count=50)
    ladder_eu = get_leaderboard(region=BATTLENET_REGION_EU, orderby='ladder_points', sort="DESC", count=50)
    return render(request, 'ladder_home.html', dict(ladder_na=ladder_na, ladder_eu=ladder_eu))