Skip to main content

An application made for the Django Web Framework.

Project description

wagtail_panels

A collection of useful panels to be used for your Wagtail snippets.

Features:

  • Buttons
    • Download a file by providing the attribute name
    • Any callback which takes an instance ID and a request to return a URL.
    • Any URL.
  • Reading time panel

Quick start

  1. Add 'wagtail_panels' to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
    ...,
    'wagtail_panels',
    ]
    

Example of buttons

from wagtail_panels.panels import DownloadButton, AnchorTag, ButtonPanel

...

class MySnippet(models.Model):
      file = models.FileField(upload_to="files")

      panels = [
         ButtonPanel([
             DownloadButton(
                 _("Download File"),
                 "file",
                 classname="button",
             ),
             AnchorTag(
                 _("Recover"),
                 lambda request, instance: \
                     reverse_lazy("my_view", kwargs={"pk": instance.pk}),
                 classname="button no",
                 HIDE_ON_CREATE=True,
             )
         ]),
      ]

Example of reading time panel

from wagtail_panels.models import (
    PageReadingTimeMixin,
)
from wagtail_panels.panels import (
    ReadingTimePanel,
)


class MyPage(PageReadingTimeMixin, Page):
    content_panels = Page.content_panels + [
        ReadingTimePanel(),
    ]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wagtail_panels-1.0.1.tar.gz (19.7 kB view details)

Uploaded Source

File details

Details for the file wagtail_panels-1.0.1.tar.gz.

File metadata

  • Download URL: wagtail_panels-1.0.1.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for wagtail_panels-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5a58d8e3fe4ac3cb8b91623f2211698cc155b44870f532792aa77c6aecbde4fa
MD5 9348474fcd8d23a55c450cb93257cafc
BLAKE2b-256 d35fef821eac001bdbaf4f986ff8ecdd0f4d782249d8a9ddb7875614ad5b898d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page