Beispiel #1
0
def get_coder_context():
    global CurVars
    theform, CurVars = civet_form.get_current_form(PageIndex)
    if not civet_settings.NEVER_ANNOTATE:
        for cat in civet_form.UserCategories:
            theform = theform.replace('=^=' + cat + '=^=',civet_form.UserCategories[cat][1]) # replace the categories in the form with internal termstNN
    if '=*=DYN:' in theform:
        theform = civet_form.add_dynselect(theform, ActiveCollection)  
    context = {}
    context['document_header'] = civet_form.WorkspaceFileName.replace('_text_',WorkspaceName) +\
                                 civet_form.CollectionId.replace('_text_',HeaderInfo['collid']) +\
                                 civet_form.CollectionComments.replace('_text_',HeaderInfo['collcmt'])
#    print('GCC-1:',theform)
    context['form_content'] = theform
    context['form_css'] = civet_form.FormCSS
    context['markedtext'] = CoderText
    context['newterm'] = TermStyles
    context['page_title'] = civet_settings.FORM_PAGETITLE        
    context['listeners'] = make_listeners(CoderText.count('<div class = "textlede"'))    
    context['links'] = make_links()    
    context['page_index'] = PageIndex # not actually using this right now
    flen = len(civet_form.FormContent)
    if flen > 1:
        context['show_prev'] = (PageIndex > 0)
        context['show_next'] = (PageIndex < flen - 1)
    context['map_content'] = civet_form.make_map_info(ActiveCollection)
    return context
Beispiel #2
0
def get_form_context():
    global CurVars
#    print('GFC0:',PageIndex, civet_form.FormFields)
    context = {}
    context['form_content'], CurVars = civet_form.get_current_form(PageIndex)
#    print('GFC1:',context['form_content'])            
    context['form_css'] = civet_form.FormCSS
    context['page_title'] = civet_settings.FORM_PAGETITLE        
    context['page_index'] = PageIndex # not actually using this right now
    flen = len(civet_form.FormContent)
    if flen > 1:
        context['show_prev'] = (PageIndex > 0)
        context['show_next'] = (PageIndex < flen - 1)         
    return context