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

classmethod as_view(**initkwargs)[source]

Main entry point for a request-response process.

content_type = None[source]
dispatch(request, *args, **kwargs)[source]
extra_context = {'current_menu_item': 'admin_dashboard'}[source]

The context dict passed to the template (see ContextMixin)

get(request, *args, **kwargs)[source]
get_chat_context_data() dict[str, Any][source]

Returns the chat context variables chat_form, chat_messages and chat_last_visited.

Returns:

The chat context

Return type:

dict[str, Any]

get_context_data(**kwargs: Any) dict[str, Any][source]

Returns a dictionary representing the template context (see get_context_data()).

Parameters:

**kwargs (Any) – The given keyword arguments

Returns:

The template context

Return type:

dict[str, Any]

get_entries(version: Path | PosixPath) dict[str, str][source]

Get all entries of one version

Returns:

The entry dict

Parameters:

version (Path | PosixPath)

Return type:

dict[str, str]

get_release_notes() dict[str, dict[str, dict[str, str]]][source]

Get all release notes

Returns:

The release note dict

Return type:

dict[str, dict[str, dict[str, str]]]

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

Returns:

The version dict

Parameters:

year (Path | PosixPath)

Return type:

dict[str, dict[str, str]]

http_method_names = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace'][source]
http_method_not_allowed(request, *args, **kwargs)[source]
only_latest_release = True[source]

Whether only the latest release notes should be included

options(request, *args, **kwargs)[source]

Handle responding to requests for the OPTIONS HTTP verb.

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

setup(request, *args, **kwargs)[source]

Initialize attributes shared by all view methods.

template_engine = None[source]
template_name = 'dashboard/admin_dashboard.html'[source]

The template to render (see TemplateResponseMixin)

view_is_async = False[source]

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.

classmethod as_view(**initkwargs)[source]

Main entry point for a request-response process.

content_type = None[source]
dispatch(request, *args, **kwargs)[source]
extra_context = None[source]
get(request, *args, **kwargs)[source]
get_automatically_saved_pages() dict[str, QuerySet | str][source]

Extend context by info on automatically saved pages

Returns:

Dictionary containing the context for auto saved pages

Return type:

dict[str, QuerySet | str]

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 and chat_last_visited.

Returns:

The chat context

Return type:

dict[str, Any]

get_context_data(**kwargs: Any) dict[str, Any][source]

Extend context by blog urls

Parameters:

**kwargs (Any) – The supplied keyword arguments

Returns:

The context dictionary

Return type:

dict[str, Any]

get_drafted_pages() dict[str, QuerySet][source]

Extend context by info on drafted pages

Returns:

Dictionary containing the context for drafted pages for one region.

Return type:

dict[str, QuerySet]

get_latest_versions() list[int][source]

Collects all the latest page translations of the current region

Returns:

The ids of the latest page translations of the current region

Return type:

list[int]

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:

dict[str, list[PageTranslation]]

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

Returns:

Dictionary containing the context for unreviewed pages

Return type:

dict[str, QuerySet]

get_unreviewed_pages_context() dict[str, QuerySet | str][source]

Extend context by info on unreviewed pages

Returns:

Dictionary containing the context for unreviewed pages

Return type:

dict[str, QuerySet | str]

http_method_names = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace'][source]
http_method_not_allowed(request, *args, **kwargs)[source]
latest_version_ids: list[int] = [][source]

The ids of the latest page translations of the current region

options(request, *args, **kwargs)[source]

Handle responding to requests for the OPTIONS HTTP verb.

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

setup(request, *args, **kwargs)[source]

Initialize attributes shared by all view methods.

template_engine = None[source]
template_name: str = 'dashboard/dashboard.html'[source]

The template to render (see TemplateResponseMixin)

view_is_async = False[source]

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.

classmethod as_view(**initkwargs)[source]

Main entry point for a request-response process.

content_type = None[source]
dispatch(request, *args, **kwargs)[source]
extra_context = None[source]
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_context_data(**kwargs)[source]
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.

http_method_names = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace'][source]
http_method_not_allowed(request, *args, **kwargs)[source]
options(request, *args, **kwargs)[source]

Handle responding to requests for the OPTIONS HTTP verb.

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

setup(request, *args, **kwargs)[source]

Initialize attributes shared by all view methods.

template_engine = None[source]
template_name = 'dashboard/region_selection.html'[source]

The template to render (see TemplateResponseMixin)

view_is_async = False[source]