def apply_editor_markup(request): """ calls civet_utilities.do_markup() to lede and content. """ # it would be useful to get rid of the magic numbers here...<16.08.18> textblock = get_editor_blocks(request.POST['civ_editor']) newstr = '' ka = 0 for idst, lst in textblock.iteritems(): # print('AEM1',ka, idst,lst) newstr += make_ckeditor_markup_string( [idst, civet_utilities.do_markup(lst[0]), lst[1], lst[2], '', civet_utilities.do_markup(lst[3])], # insert placeholder for BIBLIO_INDEX ka) # print('AEM2',newstr) ka += 1 context = get_CKEditor_context(newstr) return render(request,'djciv_data/civet_ckeditor.html',context)
def get_coder_markup(): """ return a string containing all of the textmkup fields from ActiveCollection """ global HeaderInfo # -- print('GCM-Enter:',ActiveCollection) thecoll = Collection.objects.get(collid__exact=ActiveCollection) HeaderInfo['collid'] = thecoll.collid HeaderInfo['collcmt'] = thecoll.collcmt # -- print('GCM-1:',HeaderInfo) curtexts = Text.objects.filter(textparent__exact=ActiveCollection) stx = '' for ka, ct in enumerate(curtexts): # print('GCM-2:',ct.textoriginal[:64]) # -- print('GCM-2:',ct.textoriginal) if not ct.textdelete: temp = ct.get_text_fields() # -- print('GCM-3:',temp[:2],temp[2][:64]) if civet_settings.NEVER_ANNOTATE: # temp[TEXT_INDEX] = temp[5] pass elif civet_settings.ALWAYS_ANNOTATE and 'class:nament' not in temp[TEXT_INDEX]: # a robust, if not quite guaranteed, telltale that there has been no markup temp[TEXT_INDEX] = civet_utilities.do_markup(temp[TEXT_INDEX]) stx += make_coder_markup_string(temp,ka) # -- print('GCM-4:',stx) # print('GCM-exit') return stx
def get_editor_markup(): """ return a string containing all of the textmkup fields from ActiveCollection """ curtexts = Text.objects.filter(textparent__exact=ActiveCollection) stx = '' for ka, ct in enumerate(curtexts): # print('GEM-Mk2:',ct.textmkup) temp = ct.get_text_fields() # print('GEM-Mk3:',temp) if civet_settings.ALWAYS_ANNOTATE and 'class:nament' not in temp[TEXT_INDEX]: # a robust, if not quite guaranteed, telltale that there has been no markup temp[TEXT_INDEX] = civet_utilities.do_markup(temp[TEXT_INDEX]) stx += make_ckeditor_markup_string(temp,ka) return stx