Add rendered preview in admin #491
Open
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.
Closes #325, #383, #455, and #457.
I reworked #383 against the current
masterbranch.I rely on the migration from #490, so this will fail until that is merged and this branch is rebased.
This has the same caveats as #383.
I couldn't figure out how to nicely move the code into a separate admin view.
Ideally we would actually support a live-ish preview where we ship the content or HTML content values off along with the example context every time the user stops typing (after a small timeout). But that's outside my bailiwick so I didn't want to attempt that.
Initially I tried working without an
example_contextmodel field, but I came around to the idea of it eventually. Writing that will assist the next template editor by giving them a context that is ready to go.