コード例 #1
0
def edit():
    # Block (redirect) if we've suspended study editing
    maintenance_info = get_maintenance_info(request)
    if maintenance_info.get('maintenance_in_progress', False):
        redirect(URL('curator', 'study', 'view', 
            vars={"maintenance_notice":"true"}, 
            args=request.args))
    # Fetch a fresh list of search contexts for TNRS? see working example in
    # the header search of the main opentree webapp
    view_dict = get_opentree_services_method_urls(request)
    view_dict['taxonSearchContextNames'] = fetch_current_TNRS_context_names(request)
    view_dict['treesQueuedForSynthesis'] = fetch_trees_queued_for_synthesis(request)
    view_dict['studyID'] = request.args[0]
    view_dict['latestSynthesisSHA'], view_dict['latestSynthesisTreeIDs'] = _get_latest_synthesis_details_for_study_id(view_dict['studyID'])
    view_dict['viewOrEdit'] = 'EDIT'
    return view_dict
コード例 #2
0
def view():
    """
    Allow any visitor to view (read-only!) a study on the 'master' branch

    ? OR can this include work-in-progress from a personal branch?
    """
    response.view = 'study/edit.html'
    view_dict = get_opentree_services_method_urls(request)
    view_dict['maintenance_info'] = get_maintenance_info(request)
    #view_dict['taxonSearchContextNames'] = fetch_current_TNRS_context_names(request)
    view_dict['studyID'] = request.args[0]
    view_dict['latestSynthesisSHA'], view_dict['latestSynthesisTreeIDs'] = _get_latest_synthesis_details_for_study_id(view_dict['studyID'])
    view_dict['viewOrEdit'] = 'VIEW'
    view_dict['userCanEdit'] = auth.is_logged_in() and True or False
    view_dict['treesQueuedForSynthesis'] = fetch_trees_queued_for_synthesis(request)
    return view_dict
コード例 #3
0
ファイル: study.py プロジェクト: thyzzs/opentree
def view():
    """
    Allow any visitor to view (read-only!) a study on the 'master' branch

    ? OR can this include work-in-progress from a personal branch?
    """
    response.view = 'study/edit.html'
    view_dict = get_opentree_services_method_urls(request)
    view_dict['maintenance_info'] = get_maintenance_info(request)
    #view_dict['taxonSearchContextNames'] = fetch_current_TNRS_context_names(request)
    view_dict['studyID'] = request.args[0]
    view_dict['latestSynthesisSHA'], view_dict[
        'latestSynthesisTreeIDs'] = _get_latest_synthesis_details_for_study_id(
            view_dict['studyID'])
    view_dict['viewOrEdit'] = 'VIEW'
    view_dict['userCanEdit'] = auth.is_logged_in() and True or False
    view_dict['treesQueuedForSynthesis'] = fetch_trees_queued_for_synthesis(
        request)
    return view_dict
コード例 #4
0
ファイル: study.py プロジェクト: thyzzs/opentree
def edit():
    # Block (redirect) if we've suspended study editing
    maintenance_info = get_maintenance_info(request)
    if maintenance_info.get('maintenance_in_progress', False):
        redirect(
            URL('curator',
                'study',
                'view',
                vars={"maintenance_notice": "true"},
                args=request.args))
    # Fetch a fresh list of search contexts for TNRS? see working example in
    # the header search of the main opentree webapp
    view_dict = get_opentree_services_method_urls(request)
    view_dict['taxonSearchContextNames'] = fetch_current_TNRS_context_names(
        request)
    view_dict['treesQueuedForSynthesis'] = fetch_trees_queued_for_synthesis(
        request)
    view_dict['studyID'] = request.args[0]
    view_dict['latestSynthesisSHA'], view_dict[
        'latestSynthesisTreeIDs'] = _get_latest_synthesis_details_for_study_id(
            view_dict['studyID'])
    view_dict['viewOrEdit'] = 'EDIT'
    return view_dict