Dashboard
This package contains all dashboard views
Admin Dashboard View
- class integreat_cms.cms.views.dashboard.admin_dashboard_view.AdminDashboardView[source]
Bases:
TemplateView
,ChatContextMixin
,ReleaseNotesContextMixin
View for the admin dashboard
- __init__() None [source]
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- Return type:
None
- extra_context = {'current_menu_item': 'admin_dashboard'}[source]
The context dict passed to the template (see
ContextMixin
)
- get_chat_context_data() dict[str, Any] [source]
Returns the chat context variables
chat_form
,chat_messages
andchat_last_visited
.
- get_context_data(**kwargs: Any) dict[str, Any] [source]
Returns a dictionary representing the template context (see
get_context_data()
).
- get_template_names()[source]
Return a list of template names to be used for the request. Must return a list. May not be called if render_to_response() is overridden.
- get_versions(year: Path | PosixPath) dict[str, dict[str, str]] [source]
Get all versions of one year
- render_to_response(context, **response_kwargs)[source]
Return a response, using the response_class for this view, with a template rendered with the given context.
Pass response_kwargs to the constructor of the response class.
- response_class[source]
alias of
TemplateResponse
- template_name = 'dashboard/admin_dashboard.html'[source]
The template to render (see
TemplateResponseMixin
)
Dashboard View
- class integreat_cms.cms.views.dashboard.dashboard_view.DashboardView(**kwargs)[source]
Bases:
TemplateView
,ChatContextMixin
View for the region dashboard
- __init__(**kwargs)[source]
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- get_automatically_saved_pages() dict[str, QuerySet | str] [source]
Extend context by info on automatically saved pages
- get_broken_links_context(region_slug: str) JsonResponse [source]
Extend context by info on broken links
- Returns:
Dictionary containing the context for broken links
- Parameters:
request (HttpRequest)
region_slug (str)
- Return type:
JsonResponse
- get_chat_context_data() dict[str, Any] [source]
Returns the chat context variables
chat_form
,chat_messages
andchat_last_visited
.
- get_latest_versions() list[int] [source]
Collects all the latest page translations of the current region
- get_low_hix_value_context() dict[str, list[PageTranslation]] [source]
Extend context by info on pages with low hix value
- Returns:
Dictionary containing the context for pages with low hix value
- Return type:
- get_outdated_pages_context() dict[str, QuerySet | PageTranslation | datetime | int | None] [source]
Extend context by info on outdated pages
- Returns:
Dictionary containing the context for outdated pages
- Return type:
dict[str, QuerySet | PageTranslation | datetime | int | None]
- get_template_names()[source]
Return a list of template names to be used for the request. Must return a list. May not be called if render_to_response() is overridden.
- get_unread_feedback_context() dict[str, QuerySet] [source]
Extend context by info on unread feedback
- get_unreviewed_pages_context() dict[str, QuerySet | str] [source]
Extend context by info on unreviewed pages
- latest_version_ids: list[int] = [][source]
The ids of the latest page translations of the current region
- render_to_response(context, **response_kwargs)[source]
Return a response, using the response_class for this view, with a template rendered with the given context.
Pass response_kwargs to the constructor of the response class.
- response_class[source]
alias of
TemplateResponse
- template_name: str = 'dashboard/dashboard.html'[source]
The template to render (see
TemplateResponseMixin
)
Region Selection
- class integreat_cms.cms.views.dashboard.region_selection.RegionSelection(**kwargs)[source]
Bases:
TemplateView
View for the region selection
- __init__(**kwargs)[source]
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- get(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponseRedirect [source]
Redirect to correct dashboard or render the region selection if dashboard cannot be automatically determined
- Parameters:
request (HttpRequest) – Object representing the user call
*args (Any) – The supplied arguments
**kwargs (Any) – The supplied keyword arguments
- Raises:
PermissionDenied – If user is neither superuser/staff nor a region user
- Returns:
The rendered selection template or a redirect to correct dashboard
- Return type:
HttpResponseRedirect
- get_template_names()[source]
Return a list of template names to be used for the request. Must return a list. May not be called if render_to_response() is overridden.
- render_to_response(context, **response_kwargs)[source]
Return a response, using the response_class for this view, with a template rendered with the given context.
Pass response_kwargs to the constructor of the response class.
- response_class[source]
alias of
TemplateResponse
- template_name = 'dashboard/region_selection.html'[source]
The template to render (see
TemplateResponseMixin
)