Repository navigation
feat(legal-templates): AI template studio with jinja tag highlighting and full fieldtype support - #24
Open
abdullahsyed4c wants to merge 5 commits into
Conversation
… and full fieldtype support - Add native OpenXML highlighting for Jinja tags in downloaded Word (.docx) templates\n- Support all 44 Frappe field types organized by category in studio and modal\n- Add AI Prompt Generator integrated with Flow AI and live Gemini models\n- Add automatic Jinja highlighting on document save via on_update hook\n- Add direct Word (.docx) template download buttons to form and studio headers\n- Add executive document dashboard and generation button to generated doctypes
…rmatting improvements - Remove unauthenticated debug endpoint download_sample_agreement with hardcoded paths - Store AI API keys securely in Flow Provider DocType rather than plaintext site defaults - Add explicit frappe.has_permission checks across all Template Studio whitelisted methods - Refactor highlight_jinja_in_paragraph to preserve run-level formatting across paragraph runs - Log exceptions in LegalTemplates.on_update instead of silently swallowing with bare pass - Align Gemini model identifiers with current production endpoints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR enhances Legal Templates with an AI Template Studio, native Word (.docx) Jinja tag highlighting, and full support for all 44 Frappe field types.
Key Changes
{{ variable }}) in yellow (WD_COLOR_INDEX.YELLOW) in downloaded Word documents while preserving 100% compatibility withdocxtplrendering.on_updatehook onLegal Templatesensures templates attached or updated in Frappe are highlighted automatically on save.Files Changed
casecentral/legal_documents/doctype/legal_templates/legal_templates.jscasecentral/legal_documents/doctype/legal_templates/legal_templates.jsoncasecentral/legal_documents/doctype/legal_templates/legal_templates.pycasecentral/legal_documents/doctype/legal_templates/legal_templates_list.jscasecentral/legal_documents/doctype/legal_templates/template_studio.pycasecentral/public/js/legal_template.js