reviewboard.accounts.templatetags.accounts¶
Account-related template tags.
- user_profile_display_name(context, user)[source]¶
Render the user’s display name.
- Parameters:
context (
django.template.context.Context) – The template rendering context.user (
django.contrib.auth.models.User) – The user whose display name is to be rendered.
- Returns:
The user’s display name.
- Return type:
- js_user_session_info(context)[source]¶
Return JSON-serialized data for a new RB.UserSession instance.
This is used on all Review Board pages to construct the attributes passed to
RB.UserSession(). This contains information on the user and their authentication state, important API URLs that need to be accessed, timezone information, avatar URLs, and various user preferences.- Parameters:
context (
django.template.Context) – The current template context.- Returns:
The JSON-serialized attribute data.
- Return type:
django.utils.safestring.SafeText
- user_badges(context: Context, user: User) → SafeString[source]¶
Return badges shown for a user.
This will query for any badges provided for a user and return HTML rendering them. No order is guaranteed.
New in version 7.1.
- Parameters:
context (
django.template.context.Context) – The template rendering context.user (
django.contrib.auth.models.User) – The user to query for badges.
- Returns:
The HTML containing badges for the user.
- Return type: