class JobExperianceBlock(StructBlock):
    company_name = CharBlock()
    job_title = CharBlock()
    location = CharBlock()
    start_date = DateBlock(
        help_text="The date you started working at this location")
    current = BooleanBlock(
        required=False,
        help_text="Select if you are currently still working at this location",
    )
    end_date = DateBlock(
        required=False, help_text="The date you quit working at this location")
    job_discription = RichTextBlock()

    class Meta:
        form_classname = "job-experiance-list"
        icon = "fa-briefcase"
class EducationBlock(StructBlock):
    degree = CharBlock()
    school_name = CharBlock()
    location = CharBlock()
    start_date = DateBlock(
        help_text="The date you started attending this school")
    current = BooleanBlock(
        required=False,
        help_text="Select if you are currently still attending this school",
    )
    end_date = DateBlock(required=False,
                         help_text="The date you graduated from this school")
    major = CharBlock(help_text="The focus of your degree")

    class Meta:
        form_classname = "education-list"
        icon = "fa-graduation-cap"
Exemple #3
0
class PersonDateBlock(StructBlock):
    date = DateBlock(required=False)
    people = StreamBlock([
        ('person', SnippetChooserBlock('page.People')),
    ])

    panels = [
        # Use a SnippetChooserPanel because blog.BlogAuthor is registered as a snippet
        SnippetChooserPanel("people"),
    ]
Exemple #4
0
class BasicPage(Page):
    body = StreamField([
        ('heading', blocks.CharBlock(classname="full title")),
        ('paragraph', blocks.RichTextBlock()),
        ('image', ImageChooserBlock()),
        ('table', TableBlock()),
        ('BlockQuoteBlock', BlockQuoteBlock()),
        ('URLBlock', URLBlock()),
        ('EmailBlock', EmailBlock()),
        ('DateBlock', DateBlock()),
        ('TimeBlock', TimeBlock()),
        ('DateTimeBlock', DateBlock()),
        ('PageChooserBlock', PageChooserBlock()),
        ('DocumentChooserBlock', DocumentChooserBlock()),
        ('IframeBlock', TextBlock()),
        ('EmbedBlock', EmbedBlock()),
        ('form', WagtailFormBlock()),
        ('show_business_hours',
         BooleanBlock(
             required=False,
             help_text="If checked, the library hours will display on the page",
             template='basic_page/blocks/business_hours.html',
             icon='user')),
        ('show_next_closure',
         BooleanBlock(
             required=False,
             help_text="If checked, the next library closure will display",
             template='basic_page/blocks/next_closure.html',
             icon='user')),
        ('show_all_closures',
         BooleanBlock(
             required=False,
             help_text=
             "If checked, all upcoming library closures will be shown",
             template='basic_page/blocks/all_closures.html',
             icon='user')),
        ('map',
         blocks.StructBlock([
             ('address', GeoAddressBlock(required=True)),
             ('map', GeoBlock(address_field='address')),
         ],
                            template='basic_page/blocks/map.html',
                            icon='user')),
        ('bookClub',
         blocks.StructBlock(
             [('book_club_name', blocks.CharBlock()),
              ('book_club_day_of_the_week', blocks.TextBlock()),
              ('book_club_PDF', DocumentChooserBlock(required=False)),
              ('book_club_time', blocks.TimeBlock()),
              ('books',
               blocks.StreamBlock([
                   (
                       'book',
                       blocks.StructBlock(
                           [
                               ('book_name', blocks.CharBlock()),
                               ('author_name', blocks.CharBlock()),
                               ('reading_date', blocks.DateBlock()),
                               ('book_description', blocks.RichTextBlock()),
                               ('book_cover',
                                ImageChooserBlock(required=False)),
                           ],
                           template='basic_page/blocks/books.html'),
                   ),
               ]))],
             template='basic_page/blocks/book_club.html',
             icon='openquote')),
        ('panel',
         blocks.StructBlock([
             ('panel_name', blocks.CharBlock()),
             ('show_by_default',
              blocks.BooleanBlock(
                  required=False,
                  help_text="Display Panel as open by default")),
             ('panel_body',
              blocks.StreamBlock([
                  (
                      'panel_items',
                      blocks.StructBlock([
                          ('panel_item_title', blocks.CharBlock()),
                          ('panel_link',
                           URLBlock(
                               required=False,
                               help_text="Use this for images you wish to link"
                           )),
                          ('panel_image',
                           ImageChooserBlock(
                               required=False,
                               help_text="Use this for images you wish to link"
                           )),
                          ('panel_description', blocks.RichTextBlock()),
                      ],
                                         template=
                                         'basic_page/blocks/panel_items.html'),
                  ),
              ]))
         ],
                            template='basic_page/blocks/panel.html',
                            icon='collapse-down')),
    ],
                       blank=True)

    def get_context(self, request):
        data = super(BasicPage, self).get_context(request)
        return data

    content_panels = Page.content_panels + [
        StreamFieldPanel('body'),
    ]

    # Search index configuration
    search_fields = Page.search_fields + [
        index.SearchField('body'),
    ]