Skip to main content

Bootstrap 3 Button element for FeinCMS

Project description

https://img.shields.io/pypi/v/feincms-button.svg https://img.shields.io/pypi/dm/feincms-button.svg https://img.shields.io/github/license/bashu/feincms-button.svg https://app.travis-ci.com/bashu/feincms-button.svg?branch=develop

Displaying a Bootstrap 3 Button in text.

This button can be used for navigation, for example at the end of a text block. These buttons can’t be used in forms.

Installation

First make sure the project is configured for feincms.

Then add the following settings:

INSTALLED_APPS += (
    'feincms_button',
)

Now, you can create ButtonContent content type:

from feincms.module.page.models import Page
from feincms_button.contents import ButtonContent

Page.create_content_type(ButtonContent)

Frontend styling

The button is rendered with the HTML that Bootstrap prescribes:

<a class="btn btn-default" href="#" role="button">Link</a>

The standard Bootstrap 3 CSS will provide a reasonable styling for this, which can either be overwritten, or replaced in your own CSS files. The defaults provided by Bootstap 3 is: https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/bootstrap/_buttons.scss

When you use Sass, you can also override the Sass variables.

Configuration

When desired, the following settings can be overwritten:

from django.utils.translation import pgettext_lazy

FEINCMS_BUTTON_STYLES = (
    ('btn-default', pgettext_lazy("button-style", u"Default")),
    ('btn-primary', pgettext_lazy("button-style", u"Primary")),
    ('btn-success', pgettext_lazy("button-style", u"Success")),
    ('btn-info', pgettext_lazy("button-style", u"Info")),
    ('btn-warning', pgettext_lazy("button-style", u"Warning")),
    ('btn-danger', pgettext_lazy("button-style", u"Danger")),
    ('btn-link', pgettext_lazy("button-style", u"Link")),
)

FEINCMS_BUTTON_SIZES = (
    ('', pgettext_lazy("button-size", u"Default")),
    ('btn-lg', pgettext_lazy("button-size", u"Large")),
    ('btn-sm', pgettext_lazy("button-size", u"Small")),
    ('btn-xs', pgettext_lazy("button-size", u"Extra Small")),
)

By default, the standard Bootstrap button classes are used. These can be redefined when the project uses other classes for the buttons.

Contributing

If you like this module, forked it, or would like to improve it, please let us know! Pull requests are welcome too. :-)

Changes

2.0.1 (2021-11-28)

  • Added ru translation.

2.0.0 (2021-11-27)

  • Added Django 3+ support.

  • Dropped Python 2.7 support.

  • Dropped Django 1.10 / 1.11 support.

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

feincms-button-2.0.1.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

feincms_button-2.0.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file feincms-button-2.0.1.tar.gz.

File metadata

  • Download URL: feincms-button-2.0.1.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for feincms-button-2.0.1.tar.gz
Algorithm Hash digest
SHA256 e9ef9aeffc3de103aef5ee510da0739dc1b259bb006d43b7acb4a722b61f7ca0
MD5 6f2c2b95908f7a03c453f289a9a315f5
BLAKE2b-256 bc210210fa875c58e725cda5f52f229a2dd6b96315bedb55b8dcc68eff6c17c1

See more details on using hashes here.

File details

Details for the file feincms_button-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: feincms_button-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for feincms_button-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7208236e15fdf847a5c11ff8fb561fd43708fa360ea827826bb126e146acd124
MD5 4eaa3f199ef949cae8f6bfb7792d3d68
BLAKE2b-256 347efabf2815548363434aa70a892a6e9b2684f687864cdabfd3fd2c50e96df3

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