How to use the kotti.util.ActionButton function in Kotti

To help you get started, we’ve selected a few Kotti examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Kotti / Kotti / kotti / views / edit / actions.py View on Github external
def contents_buttons(context, request):
    """
    Build the action buttons for the contents view based on the current
    state and the persmissions of the user.

    :result: List of ActionButtons.
    :rtype: list
    """
    buttons = []
    if get_paste_items(context, request):
        buttons.append(ActionButton('paste', title=_(u'Paste'),
                                    no_children=True))
    if context.children:
        buttons.append(ActionButton('copy', title=_(u'Copy')))
        buttons.append(ActionButton('cut', title=_(u'Cut')))
        buttons.append(ActionButton('rename_nodes', title=_(u'Rename'),
                                    css_class=u'btn btn-warning'))
        buttons.append(ActionButton('delete_nodes', title=_(u'Delete'),
                                    css_class=u'btn btn-danger'))
        if get_workflow(context) is not None:
            buttons.append(ActionButton('change_state',
                                        title=_(u'Change State')))
        buttons.append(ActionButton('up', title=_(u'Move up')))
        buttons.append(ActionButton('down', title=_(u'Move down')))
        buttons.append(ActionButton('show', title=_(u'Show')))
        buttons.append(ActionButton('hide', title=_(u'Hide')))
    return [button for button in buttons if button.permitted(context, request)]
github Kotti / Kotti / kotti / views / edit / actions.py View on Github external
def contents_buttons(context, request):
    """ Build the action buttons for the contents view based on the current
    state and the persmissions of the user.

    :result: List of ActionButtons.
    :rtype: list
    """
    buttons = []
    if get_paste_items(context, request):
        buttons.append(ActionButton("paste", title=_("Paste"), no_children=True))
    if context.children:
        buttons.append(ActionButton("copy", title=_("Copy")))
        buttons.append(ActionButton("cut", title=_("Cut")))
        buttons.append(
            ActionButton("rename_nodes", title=_("Rename"), css_class="btn btn-warning")
        )
        buttons.append(
            ActionButton("delete_nodes", title=_("Delete"), css_class="btn btn-danger")
        )
        if get_workflow(context) is not None:
            buttons.append(ActionButton("change_state", title=_("Change State")))
        buttons.append(ActionButton("up", title=_("Move up")))
        buttons.append(ActionButton("down", title=_("Move down")))
        buttons.append(ActionButton("show", title=_("Show")))
        buttons.append(ActionButton("hide", title=_("Hide")))
    return [button for button in buttons if button.permitted(context, request)]
github Kotti / Kotti / kotti / views / edit / actions.py View on Github external
def contents_buttons(context, request):
    """ Build the action buttons for the contents view based on the current
    state and the persmissions of the user.

    :result: List of ActionButtons.
    :rtype: list
    """
    buttons = []
    if get_paste_items(context, request):
        buttons.append(ActionButton("paste", title=_("Paste"), no_children=True))
    if context.children:
        buttons.append(ActionButton("copy", title=_("Copy")))
        buttons.append(ActionButton("cut", title=_("Cut")))
        buttons.append(
            ActionButton("rename_nodes", title=_("Rename"), css_class="btn btn-warning")
        )
        buttons.append(
            ActionButton("delete_nodes", title=_("Delete"), css_class="btn btn-danger")
        )
        if get_workflow(context) is not None:
            buttons.append(ActionButton("change_state", title=_("Change State")))
        buttons.append(ActionButton("up", title=_("Move up")))
        buttons.append(ActionButton("down", title=_("Move down")))
        buttons.append(ActionButton("show", title=_("Show")))
        buttons.append(ActionButton("hide", title=_("Hide")))
    return [button for button in buttons if button.permitted(context, request)]
github Kotti / Kotti / kotti / views / edit / actions.py View on Github external
buttons.append(ActionButton('paste', title=_(u'Paste'),
                                    no_children=True))
    if context.children:
        buttons.append(ActionButton('copy', title=_(u'Copy')))
        buttons.append(ActionButton('cut', title=_(u'Cut')))
        buttons.append(ActionButton('rename_nodes', title=_(u'Rename'),
                                    css_class=u'btn btn-warning'))
        buttons.append(ActionButton('delete_nodes', title=_(u'Delete'),
                                    css_class=u'btn btn-danger'))
        if get_workflow(context) is not None:
            buttons.append(ActionButton('change_state',
                                        title=_(u'Change State')))
        buttons.append(ActionButton('up', title=_(u'Move up')))
        buttons.append(ActionButton('down', title=_(u'Move down')))
        buttons.append(ActionButton('show', title=_(u'Show')))
        buttons.append(ActionButton('hide', title=_(u'Hide')))
    return [button for button in buttons if button.permitted(context, request)]
