From 38c139aeacfbe2544a142370673e795f1bc3c264 Mon Sep 17 00:00:00 2001 From: Philippe Caron Date: Wed, 8 Apr 2026 18:21:09 +0000 Subject: [PATCH] RTE prototype --- app/main/views/storybook.py | 13 ++++++++++++ app/templates/views/rte.html | 39 ++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 app/templates/views/rte.html diff --git a/app/main/views/storybook.py b/app/main/views/storybook.py index b414c63610..5f32f6c39f 100644 --- a/app/main/views/storybook.py +++ b/app/main/views/storybook.py @@ -143,3 +143,16 @@ def storybook(): full_form=full_form, complex_markdown=complex_markdown, ) + + +@main.route("/_rte", methods=["GET"]) +def rte(): + class ExampleFullForm(Form): + name = StringField( + "Template name", default="Annual newsletter template", validators=[DataRequired(message="This cannot be empty")] + ) + subject = StringField( + "Subject field", default="Annual newsletter", validators=[DataRequired(message="This cannot be empty")] + ) + + return render_template("views/rte.html", form=ExampleFullForm(), showStructure=len(request.args) == 0) diff --git a/app/templates/views/rte.html b/app/templates/views/rte.html new file mode 100644 index 0000000000..ff0a122691 --- /dev/null +++ b/app/templates/views/rte.html @@ -0,0 +1,39 @@ +{% extends "admin_template.html" %} +{% from "components/tiptap-editor.html" import tiptap_editor with context %} +{% from "components/textbox.html" import textbox %} + + + +{% block maincolumn_content %} +

+ {% block service_page_title %}Edit template{% endblock %} +

+
+ {{ textbox(form.name, label='Template name', autocomplete='name', width="w-full", testid="test-name", required=false) }} + {{ textbox(form.subject, label='Subject line of the email', hint="Tell recipients what the email is about. Try to use less than 10 words.", autocomplete='name', width="w-full", testid="test-name", required=false) }} +
+ {{ tiptap_editor(editorId='tiptap-editor', labelId='tiptap-editor-label', initialContent='Hi,\n + We hope this newsletter finds you well! As we dive into the new year, we want to ensure you\'re up to speed with the latest happenings. Here\'s a quick recap!\n + Things You May Have Missed:\n + We are flying to the moon\n + We are investing in modular home fabrication\n + Steps to Sign Up:\n + Visit our website\n + Look for the News section on the homepage.\n + Look for the Subscribe link on the News page\n + Enter your email address in the provided field.\n + Click Subscribe to start receiving our regular updates directly in your inbox.\n + More Information:\n + For more details on our products, services, or any other inquiries, feel free to reach out to our dedicated support team at support@email.com or visit our About page at https://www.canada.ca/en/government/system.html. We value your feedback and are here to assist you in any way we can.\n') }} + + +{% endblock %} + +{% block page_script %} + +{% endblock %} \ No newline at end of file