Skip to content

LTD-6168-drop-customisation-text #2471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2025
Merged

Conversation

depsiatwal
Copy link
Contributor

Removes the ability to customise and repeat preview of letter.
Now this allows review initially then the user needs to generate the letter

{% crispy form %}

<h1 class="govuk-heading-l">{% block title %}Generate document{% endblock %}</h1>
<p id="subtitle" class="govuk-body"><strong>This is a preview of the letter. Check the preview is correct and then hit “Generate”</strong></p>
Copy link
Contributor

@markj0hnst0n markj0hnst0n Apr 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use BaseForm for all this HTML so you would just need the form itself. Something like this:

class GenerateDocumentForm(BaseForm):
    class Layout:
        TITLE = "Generate document"
        SUBTITLE = "This is a preview of the letter.  Check the preview is correct and then hit “Generate”"
        SUBMIT_BUTTON_TEXT = "Generate"'

    def get_layout_fields(self):
        return (HTML('<div class="app-letter-preview__page" id="preview">{{ preview|safe }}</div><br>'),)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The form is being used for the buttons only
We inject the preview of the document in the middle and we need the title(s) and text at the top
and the buttons and actions of the form at the bottom.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated my comment to include info about the preview too as you can just inject that bit of HTML into the layout.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def get_layout_fields(self):
return (HTML('

{{ preview|safe }}

'),)

ok fair enough i've refactored the template to accommodate, agree it's much neater now.

@depsiatwal depsiatwal force-pushed the LTD-6168-drop-customisation-text branch from 44b4b42 to 58186c4 Compare April 23, 2025 16:39
markj0hnst0n
markj0hnst0n approved these changes Apr 24, 2025
@depsiatwal depsiatwal merged commit b8e436f into dev Apr 25, 2025
12 checks passed
@depsiatwal depsiatwal deleted the LTD-6168-drop-customisation-text branch April 25, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants