コード例 #1
0
def contentContext(request, project):
    from pyworkflow.gui.tree import ProjectRunsTreeProvider

    projectName = project.getShortName()
    print "ProjectName: ", projectName
    project_settings = project.getSettings()
    request.session['projectPath'] = project.getPath()
    request.session['projectName'] = projectName

    provider = ProjectRunsTreeProvider(project)
    runs = formatProvider(provider, "runs")
    request.session['runs'] = runs

    # Get the selected runs stored in BD
    selectedRuns = project_settings.runSelection

    # Get the run mode view (0:list / 1:graph / 2:small graph) stored in BD
    runsView = project_settings.runsView.get()

    # load the protocol tree current active
    htmlTree = loadProtTree(project)

    # get the choices to load protocol trees
    choices = project.getProtocolViews()

    # get the choice current
    choiceSelected = choices.index(project.getCurrentProtocolView().text.get())

    # show the project name in the header.html
    projectNameHeader = 'Project ' + str(projectName)

    context = {
        'projectName': projectName,
        'view': 'protocols',
        'editTool': getResourceIcon('edit_toolbar'),
        'copyTool': getResourceIcon('copy_toolbar'),
        'deleteTool': getResourceIcon('delete_toolbar'),
        'browseTool': getResourceIcon('browse_toolbar'),
        'stopTool': getResourceIcon('stop_toolbar'),
        'analyzeTool': getResourceIcon('analyze_toolbar'),
        'treeTool': getResourceIcon('tree_toolbar'),
        'listTool': getResourceIcon('list_toolbar'),
        'graph_utils': getResourceJs('graph_utils'),
        'project_content_utils': getResourceJs('project_content_utils'),
        'jquery_cookie': getResourceJs('jquery_cookie'),
        'jquery_treeview': getResourceJs('jquery_treeview'),
        'project_content_css': getResourceCss('project_content'),
        'protTreeHtml': htmlTree,
        'choices': choices,
        'choiceSelected': choiceSelected,
        'runs': runs,
        'columns': provider.getColumns(),
        'projectNameHeader': projectNameHeader,
        'runsView': runsView,
        'selectedRuns': selectedRuns
    }

    context = base_flex(request, context)

    return context
コード例 #2
0
ファイル: views_project.py プロジェクト: I2PC/scipion
def contentContext(request, project):
    from pyworkflow.gui.tree import ProjectRunsTreeProvider
    
    projectName = project.getShortName()
    print "ProjectName: ", projectName
    project_settings = project.getSettings()
    request.session['projectPath'] = project.getPath()
    request.session['projectName'] = projectName
    
    provider = ProjectRunsTreeProvider(project)
    runs = formatProvider(provider, "runs")
    request.session['runs'] = runs

    # Get the selected runs stored in BD    
    selectedRuns = project_settings.runSelection

    # Get the run mode view (0:list / 1:graph / 2:small graph) stored in BD
    runsView = project_settings.runsView.get()
        
    # load the protocol tree current active
    htmlTree = loadProtTree(project)
    
    # get the choices to load protocol trees
    choices = project.getProtocolViews()

    # get the choice current 
    choiceSelected =  choices.index(project.getCurrentProtocolView().text.get())
    
    # show the project name in the header.html
    projectNameHeader = 'Project '+ str(projectName)
    
    context = {'projectName': projectName,
               'view':'protocols',
               'editTool': getResourceIcon('edit_toolbar'),
               'copyTool': getResourceIcon('copy_toolbar'),
               'deleteTool': getResourceIcon('delete_toolbar'),
               'browseTool': getResourceIcon('browse_toolbar'),
               'stopTool': getResourceIcon('stop_toolbar'),
               'analyzeTool': getResourceIcon('analyze_toolbar'),
               'treeTool': getResourceIcon('tree_toolbar'),
               'listTool': getResourceIcon('list_toolbar'),
               'graph_utils': getResourceJs('graph_utils'),
               'project_content_utils': getResourceJs('project_content_utils'),
               'jquery_cookie': getResourceJs('jquery_cookie'),
               'jquery_treeview': getResourceJs('jquery_treeview'),
               'project_content_css':getResourceCss('project_content'),
               'protTreeHtml': htmlTree,
               'choices':choices,
               'choiceSelected': choiceSelected,
               'runs': runs,
               'columns': provider.getColumns(),
               'projectNameHeader': projectNameHeader, 
               'runsView': runsView,
               'selectedRuns': selectedRuns
               }

    context = base_flex(request, context)
    
    return context
