(request)
return ajax_success(html=template, msg="Refreshed clipboard")
Displays the most recent object in clipboard.
Displays the most recent object in clipboard.
Displays the most recent object in clipboard .
def ajax_clipboard(request):
    """
    Displays the most recent object in clipboard.
    """

    # Get the most current item in the clipboard.
    pid = request.POST.get("id", 0)
    user = request.user

    project = Project.objects.filter(id=pid).first()
    board = auth.recent_clipboard(request=request)
    key, vals = board
    count = len(vals)

    if project and auth.is_readable(user=user, obj=project) and count:
        # Load items into clipboard
        tmpl = loader.get_template('widgets/clipboard.html')
        movable = key in [COPIED_RECIPES, COPIED_DATA]
        context = dict(count=count, board=key, is_recipe=key == COPIED_RECIPES, movable=movable)
        template = tmpl.render(context=context)
    else:
        template = ''

    return ajax_success(html=template, msg="Refreshed clipboard")
def ajax_clipboard ( request ) : # Get the most current item in the clipboard. pid = request . POST . get ( "id" , 0 ) user = request . user project = Project . objects . filter ( id = pid ) . first ( ) board = auth . recent_clipboard ( request = request ) key , vals = board count = len ( vals ) if project and auth . is_readable ( user = user , obj = project ) and count : # Load items into clipboard tmpl = loader . get_template ( 'widgets/clipboard.html' ) movable = key in [ COPIED_RECIPES , COPIED_DATA ] context = dict ( count = count , board = key , is_recipe = key == COPIED_RECIPES , movable = movable ) template = tmpl . render ( context = context ) else : template = '' return ajax_success ( html = template , msg = "Refreshed clipboard" )