Skip to main content

HTML utils app for django.

Project description

django-html-utils app

HTML utils app for django.

Linting & Tests pypi Version

Included versions

Usage

Basics

Load with {% load django_html_utils %} and include CSS/JS with:

<head>
  {% django_html_utils_css %}
  {% django_html_utils_js %}
</head>

Font-Awesome

To add a Font-Awesome icon use {% fa "icon-name" %}. Additional options are tag, for the tag to use, defaults to span and icon_type, for the icon type, defaults to solid.

For example:

{% fa "upload" %}

resolves to:

<span class="fa-solid fa-upload"></span>

iFrame modal

Simple modal with an iFrame, designed for usage with forms.

Add modal with {% iframe_form_modal %}, with options:

  • iframe_min_height: set minimum height of iframe, defaults to None
  • iframe_max_height: set maximum height of iframe, defaults to None
  • iframe_options: set additional iframe options, defaults to None
  • static_backdrop: if the backdrop of the model should be static, defaults to True
  • submit_button_text: the text of the submit button, when None no text will be displayed, defaults to None
  • fa_icon_name: the Font-Awesome icon name on the submit button
  • fa_tag: the Font-Awesome tag to use, defaults to span
  • fa_icon_type: the icon type, defaults to solid

Open link with:

<a href="{% url SOME_FORM %}" title="{% trans "Modal title" %}" data-bs-toggle="modal" data-bs-target="#iframeFormModal">open modal form</a>

The URL will be loaded in the iFrame and the title will be set as the modal title.

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

django_html_utils-0.2.12.tar.gz (745.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_html_utils-0.2.12-py3-none-any.whl (795.4 kB view details)

Uploaded Python 3

File details

Details for the file django_html_utils-0.2.12.tar.gz.

File metadata

  • Download URL: django_html_utils-0.2.12.tar.gz
  • Upload date:
  • Size: 745.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for django_html_utils-0.2.12.tar.gz
Algorithm Hash digest
SHA256 750eea2208b8977137cd9b6b14613acca23ca17ec8aa3be7ca0dc6c68228b0ff
MD5 2b345a5c14b567cff13fba4fc99c85f8
BLAKE2b-256 ef64dfbf9744d99bd41b245f9271a0c49e7f62d26c4b641fbe7ab85dd3c056e4

See more details on using hashes here.

File details

Details for the file django_html_utils-0.2.12-py3-none-any.whl.

File metadata

File hashes

Hashes for django_html_utils-0.2.12-py3-none-any.whl
Algorithm Hash digest
SHA256 885561ed99a553ddb24982aca9df49e4c581c64d1dbf94410e333b23457ac788
MD5 c067633d2e05ef9d9d44637b0af67549
BLAKE2b-256 e2a0e6cc74accafcc36ef7c2fc61ba6506e64f5a2e886ed21cf672c673fef8a0

See more details on using hashes here.

Supported by

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