コード例 #3
0
def contentContext(request, project, serviceName=None):
    from pyworkflow.gui.tree import ProjectRunsTreeProvider

    projectName = project.getShortName()
    if serviceName is None:
        serviceName = getVarFromRequest(request, SERVICE_NAME)

    project_settings = project.getSettings()
    request.session[CTX_PROJECT_PATH] = project.getPath()
    request.session[PROJECT_NAME] = projectName

    provider = ProjectRunsTreeProvider(project)
    runs = formatProvider(provider, "runs")
    request.session['runs'] = runs

    # Get the selected runs stored in BD
    selectedRuns = project_settings.runSelection

    # Get the run mode view (0:list / 1:graph / 2:small graph) stored in BD
    runsView = project_settings.runsView.get()

    # load the protocol tree current active
    htmlTree = loadProtTree(project, serviceName)

    # get the choices to load protocol trees
    choices = project.getProtocolViews()

    # get the choice current
    choiceSelected = choices.index(project.getCurrentProtocolView().text.get())

    context = {
        CTX_PROJECT_NAME: projectName,
        'view': 'protocols',
        'editTool': getResourceIcon('edit_toolbar'),
        'copyTool': getResourceIcon('copy_toolbar'),
        'deleteTool': getResourceIcon('delete_toolbar'),
        'browseTool': getResourceIcon('browse_toolbar'),
        'stopTool': getResourceIcon('stop_toolbar'),
        'analyzeTool': getResourceIcon('analyze_toolbar'),
        'treeTool': getResourceIcon('tree_toolbar'),
        'listTool': getResourceIcon('list_toolbar'),
        'graph_utils': getResourceJs('graph_utils'),
        'project_content_utils': getResourceJs('project_content_utils'),
        'jquery_cookie': getResourceJs('jquery_cookie'),
        'jquery_treeview': getResourceJs('jquery_treeview'),
        'project_content_css': getResourceCss('project_content'),
        'protTreeHtml': htmlTree,
        'choices': choices,
        'choiceSelected': choiceSelected,
        'runs': runs,
        'columns': provider.getColumns(),
        'runsView': runsView,
        'selectedRuns': selectedRuns,
        SERVICE_NAME: serviceName
    }

    context = base_flex(request, context)

    return context
コード例 #4
0
ファイル: views_data.py プロジェクト: EyeSeeTea/scipion-web
def data_content(request):
    projectName = getVarFromRequest(request, PROJECT_NAME)

    manager = Manager()
    request.session[CTX_PROJECT_PATH] = manager.getProjectPath(projectName)
    # project = loadProject(request)

    context = {CTX_PROJECT_NAME: projectName,
               'editTool': getResourceIcon('edit_toolbar'),
               'graph_utils': getResourceJs('graph_utils'),
               'project_content_utils': getResourceJs('project_content_utils'),
               'data_content_utils': getResourceJs('data_content_utils'),
               'jquery_cookie': getResourceJs('jquery_cookie'),
               'jquery_treeview': getResourceJs('jquery_treeview'),
               'project_content_css': getResourceCss('project_content'),
               'view': 'data'
               }

    context = base_flex(request, context)

    return render_to_response('data_content/data_content.html', context)
コード例 #5
0
def data_content(request):        
    projectName = request.GET.get('projectName', None)
    
    manager = Manager()
    request.session['projectPath'] = manager.getProjectPath(projectName)
    project = loadProject(request)
    
    context = {'projectName': projectName,
               'editTool': getResourceIcon('edit_toolbar'),
               'graph_utils': getResourceJs('graph_utils'),
               'project_content_utils': getResourceJs('project_content_utils'),
               'data_content_utils': getResourceJs('data_content_utils'),
               'jquery_cookie': getResourceJs('jquery_cookie'),
               'jquery_treeview': getResourceJs('jquery_treeview'),
               'project_content_css':getResourceCss('project_content'),
               'view':'data'
               }
    
    context = base_flex(request, context)
    
    return render_to_response('data_content/data_content.html', context)
コード例 #6
0
def search_protocol(request):
    context = base_flex(request, {})
    return render_to_response('project_content/search_protocol.html', context)
コード例 #7
0
ファイル: views_project.py プロジェクト: I2PC/scipion
def search_protocol(request):
    context = base_flex(request, {})
    return render_to_response('project_content/search_protocol.html', context)