コード例 #1
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.helper = FormHelper()
     self.helper.layout = Layout(
         Accordion(
             AccordionSection(
                 "Writing well for the web",
                 HTML.p(
                     "This is the content for Writing well for the web."),
                 summary="An introduction to clear and concise writing.",
             ),
             AccordionSection(
                 "Writing well for specialists",
                 HTML.
                 p("This is the content for Writing well for specialists."),
             ),
             AccordionSection(
                 "Know your audience",
                 HTML.p("This is the content for Know your audience."),
             ),
             AccordionSection(
                 "How people read",
                 HTML.p("This is the content for How people read."),
             ),
         ))
コード例 #2
0
 def valid_layout(self):
     file = self.cleaned_data["file"]
     self.helper.layout = Layout(
         HTML.h2("You uploaded..."),
         HTML.p("File: %s" % file),
         HTML('<a class="govuk-button" href="%s">Continue</a>' %
              reverse("components:name", kwargs={"name": "file-upload"})),
     )
コード例 #3
0
ファイル: textarea.py プロジェクト: wildfish/crispy-forms-gds
 def valid_layout(self):
     value = self.cleaned_data["description"]
     self.helper.layout = Layout(
         Hidden("description", value),
         HTML.h2("You answered..."),
         HTML.p(value),
         Button("continue", "Continue"),
     )
コード例 #4
0
 def valid_layout(self):
     message = 'You clicked the "%s" button.' % self.get_button()
     self.helper.layout = Layout(HTML.p(message),
                                 Button("continue", "Continue"))