
"""
This contains a simple view for rendering the webclient
page and serve it eventual static content.

"""
from __future__ import print_function
from django.shortcuts import render

from evennia.players.models import PlayerDB


def webclient(request):
    """
    Webclient page template loading.
    """

    nsess = len(PlayerDB.objects.get_connected_players()) or "none"
    # as an example we send the number of connected players to the template
    pagevars = {'num_players_connected': nsess}

    return render(request, 'webclient.html', pagevars)
