Media
This package contains all views related to media files
Media Actions
This module contains view actions for media related objects.
- integreat_cms.cms.views.media.media_actions.create_directory_ajax(request: HttpRequest, region_slug: str | None = None) JsonResponse [source]
View provides the frontend with the option to create a directory via AJAX.
- Parameters:
request (HttpRequest) – The current request
region_slug (str | None) – The slug of the current region
- Returns:
JSON response which indicates error or success
- Return type:
JsonResponse
- integreat_cms.cms.views.media.media_actions.delete_directory_ajax(request: HttpRequest, region_slug: str | None = None) JsonResponse [source]
View provides the frontend with the option to delete a directory via AJAX.
- Parameters:
request (HttpRequest) – The current request
region_slug (str | None) – The slug of the current region
- Returns:
JSON response which indicates error or success
- Return type:
JsonResponse
- integreat_cms.cms.views.media.media_actions.delete_file_ajax(request: HttpRequest, region_slug: str | None = None) JsonResponse [source]
View to delete a file via an AJAX call.
- Parameters:
request (HttpRequest) – The current request
region_slug (str | None) – The slug of the current region
- Returns:
JSON response which indicates error or success
- Return type:
JsonResponse
- integreat_cms.cms.views.media.media_actions.edit_directory_ajax(request: HttpRequest, region_slug: str | None = None) JsonResponse [source]
View provides the frontend with the option to modify a directory via AJAX.
- Parameters:
request (HttpRequest) – The current request
region_slug (str | None) – The slug of the current region
- Returns:
JSON response which indicates error or success
- Return type:
JsonResponse
- integreat_cms.cms.views.media.media_actions.edit_file_ajax(request: HttpRequest, region_slug: str | None = None) JsonResponse [source]
View provides the edit of a file via AJAX.
- Parameters:
request (HttpRequest) – The current request
region_slug (str | None) – The slug of the current region
- Returns:
JSON response which indicates error or success
- Return type:
JsonResponse
- integreat_cms.cms.views.media.media_actions.get_directory_content_ajax(request: HttpRequest, region_slug: str | None = None) JsonResponse [source]
View provides the frontend with the content of a directory via AJAX.
- Parameters:
request (HttpRequest) – The current request
region_slug (str | None) – The slug of the current region
- Returns:
JSON response which indicates error or success
- Return type:
JsonResponse
- integreat_cms.cms.views.media.media_actions.get_directory_path_ajax(request: HttpRequest, region_slug: str | None = None) JsonResponse [source]
View provides the frontend with the current directory path for the breadcrumbs.
- Parameters:
request (HttpRequest) – The current request
region_slug (str | None) – The slug of the current region
- Returns:
JSON response which indicates error or success
- Return type:
JsonResponse
- integreat_cms.cms.views.media.media_actions.get_file_usages_ajax(request: HttpRequest, region_slug: str | None = None) JsonResponse [source]
View to search unused media files
- Parameters:
request (HttpRequest) – The current request
region_slug (str | None) – The slug of the current region
- Returns:
JSON response with the search result
- Return type:
JsonResponse
- integreat_cms.cms.views.media.media_actions.get_query_search_results_ajax(request: HttpRequest, region_slug: str | None = None) JsonResponse [source]
View to search the media library
- Parameters:
request (HttpRequest) – The current request
region_slug (str | None) – The slug of the current region
- Returns:
JSON response with the search result
- Return type:
JsonResponse
- integreat_cms.cms.views.media.media_actions.get_unused_media_files_ajax(request: HttpRequest, region_slug: str | None = None) JsonResponse [source]
View to search unused media files
- Parameters:
request (HttpRequest) – The current request
region_slug (str | None) – The slug of the current region
- Returns:
JSON response with the search result
- Return type:
JsonResponse
- integreat_cms.cms.views.media.media_actions.move_file_ajax(request: HttpRequest, region_slug: str | None = None) JsonResponse [source]
This view provides the frontend with the option to move files via AJAX.
- Parameters:
request (HttpRequest) – The current request
region_slug (str | None) – The slug of the current region
- Returns:
JSON response which indicates error or success
- Return type:
JsonResponse
- integreat_cms.cms.views.media.media_actions.replace_file_ajax(request: HttpRequest, region_slug: str | None = None) JsonResponse [source]
View provides the replacement of a file via AJAX.
- Parameters:
request (HttpRequest) – The current request
region_slug (str | None) – The slug of the current region
- Returns:
JSON response which indicates error or success
- Return type:
JsonResponse
- integreat_cms.cms.views.media.media_actions.upload_file_ajax(request: HttpRequest, region_slug: str | None = None) JsonResponse [source]
View to create a file via an AJAX upload.
- Parameters:
request (HttpRequest) – The current request
region_slug (str | None) – The slug of the current region
- Returns:
JSON response which indicates error or success
- Return type:
JsonResponse
Media Context Mixin
- class integreat_cms.cms.views.media.media_context_mixin.MediaContextMixin[source]
Bases:
ContextMixin
This mixin provides context data required by the the media library.
Media List View
The module is working as the view component for the dynamic data loading for the media library. Therefore, it’s managing the region permissions and connects the different data structures. Especially, the root file, the use of the file defined in the Document and the different meta data.
- class integreat_cms.cms.views.media.media_list_view.AdminMediaListView(**kwargs)[source]
Bases:
TemplateView
,MediaContextMixin
Class representing the media management and renders the dynamic data into the HTML template.
- __init__(**kwargs)[source]
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- extra_context = {'current_menu_item': 'media'}[source]
The context dict passed to the template (see
ContextMixin
)
- get_context_data(**kwargs: Any) dict[str, Any] [source]
Overwrites the default
get_context_data()
Method of Django to provide an additional context for template rendering.
- 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
- class integreat_cms.cms.views.media.media_list_view.MediaListView(**kwargs)[source]
Bases:
TemplateView
,MediaContextMixin
Class representing the media management and renders the dynamic data into the HTML template.
- __init__(**kwargs)[source]
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- extra_context = {'current_menu_item': 'media'}[source]
The context dict passed to the template (see
ContextMixin
)
- get_context_data(**kwargs: Any) dict[str, Any] [source]
Overwrites the default
get_context_data()
Method of Django to provide an additional context for template rendering.
- 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 = 'media/media_list.html'[source]
The template to render (see
TemplateResponseMixin
)