def player_css_class(p1, p2, cp=None):
    """Get CSS classes for player.

    For each page, there is a reference player (p2, associated to the
    secret in the URL).  Information for that player should be styled
    with 'self_player'.  All other players get 'other_player'.

    If cp is defined, it indicates which p1 should get the
    'current_player' class extra.
    """
    return ("self_player" if p1 is p2 else "other_player") + (
        " current_player" if p1 is cp else "")