wagtail-tw-blocks 0.2.2__py3-none-any.whl → 0.2.4__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 +34 -9
- wagtail_blocks/templates/wagtail_blocks/blocks/image.html +19 -0
- {wagtail_tw_blocks-0.2.2.dist-info → wagtail_tw_blocks-0.2.4.dist-info}/METADATA +5 -1
- {wagtail_tw_blocks-0.2.2.dist-info → wagtail_tw_blocks-0.2.4.dist-info}/RECORD +6 -5
- {wagtail_tw_blocks-0.2.2.dist-info → wagtail_tw_blocks-0.2.4.dist-info}/WHEEL +0 -0
- {wagtail_tw_blocks-0.2.2.dist-info → wagtail_tw_blocks-0.2.4.dist-info}/licenses/LICENSE +0 -0
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
|
|
|
@@ -178,7 +203,7 @@ class AlertBlock(blocks.StructBlock):
|
|
|
178
203
|
class CarouselItem(blocks.StructBlock):
|
|
179
204
|
"""Carousel Items"""
|
|
180
205
|
|
|
181
|
-
image =
|
|
206
|
+
image = WImageBlock(
|
|
182
207
|
required=False,
|
|
183
208
|
help_text=_("Image"),
|
|
184
209
|
)
|
|
@@ -259,11 +284,11 @@ class CodeBlock(blocks.StructBlock):
|
|
|
259
284
|
class DiffBlock(blocks.StructBlock):
|
|
260
285
|
"""Diff component shows a side-by-side comparison of two items."""
|
|
261
286
|
|
|
262
|
-
item_1 =
|
|
287
|
+
item_1 = WImageBlock(
|
|
263
288
|
required=True,
|
|
264
289
|
help_text=_("Diff Item 1"),
|
|
265
290
|
)
|
|
266
|
-
item_2 =
|
|
291
|
+
item_2 = WImageBlock(
|
|
267
292
|
required=True,
|
|
268
293
|
help_text=_("Diff Item 2"),
|
|
269
294
|
)
|
|
@@ -312,7 +337,7 @@ class FABBlock(blocks.StructBlock):
|
|
|
312
337
|
class HoverGalleryItem(blocks.StructBlock):
|
|
313
338
|
"""Hover gallery items"""
|
|
314
339
|
|
|
315
|
-
image =
|
|
340
|
+
image = WImageBlock(
|
|
316
341
|
required=True,
|
|
317
342
|
help_text=_("Image"),
|
|
318
343
|
)
|
|
@@ -514,7 +539,7 @@ class ToastBlock(blocks.StructBlock):
|
|
|
514
539
|
class ListItem(blocks.StructBlock):
|
|
515
540
|
"""List item"""
|
|
516
541
|
|
|
517
|
-
image =
|
|
542
|
+
image = WImageBlock(
|
|
518
543
|
required=False,
|
|
519
544
|
help_text=_("Item image"),
|
|
520
545
|
)
|
|
@@ -572,7 +597,7 @@ class PhoneMockupBlock(blocks.StructBlock):
|
|
|
572
597
|
required=False,
|
|
573
598
|
help_text=_("Wether to show or hide camera"),
|
|
574
599
|
)
|
|
575
|
-
wallpaper =
|
|
600
|
+
wallpaper = WImageBlock(
|
|
576
601
|
required=True,
|
|
577
602
|
help_text=_("Phone wallpaper"),
|
|
578
603
|
)
|
|
@@ -596,7 +621,7 @@ class BrowserMockupBlock(blocks.StructBlock):
|
|
|
596
621
|
required=True,
|
|
597
622
|
help_text=_("Browser URL"),
|
|
598
623
|
)
|
|
599
|
-
wallpaper =
|
|
624
|
+
wallpaper = WImageBlock(
|
|
600
625
|
required=True,
|
|
601
626
|
help_text=_("Browser wallpaper"),
|
|
602
627
|
)
|
|
@@ -611,7 +636,7 @@ class BrowserMockupBlock(blocks.StructBlock):
|
|
|
611
636
|
class WindowMockupBlock(blocks.StructBlock):
|
|
612
637
|
"""Window mockup shows a box that looks like an operating system window."""
|
|
613
638
|
|
|
614
|
-
wallpaper =
|
|
639
|
+
wallpaper = WImageBlock(
|
|
615
640
|
required=True,
|
|
616
641
|
help_text=_("Window wallpaper"),
|
|
617
642
|
)
|
|
@@ -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.
|
|
3
|
+
Version: 0.2.4
|
|
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=
|
|
3
|
+
wagtail_blocks/blocks.py,sha256=IMF3UWeP1kgbHqHp0dZLFyUT5pocNLXVean1Oe73hHo,16278
|
|
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.
|
|
27
|
-
wagtail_tw_blocks-0.2.
|
|
28
|
-
wagtail_tw_blocks-0.2.
|
|
29
|
-
wagtail_tw_blocks-0.2.
|
|
27
|
+
wagtail_tw_blocks-0.2.4.dist-info/METADATA,sha256=5p3A8hUL28cGNVth8OTInv458lCTn7eEY3cqE7oEgT4,9198
|
|
28
|
+
wagtail_tw_blocks-0.2.4.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
29
|
+
wagtail_tw_blocks-0.2.4.dist-info/licenses/LICENSE,sha256=RkaGOqhDfc5U9-5mc3OHBMOo1VW7UOb8JQ614C0kqm4,1074
|
|
30
|
+
wagtail_tw_blocks-0.2.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|