Example #1
0
def toolbar_xxx(request, n):

    wf = get_workflow()

    if not wf.is_manageable(n, request.user):
        return ''

    bar = nav(class_='navbar navbar-default')[
        div(class_='container-fluid')[
            div(class_='collapse navbar-collapse')[
                ul(class_='nav navbar-nav')[
                    li(a('View', href=request.route_url('node-view', path=n.url))),
                    li(a('Edit', href=request.route_url('node-edit', path=n.url))),
                    li(a('Content', href=request.route_url('node-content', path=n.url))),
                    li(a('Info', href=request.route_url('node-info', path=n.url))),
                    get_add_menu(n, request),
                ],
                ul(class_='nav navbar-nav navbar-right')[
                    li(a('Delete')),
                    wf.show_menu(n, request)
                ]
            ]

        ]

    ]
    return bar
Example #2
0
def toolbar(request, n, workflow=None):

    if not request.user:
        return div(breadcrumb(request, n))

    if not workflow:
        wf = get_workflow(n)
    else:
        wf = workflow

    if not wf.is_manageable(n, request.user):
        return div(breadcrumb(request, n), node_info(request, n))

    bar = nav(class_='navbar navbar-default')[
        div(class_='container-fluid')[
            div(class_='collapse navbar-collapse')[
                ul(class_='nav navbar-nav')[
                    li(a('View', href=request.route_url('node-view', path=n.url))),
                    li(a('Edit', href=request.route_url('node-edit', path=n.url))),
                    li(a('Content', href=request.route_url('node-content', path=n.url))),
                    li(a('Info', href=request.route_url('node-info', path=n.url))),
                    get_add_menu(n, request),
                ],
                ul(class_='nav navbar-nav navbar-right')[
                    li(a('Delete')),
                    wf.show_menu(n, request)
                ]
            ]

        ]

    ]

    return div(breadcrumb(request, n), node_info(request, n), bar)