Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions app/main/views/storybook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
39 changes: 39 additions & 0 deletions app/templates/views/rte.html
Original file line number Diff line number Diff line change
@@ -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 %}
<h1 class="heading-medium">
{% block service_page_title %}Edit template{% endblock %}
</h1>
<div class="md:w-2/3">
{{ 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) }}
</div>
{{ 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 %}
<script type="text/javascript" nonce="{{ request_nonce }}">
if ("{{showStructure}}" == "False") {
document.querySelector('header').remove();
document.querySelector('footer').remove();
}
</script>
{% endblock %}
Loading