__init__.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. """
  2. Blocks module entry point. Used to cleanly organize blocks into
  3. individual files based on purpose, but provide them all as a
  4. single `blocks` module.
  5. """
  6. from django.utils.translation import ugettext_lazy as _
  7. from .base_blocks import * #noqa
  8. from .html_blocks import * #noqa
  9. from .metadata_blocks import * #noqa
  10. from .content_blocks import * #noqa
  11. from .layout_blocks import * #noqa
  12. # Collections of blocks commonly used together.
  13. HTML_STREAMBLOCKS = [
  14. ('text', RichTextBlock(icon='fa-file-text-o')),
  15. ('button', ButtonBlock()),
  16. ('image', ImageBlock()),
  17. ('image_link', ImageLinkBlock()),
  18. ('html', blocks.RawHTMLBlock(icon='code', classname='monospace', label=_('HTML'))),
  19. ('download', DownloadBlock()),
  20. ('embed_video', EmbedVideoBlock()),
  21. ('quote', QuoteBlock()),
  22. ('table', TableBlock()),
  23. ('google_map', EmbedGoogleMapBlock()),
  24. ('page_list', PageListBlock()),
  25. ('page_preview', PagePreviewBlock()),
  26. ]
  27. CONTENT_STREAMBLOCKS = HTML_STREAMBLOCKS + [
  28. ('card', CardBlock()),
  29. ('carousel', CarouselBlock()),
  30. ('image_gallery', ImageGalleryBlock()),
  31. ('modal', ModalBlock(HTML_STREAMBLOCKS)),
  32. ('pricelist', PriceListBlock()),
  33. ('reusable_content', ReusableContentBlock()),
  34. ]
  35. NAVIGATION_STREAMBLOCKS = [
  36. ('page_link', NavPageLinkWithSubLinkBlock()),
  37. ('external_link', NavExternalLinkWithSubLinkBlock()),
  38. ('document_link', NavDocumentLinkWithSubLinkBlock()),
  39. ]
  40. BASIC_LAYOUT_STREAMBLOCKS = [
  41. ('row', GridBlock(HTML_STREAMBLOCKS)),
  42. ('html', blocks.RawHTMLBlock(icon='code', classname='monospace', label=_('HTML'))),
  43. ]
  44. LAYOUT_STREAMBLOCKS = [
  45. ('hero', HeroBlock([
  46. ('row', GridBlock(CONTENT_STREAMBLOCKS)),
  47. ('cardgrid', CardGridBlock([
  48. ('card', CardBlock()),])
  49. ),
  50. ('html', blocks.RawHTMLBlock(icon='code', classname='monospace', label=_('HTML'))),])
  51. ),
  52. ('row', GridBlock(CONTENT_STREAMBLOCKS)),
  53. ('cardgrid', CardGridBlock([
  54. ('card', CardBlock()),])
  55. ),
  56. ('html', blocks.RawHTMLBlock(icon='code', classname='monospace', label=_('HTML'))),
  57. ]