wagtail-tw-blocks 0.2.2__py3-none-any.whl → 0.2.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
wagtail_blocks/blocks.py CHANGED
@@ -4,7 +4,7 @@ from django.conf import settings
4
4
  from django.utils.translation import gettext_lazy as _
5
5
  from wagtail import blocks
6
6
  from wagtail.embeds.blocks import EmbedBlock
7
- from wagtail.images.blocks import ImageBlock
7
+ from wagtail.images.blocks import ImageBlock as WImageBlock
8
8
 
9
9
  from wagtail_blocks import (
10
10
  ACCORDION_STYLES,
@@ -41,6 +41,31 @@ SHOW_WINDOW_CONTROLS = getattr(
41
41
  )
42
42
 
43
43
 
44
+ class ImageBlock(blocks.StructBlock):
45
+ """Image block with caption"""
46
+
47
+ image = WImageBlock(
48
+ required=True,
49
+ help_text=_("Image"),
50
+ )
51
+ caption = blocks.CharBlock(
52
+ max_length=128,
53
+ required=False,
54
+ help_text=_("Image caption"),
55
+ )
56
+ attribution = blocks.CharBlock(
57
+ max_length=128,
58
+ required=False,
59
+ help_text=_("Image attribution"),
60
+ )
61
+
62
+ class Meta:
63
+ """Meta data"""
64
+
65
+ icon = "image"
66
+ template = "wagtail_blocks/blocks/image.html"
67
+
68
+
44
69
  class ButtonBlock(blocks.StructBlock):
45
70
  """Action block (link)"""
46
71
 
@@ -0,0 +1,19 @@
1
+ {% load wagtailimages_tags %}
2
+
3
+ <figure>
4
+ {% image self.image fill-1920x1080 loading="lazy" %}
5
+
6
+ <!---->
7
+ {% if self.caption %}
8
+ <figcaption class="text-xs md:text-sm xl:text-base">
9
+ {{ self.caption }}
10
+
11
+ <!---->
12
+ {% if self.attribution %}
13
+ <!---->
14
+ - {{ self.attribution }}
15
+ <!---->
16
+ {% endif %}
17
+ </figcaption>
18
+ {% endif %}
19
+ </figure>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wagtail-tw-blocks
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: A collection of reusable, production-ready content blocks for Wagtail CMS, styled with Tailwind CSS and daisyUI.
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -51,6 +51,10 @@ Description-Content-Type: text/markdown
51
51
  - **Tabs:** Tabbed content sections.
52
52
  - **Timeline:** Chronological event listings.
53
53
  - **Toast:** Temporary notification messages.
54
+ - **Image:** Responsive images with optional captions.
55
+ - **Browser Mockup:** Browser window frame for screenshots or web content.
56
+ - **Phone Mockup:** Mobile phone frame for app screenshots or mobile content.
57
+ - **Window Mockup:** Desktop window frame for application screenshots or desktop content.
54
58
 
55
59
  ---
56
60
 
@@ -1,6 +1,6 @@
1
1
  wagtail_blocks/__init__.py,sha256=qGVWunorLY4__p9PZq4GO5tH3b2V0pm_Jevp17yMA00,1457
2
2
  wagtail_blocks/apps.py,sha256=tOZ8btDhg8nCbNbbjTr6N4MQUEuC600is3PN-ufHJcU,300
3
- wagtail_blocks/blocks.py,sha256=_OcBl7snSmG1OjI4RYTWcA0pcusxoCg_cxMtMFTDmvY,15720
3
+ wagtail_blocks/blocks.py,sha256=BDn76Ji3L9faY4QciaTvsLHvYy4i9vFZepj6ayDENwY,16270
4
4
  wagtail_blocks/static/wagtail_blocks/.prettierrc,sha256=GyU5YqXRkB3eeDxAGhpB3jYr_WU3MHW4p60vg_HmoUU,90
5
5
  wagtail_blocks/static/wagtail_blocks/README.md,sha256=8gnnrxo9Ex_Tsn_XqiO-S04CW9uMP5uFc_XWfem72h4,427
6
6
  wagtail_blocks/static/wagtail_blocks/css/app.css,sha256=Y0GHo4GTmQsQookSvtzn9FJSbcfVz96CFPcMA4LtL6I,77
@@ -16,6 +16,7 @@ wagtail_blocks/templates/wagtail_blocks/blocks/code_mockup.html,sha256=ffl7vWFkR
16
16
  wagtail_blocks/templates/wagtail_blocks/blocks/diff.html,sha256=Z1QuQIEbS-D86Uvv2y607C0i_V3k6FYQAkJEx7a5zt8,419
17
17
  wagtail_blocks/templates/wagtail_blocks/blocks/fab.html,sha256=Brr-te1a99Lumj8yeNInaDGlX6XlNqE9p3Jn--hKsvk,1487
18
18
  wagtail_blocks/templates/wagtail_blocks/blocks/hover_gallery.html,sha256=ce0IgV_ZDmCkYSM6N3Du6-2ikP6TZYo6seGWpF9myWQ,369
19
+ wagtail_blocks/templates/wagtail_blocks/blocks/image.html,sha256=7U3rz55K2Fy49uMajOfHswB6NFdaETo7dEEo-BoQUck,360
19
20
  wagtail_blocks/templates/wagtail_blocks/blocks/list.html,sha256=MnOJ7JY4dKTe6jeUZHD7xbLKmP_xgGy9fLxlOkVce1Q,1660
20
21
  wagtail_blocks/templates/wagtail_blocks/blocks/phone.html,sha256=GweHnQUd_XSUztxXXb09XfvZREc8Ro6824pMusQtSr0,292
21
22
  wagtail_blocks/templates/wagtail_blocks/blocks/steps.html,sha256=tsyT1vQU0YM5tAoy0TRpqVnU4GReXxio10h6970Dh4o,406
@@ -23,7 +24,7 @@ wagtail_blocks/templates/wagtail_blocks/blocks/tabs.html,sha256=e2NoRWPcNXewGsN2
23
24
  wagtail_blocks/templates/wagtail_blocks/blocks/timeline.html,sha256=EcL0L6H1UZlMk0emMucNeLCPpkkhKBzQqFf0do2m9MM,853
24
25
  wagtail_blocks/templates/wagtail_blocks/blocks/toast.html,sha256=sE6bdgwgg15G-5qUsaA2T0ixfRcK5_bCzbfqKc0-WyU,192
25
26
  wagtail_blocks/templates/wagtail_blocks/blocks/window.html,sha256=sw6GqkU32J9pOZ5WQsLubSBicZBnjxNDKPK2Drx7aBQ,244
26
- wagtail_tw_blocks-0.2.2.dist-info/METADATA,sha256=bIkeDUAKQjB40x7Qn_DfndNVRsqdLqVBCvX095L3lZo,8900
27
- wagtail_tw_blocks-0.2.2.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
28
- wagtail_tw_blocks-0.2.2.dist-info/licenses/LICENSE,sha256=RkaGOqhDfc5U9-5mc3OHBMOo1VW7UOb8JQ614C0kqm4,1074
29
- wagtail_tw_blocks-0.2.2.dist-info/RECORD,,
27
+ wagtail_tw_blocks-0.2.3.dist-info/METADATA,sha256=wPPVhDdMKXh1voCyUUSZGm_pPAWkmhZwZKMgY_r8jKI,9198
28
+ wagtail_tw_blocks-0.2.3.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
29
+ wagtail_tw_blocks-0.2.3.dist-info/licenses/LICENSE,sha256=RkaGOqhDfc5U9-5mc3OHBMOo1VW7UOb8JQ614C0kqm4,1074
30
+ wagtail_tw_blocks-0.2.3.dist-info/RECORD,,