github Kotti / Kotti / kotti / views / edit / actions.py View on Github external
if get_paste_items(context, request):
        buttons.append(ActionButton("paste", title=_("Paste"), no_children=True))
    if context.children:
        buttons.append(ActionButton("copy", title=_("Copy")))
        buttons.append(ActionButton("cut", title=_("Cut")))
        buttons.append(
            ActionButton("rename_nodes", title=_("Rename"), css_class="btn btn-warning")
        )
        buttons.append(
            ActionButton("delete_nodes", title=_("Delete"), css_class="btn btn-danger")
        )
        if get_workflow(context) is not None:
            buttons.append(ActionButton("change_state", title=_("Change State")))
        buttons.append(ActionButton("up", title=_("Move up")))
        buttons.append(ActionButton("down", title=_("Move down")))
        buttons.append(ActionButton("show", title=_("Show")))
        buttons.append(ActionButton("hide", title=_("Hide")))
    return [button for button in buttons if button.permitted(context, request)]
github Kotti / Kotti / kotti / views / edit / actions.py View on Github external
def contents_buttons(context, request):
    """ Build the action buttons for the contents view based on the current
    state and the persmissions of the user.

    :result: List of ActionButtons.
    :rtype: list
    """
    buttons = []
    if get_paste_items(context, request):
        buttons.append(ActionButton("paste", title=_("Paste"), no_children=True))
    if context.children:
        buttons.append(ActionButton("copy", title=_("Copy")))
        buttons.append(ActionButton("cut", title=_("Cut")))
        buttons.append(
            ActionButton("rename_nodes", title=_("Rename"), css_class="btn btn-warning")
        )
        buttons.append(
            ActionButton("delete_nodes", title=_("Delete"), css_class="btn btn-danger")
        )
        if get_workflow(context) is not None:
            buttons.append(ActionButton("change_state", title=_("Change State")))
        buttons.append(ActionButton("up", title=_("Move up")))
        buttons.append(ActionButton("down", title=_("Move down")))
        buttons.append(ActionButton("show", title=_("Show")))
        buttons.append(ActionButton("hide", title=_("Hide")))
    return [button for button in buttons if button.permitted(context, request)]
github Kotti / Kotti / kotti / views / edit / actions.py View on Github external
buttons.append(ActionButton("paste", title=_("Paste"), no_children=True))
    if context.children:
        buttons.append(ActionButton("copy", title=_("Copy")))
        buttons.append(ActionButton("cut", title=_("Cut")))
        buttons.append(
            ActionButton("rename_nodes", title=_("Rename"), css_class="btn btn-warning")
        )
        buttons.append(
            ActionButton("delete_nodes", title=_("Delete"), css_class="btn btn-danger")
        )
        if get_workflow(context) is not None:
            buttons.append(ActionButton("change_state", title=_("Change State")))
        buttons.append(ActionButton("up", title=_("Move up")))
        buttons.append(ActionButton("down", title=_("Move down")))
        buttons.append(ActionButton("show", title=_("Show")))
        buttons.append(ActionButton("hide", title=_("Hide")))
    return [button for button in buttons if button.permitted(context, request)]
github Kotti / Kotti / kotti / views / edit / actions.py View on Github external
"""
    buttons = []
    if get_paste_items(context, request):
        buttons.append(ActionButton('paste', title=_(u'Paste'),
                                    no_children=True))
    if context.children:
        buttons.append(ActionButton('copy', title=_(u'Copy')))
        buttons.append(ActionButton('cut', title=_(u'Cut')))
        buttons.append(ActionButton('rename_nodes', title=_(u'Rename'),
                                    css_class=u'btn btn-warning'))
        buttons.append(ActionButton('delete_nodes', title=_(u'Delete'),
                                    css_class=u'btn btn-danger'))
        if get_workflow(context) is not None:
            buttons.append(ActionButton('change_state',
                                        title=_(u'Change State')))
        buttons.append(ActionButton('up', title=_(u'Move up')))
        buttons.append(ActionButton('down', title=_(u'Move down')))
        buttons.append(ActionButton('show', title=_(u'Show')))
        buttons.append(ActionButton('hide', title=_(u'Hide')))
    return [button for button in buttons if button.permitted(context, request)]
github Kotti / Kotti / kotti / views / edit / actions.py View on Github external
state and the persmissions of the user.

    :result: List of ActionButtons.
    :rtype: list
    """
    buttons = []
    if get_paste_items(context, request):
        buttons.append(ActionButton("paste", title=_("Paste"), no_children=True))
    if context.children:
        buttons.append(ActionButton("copy", title=_("Copy")))
        buttons.append(ActionButton("cut", title=_("Cut")))
        buttons.append(
            ActionButton("rename_nodes", title=_("Rename"), css_class="btn btn-warning")
        )
        buttons.append(
            ActionButton("delete_nodes", title=_("Delete"), css_class="btn btn-danger")
        )
        if get_workflow(context) is not None:
            buttons.append(ActionButton("change_state", title=_("Change State")))
        buttons.append(ActionButton("up", title=_("Move up")))
        buttons.append(ActionButton("down", title=_("Move down")))
        buttons.append(ActionButton("show", title=_("Show")))
        buttons.append(ActionButton("hide", title=_("Hide")))
    return [button for button in buttons if button.permitted(context, request)]