kotti.views.edit.actions

Action views

class kotti.views.edit.actions.NodeActions(context, request)[source]

Bases: object

Actions related to content nodes.

back(view=None)[source]

Redirect to the given view of the context, the referrer of the request or the default_view of the context.

Return type

pyramid.httpexceptions.HTTPFound

workflow_change()[source]

Handle workflow change requests from workflow dropdown.

Result

Redirect response to the referrer of the request.

Return type

pyramid.httpexceptions.HTTPFound

copy_node()[source]

Copy nodes view. Copy the current node or the selected nodes in the contents view and save the result in the session of the request.

Result

Redirect response to the referrer of the request.

Return type

pyramid.httpexceptions.HTTPFound

cut_nodes()[source]

Cut nodes view. Cut the current node or the selected nodes in the contents view and save the result in the session of the request.

Result

Redirect response to the referrer of the request.

Return type

pyramid.httpexceptions.HTTPFound

paste_nodes()[source]

Paste nodes view. Paste formerly copied or cutted nodes into the current context. Note that a cutted node can not be pasted into itself.

Result

Redirect response to the referrer of the request.

Return type

pyramid.httpexceptions.HTTPFound

move(move)[source]

Do the real work to move the selected nodes up or down. Called by the up and the down view.

Result

Redirect response to the referrer of the request.

Return type

pyramid.httpexceptions.HTTPFound

up()[source]

Move up nodes view. Move the selected nodes up by 1 position and get back to the referrer of the request.

Result

Redirect response to the referrer of the request.

Return type

pyramid.httpexceptions.HTTPFound

down()[source]

Move down nodes view. Move the selected nodes down by 1 position and get back to the referrer of the request.

Result

Redirect response to the referrer of the request.

Return type

pyramid.httpexceptions.HTTPFound

set_visibility(show)[source]

Do the real work to set the visibility of nodes in the menu. Called by the show and the hide view.

Result

Redirect response to the referrer of the request.

Return type

pyramid.httpexceptions.HTTPFound

show()[source]

Show nodes view. Switch the in_navigation attribute of selected nodes to True and get back to the referrer of the request.

Result

Redirect response to the referrer of the request.

Return type

pyramid.httpexceptions.HTTPFound

hide()[source]

Hide nodes view. Switch the in_navigation attribute of selected nodes to False and get back to the referrer of the request.

Result

Redirect response to the referrer of the request.

Return type

pyramid.httpexceptions.HTTPFound

delete_node()[source]

Delete node view. Renders either a view to delete the current node or handle the deletion of the current node and get back to the default view of the node.

Result

Either a redirect response or a dictionary passed to the template for rendering.

Return type

pyramid.httpexceptions.HTTPFound or dict

delete_nodes()[source]

Delete nodes view. Renders either a view to delete multiple nodes or delete the selected nodes and get back to the referrer of the request.

Result

Either a redirect response or a dictionary passed to the template for rendering.

Return type

pyramid.httpexceptions.HTTPFound or dict

rename_node()[source]

Rename node view. Renders either a view to change the title and name for the current node or handle the changes and get back to the default view of the node.

Result

Either a redirect response or a dictionary passed to the template for rendering.

Return type

pyramid.httpexceptions.HTTPFound or dict

rename_nodes()[source]

Rename nodes view. Renders either a view to change the titles and names for multiple nodes or handle the changes and get back to the referrer of the request.

Result

Either a redirect response or a dictionary passed to the template for rendering.

Return type

pyramid.httpexceptions.HTTPFound or dict

change_state()[source]

Change state view. Renders either a view to handle workflow changes for multiple nodes or handle the selected workflow changes and get back to the referrer of the request.

Result

Either a redirect response or a dictionary passed to the template for rendering.

Return type

pyramid.httpexceptions.HTTPFound or dict

kotti.views.edit.actions.contents_buttons(context, request)[source]

Build the action buttons for the contents view based on the current state and the persmissions of the user.

Result

List of ActionButtons.

Return type

list

kotti.views.edit.actions.content_type_factories(context, request)[source]

Renders the drop down menu for Add button in editor bar.

Result

Dictionary passed to the template for rendering.

Return type

pyramid.httpexceptions.HTTPFound or dict

kotti.views.edit.actions.contents(context, request)[source]

Contents view. Renders either the contents view or handle the action button actions of the view.

Result

Either a redirect response or a dictionary passed to the template for rendering.

Return type

pyramid.httpexceptions.HTTPFound or dict

kotti.views.edit.actions.move_child_position(context, request)[source]

Move the child from one position to another.

Parameters
  • context (:class:kotti.resources.Node or descendant) – “Container” node in which the child changes its position.

  • request – Current request (of method POST). Must contain either “from” and “to” params or a json_body that contain(s) the 0-based old (i.e. the current index of the child to be moved) and new position (its new index) values.

Result

JSON serializable object with a single attribute (“result”) that is either “success” or “error”.

Return type

dict

kotti.views.edit.actions.workflow(context, request)[source]

Renders the drop down menu for workflow actions.

Result

Dictionary passed to the template for rendering.

Return type

dict

kotti.views.edit.actions.actions(context, request)[source]

Renders the drop down menu for Actions button in editor bar.

Result

Dictionary passed to the template for rendering.

Return type

dict

kotti.views.edit.actions.includeme(config)[source]

Pyramid includeme hook.

Parameters

config (pyramid.config.Configurator) – app config