This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Flask jQuery UI Bootstrap minimalistic fork of Flask-Bootsrap extension

Project Description

Flask jQuery Ui Bootstrap

Flask-JqueryUiBootstrap is minimalistic fork of Flask-Bootstrap project. This project packages Twitter’s Bootstrap with jQuery UI and is based on jQuery UI Bootstrap project.

If you don’t need jQuery UI Bootstrap is strongly recommended to use better original plugin Flask-Bootstrap.

Usage

Here is an example:

from flask.ext.jqueryuibootstrap import Bootstrap

[...]

Bootstrap(app)

This makes base layout templates available: jqueryuibootstrap_base.html. This layout file have predefined blocks where you can put your content. The core block to alter is body_content, otherwise see the source of the template for more possibilities.

Macros

A few macros are available to make your life easier. These need to be imported (I recommend create your own base.html template that extends one of the bootstrap base templates first and including the the macros there).

An example base.html:

{% extends "jqueryuibootstrap_base.html" %}
{% import "jqueryuibootstrap_wtf.html" as wtf %}

Forms

The jqueryuibootstrap_wtf template contains macros to help you output forms quickly. The most basic way is using them as an aid to create a form by hand:

<form class="form form-horizontal" method="post">
  {{ form.hidden_tag() }}
  {{ wtf.form_errors(form, "only") }}

  {{ wtf.horizontal_field(form.field1) }}
  {{ wtf.horizontal_field(form.field2) }}

  <div class="form-actions">
     <button name="action_save" type="submit" class="btn btn-primary">Save changes</button>
  </div>
</form>

However, often you just want to get a form done quickly and have no need for intense fine-tuning:

{{ wtf.quick_form(form) }}

Configuration options

There are a few configuration options used by the templates:

Option Default  
BOOTSTRAP_HTML5_SHIM True Include the default IE-fixes that are usually included when using bootstrap.
BOOTSTRAP_GOOGLE_ANALYTICS_ACCOUNT None If set, include Google Analytics boilerplate using this account.

Installation

Either install from github using pip or from PyPI.

A note on versifying

Flask-JqueryUiBootstrap tries to keep some track of jQuery UI Bootstrap releases. Versifying is usually in the form of x.y.z of jQuery UI Bootstrap version with .z micro version of Flask extension Package. For example, a version of 0.5.0.0 bundles version 0.5.0 of jQuery UI Bootstrap version and is initial release of Flask-JqueryUiBootstrap containing that version.

FAQ

  1. How can I add custom javascript to the template?

    Use Jinja2’s super() in conjunction with the bootstrap_js_bottom block. The super-function adds the contents of a block from the parent template, that way you can even decide if you want to include it before or after jQuery/bootstrap. Example:

    {% block bootstrap_js_bottom %}
      {{super()}}
      <script src="my_app_code.js">
    {% endblock %}
    

Contribute

  1. We are open for any help.
  2. Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).
  3. Write a test which shows that the bug was fixed or that the feature works as expected.
  4. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS.

History

0.5.0.3 (2013-09-15)

  • Important API change Bootstrap to JqueryUiBootstrap (Flask-Bootstrap no conflict)

0.5.0.1 (2013-08-26)

  • Initial version
Release History

Release History

This version
History Node

0.5.0.4

History Node

0.5.0.3

History Node

0.5.0.2

History Node

0.5.0.1

History Node

0.5.0.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Flask-JqueryUiBootstrap-0.5.0.4.tar.gz (375.2 kB) Copy SHA256 Checksum SHA256 Source Sep 15, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting