├── tests ├── __init__.py ├── test_bootstrap4 │ ├── __init__.py │ ├── test_render_static.py │ ├── conftest.py │ ├── test_render_nav_item.py │ ├── test_render_breadcrumb_item.py │ ├── test_render_hidden_errors.py │ ├── test_render_pager.py │ ├── test_render_pagination.py │ ├── test_themes.py │ ├── test_render_form_row.py │ ├── test_render_messages.py │ └── test_render_field.py ├── test_bootstrap5 │ ├── __init__.py │ ├── conftest.py │ ├── test_render_messages.py │ ├── test_render_form_row.py │ ├── test_integrity.py │ ├── test_pagination.py │ ├── test_themes.py │ └── test_render_nav_item.py └── conftest.py ├── requirements ├── style.in ├── build.in ├── docs.in ├── dev.in ├── tests.in ├── style.txt ├── build.txt ├── dev.txt ├── tests.txt └── docs.txt ├── codecov.yml ├── docs ├── changelog.rst ├── examples.rst ├── _static │ ├── css │ │ └── custom.css │ ├── form-example.png │ ├── bootstrap-flask.png │ ├── error-form-example.png │ ├── bootstrap-flask-logo.png │ └── bootstrap-flask-favicon.png ├── _themes │ ├── flask │ │ ├── theme.conf │ │ ├── relations.html │ │ └── layout.html │ ├── flask_small │ │ ├── theme.conf │ │ └── layout.html │ ├── README │ └── LICENSE ├── api.rst ├── Makefile ├── make.bat ├── _templates │ └── sidebarintro.html └── index.rst ├── flask_bootstrap ├── templates │ ├── bootstrap4 │ │ ├── table.html │ │ ├── pagination.html │ │ ├── nav.html │ │ └── utils.html │ ├── bootstrap5 │ │ ├── table.html │ │ ├── pagination.html │ │ ├── nav.html │ │ └── utils.html │ ├── bootstrap │ │ ├── form.html │ │ ├── nav.html │ │ ├── table.html │ │ ├── utils.html │ │ └── pagination.html │ └── base │ │ ├── nav.html │ │ └── utils.html └── static │ ├── bootstrap4 │ └── css │ │ ├── font │ │ └── fonts │ │ │ ├── bootstrap-icons.woff │ │ │ └── bootstrap-icons.woff2 │ │ └── bootswatch │ │ ├── united │ │ ├── _bootswatch.scss │ │ └── _variables.scss │ │ ├── cosmo │ │ ├── _bootswatch.scss │ │ └── _variables.scss │ │ ├── journal │ │ ├── _bootswatch.scss │ │ └── _variables.scss │ │ ├── cerulean │ │ ├── _variables.scss │ │ └── _bootswatch.scss │ │ ├── spacelab │ │ ├── _variables.scss │ │ └── _bootswatch.scss │ │ ├── lumen │ │ └── _variables.scss │ │ ├── pulse │ │ ├── _variables.scss │ │ └── _bootswatch.scss │ │ ├── litera │ │ └── _variables.scss │ │ ├── simplex │ │ ├── _bootswatch.scss │ │ └── _variables.scss │ │ ├── minty │ │ └── _variables.scss │ │ ├── yeti │ │ └── _variables.scss │ │ ├── lux │ │ ├── _variables.scss │ │ └── _bootswatch.scss │ │ └── flatly │ │ └── _variables.scss │ └── bootstrap5 │ └── css │ ├── font │ └── fonts │ │ ├── bootstrap-icons.woff │ │ └── bootstrap-icons.woff2 │ └── bootswatch │ ├── united │ ├── _bootswatch.scss │ └── _variables.scss │ ├── cosmo │ ├── _bootswatch.scss │ └── _variables.scss │ ├── journal │ ├── _bootswatch.scss │ └── _variables.scss │ ├── solar │ └── _bootswatch.scss │ ├── flatly │ └── _bootswatch.scss │ ├── darkly │ └── _bootswatch.scss │ ├── litera │ ├── _bootswatch.scss │ └── _variables.scss │ ├── cerulean │ ├── _variables.scss │ └── _bootswatch.scss │ ├── spacelab │ ├── _variables.scss │ └── _bootswatch.scss │ ├── minty │ ├── _bootswatch.scss │ └── _variables.scss │ ├── pulse │ ├── _variables.scss │ └── _bootswatch.scss │ ├── cyborg │ └── _bootswatch.scss │ ├── simplex │ ├── _bootswatch.scss │ └── _variables.scss │ ├── superhero │ └── _bootswatch.scss │ ├── lumen │ └── _variables.scss │ ├── yeti │ └── _variables.scss │ ├── lux │ └── _variables.scss │ └── materia │ └── _variables.scss ├── examples ├── requirements.txt ├── bootstrap4 │ ├── static │ │ └── favicon.ico │ └── templates │ │ ├── bootswatch.html │ │ ├── flash.html │ │ ├── pagination.html │ │ ├── index.html │ │ ├── nav.html │ │ ├── icon.html │ │ ├── table.html │ │ └── base.html ├── bootstrap5 │ ├── static │ │ └── favicon.ico │ └── templates │ │ ├── bootswatch.html │ │ ├── flash.html │ │ ├── pagination.html │ │ ├── index.html │ │ ├── nav.html │ │ ├── icon.html │ │ ├── table.html │ │ └── base.html ├── list_bootswatch.py ├── README.rst └── update_icons.py ├── .flake8 ├── MANIFEST.in ├── .readthedocs.yml ├── tox.ini ├── .github ├── FUNDING.yml └── workflows │ ├── build.yml │ ├── release.yml │ └── master_bootstrap-flask-example.yml ├── pyproject.toml └── .gitignore /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /requirements/style.in: -------------------------------------------------------------------------------- 1 | flake8 2 | -------------------------------------------------------------------------------- /tests/test_bootstrap4/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test_bootstrap5/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: false 2 | 3 | -------------------------------------------------------------------------------- /requirements/build.in: -------------------------------------------------------------------------------- 1 | wheel 2 | build 3 | -------------------------------------------------------------------------------- /tests/test_bootstrap4/test_render_static.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/changelog.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../CHANGES.rst 2 | -------------------------------------------------------------------------------- /docs/examples.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../examples/README.rst 2 | -------------------------------------------------------------------------------- /docs/_static/css/custom.css: -------------------------------------------------------------------------------- 1 | img.logo { 2 | max-width: 90%; 3 | } 4 | -------------------------------------------------------------------------------- /flask_bootstrap/templates/bootstrap4/table.html: -------------------------------------------------------------------------------- 1 | {% extends 'base/table.html' %} 2 | -------------------------------------------------------------------------------- /flask_bootstrap/templates/bootstrap5/table.html: -------------------------------------------------------------------------------- 1 | {% extends 'base/table.html' %} 2 | -------------------------------------------------------------------------------- /requirements/docs.in: -------------------------------------------------------------------------------- 1 | sphinx 2 | pallets-sphinx-themes 3 | sphinxcontrib-log-cabinet 4 | -------------------------------------------------------------------------------- /examples/requirements.txt: -------------------------------------------------------------------------------- 1 | flask 2 | bootstrap-flask 3 | flask-sqlalchemy 4 | flask-wtf 5 | -------------------------------------------------------------------------------- /requirements/dev.in: -------------------------------------------------------------------------------- 1 | -r tests.in 2 | -r docs.in 3 | -r style.in 4 | pip-compile-multi 5 | tox 6 | -------------------------------------------------------------------------------- /requirements/tests.in: -------------------------------------------------------------------------------- 1 | pytest 2 | pytest-cov 3 | flask-wtf 4 | flask-sqlalchemy 5 | beautifulsoup4 6 | -------------------------------------------------------------------------------- /docs/_static/form-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloflask/bootstrap-flask/HEAD/docs/_static/form-example.png -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | exclude = static,.git,*migrations*,build,.tox,docs 3 | max-line-length = 119 4 | max-complexity = 7 5 | -------------------------------------------------------------------------------- /docs/_static/bootstrap-flask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloflask/bootstrap-flask/HEAD/docs/_static/bootstrap-flask.png -------------------------------------------------------------------------------- /docs/_static/error-form-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloflask/bootstrap-flask/HEAD/docs/_static/error-form-example.png -------------------------------------------------------------------------------- /docs/_static/bootstrap-flask-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloflask/bootstrap-flask/HEAD/docs/_static/bootstrap-flask-logo.png -------------------------------------------------------------------------------- /examples/bootstrap4/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloflask/bootstrap-flask/HEAD/examples/bootstrap4/static/favicon.ico -------------------------------------------------------------------------------- /examples/bootstrap5/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloflask/bootstrap-flask/HEAD/examples/bootstrap5/static/favicon.ico -------------------------------------------------------------------------------- /docs/_static/bootstrap-flask-favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloflask/bootstrap-flask/HEAD/docs/_static/bootstrap-flask-favicon.png -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | graft flask_bootstrap/static 2 | graft flask_bootstrap/templates 3 | include LICENSE 4 | include README.md 5 | global-exclude *.pyc 6 | global-exclude .DS_Store 7 | -------------------------------------------------------------------------------- /tests/test_bootstrap4/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from flask_bootstrap import Bootstrap4 3 | 4 | 5 | @pytest.fixture(autouse=True) 6 | def bootstrap(app): 7 | yield Bootstrap4(app) 8 | -------------------------------------------------------------------------------- /tests/test_bootstrap5/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from flask_bootstrap import Bootstrap5 3 | 4 | 5 | @pytest.fixture(autouse=True) 6 | def bootstrap(app): 7 | yield Bootstrap5(app) 8 | -------------------------------------------------------------------------------- /flask_bootstrap/static/bootstrap4/css/font/fonts/bootstrap-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloflask/bootstrap-flask/HEAD/flask_bootstrap/static/bootstrap4/css/font/fonts/bootstrap-icons.woff -------------------------------------------------------------------------------- /flask_bootstrap/static/bootstrap4/css/font/fonts/bootstrap-icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloflask/bootstrap-flask/HEAD/flask_bootstrap/static/bootstrap4/css/font/fonts/bootstrap-icons.woff2 -------------------------------------------------------------------------------- /flask_bootstrap/static/bootstrap5/css/font/fonts/bootstrap-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloflask/bootstrap-flask/HEAD/flask_bootstrap/static/bootstrap5/css/font/fonts/bootstrap-icons.woff -------------------------------------------------------------------------------- /flask_bootstrap/static/bootstrap5/css/font/fonts/bootstrap-icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloflask/bootstrap-flask/HEAD/flask_bootstrap/static/bootstrap5/css/font/fonts/bootstrap-icons.woff2 -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | python: 3 | install: 4 | - requirements: requirements/docs.txt 5 | - method: pip 6 | path: . 7 | sphinx: 8 | builder: dirhtml 9 | fail_on_warning: true 10 | -------------------------------------------------------------------------------- /examples/bootstrap4/templates/bootswatch.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% from 'bootstrap4/form.html' import render_form %} 3 | 4 | {% block content %} 5 |
{% raw %}{{ render_messages(container=False, dismissible=True) }}{% endraw %}
6 | {% endblock %}
7 |
--------------------------------------------------------------------------------
/examples/bootstrap5/templates/flash.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 |
3 | {% block content %}
4 | The messages above were rendered with the following code:
5 | {% raw %}{{ render_messages(container=False, dismissible=True) }}{% endraw %}
6 | {% endblock %}
7 |
--------------------------------------------------------------------------------
/flask_bootstrap/templates/bootstrap5/pagination.html:
--------------------------------------------------------------------------------
1 | {% extends 'base/pagination.html' %}
2 |
3 | {% macro get_current_page(page) %}
4 | {% raw %}{{ render_pager(pagination) }}{% endraw %}
12 | {{ render_pager(pagination) }}
13 |
14 | {% raw %}{{ render_pagination(pagination) }}{% endraw %}
16 | {{ render_pagination(pagination) }}
17 | {% endblock %}
18 |
--------------------------------------------------------------------------------
/examples/bootstrap5/templates/pagination.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% from 'bootstrap5/pagination.html' import render_pager, render_pagination %}
3 |
4 | {% block content %}
5 | {% raw %}{{ render_pager(pagination) }}{% endraw %}
12 | {{ render_pager(pagination) }}
13 |
14 | {% raw %}{{ render_pagination(pagination) }}{% endraw %}
16 | {{ render_pagination(pagination) }}
17 | {% endblock %}
18 |
--------------------------------------------------------------------------------
/flask_bootstrap/templates/bootstrap4/nav.html:
--------------------------------------------------------------------------------
1 | {% extends 'base/nav.html' %}
2 |
3 | {% macro render_nav_item(endpoint, text, _badge='', _use_li=False, _badge_classes='badge badge-light') %}
4 | {% set active = True if request.endpoint and request.endpoint == endpoint else False %}
5 | {% if _use_li %}This demo uses Bootstrap version 4.
6 |This demo uses Bootstrap version 5.
6 |
19 | {% endif %}
20 | {% endblock %}
21 | {% block sidebar1 %}{% endblock %}
22 | {% block sidebar2 %}{% endblock %}
23 |
--------------------------------------------------------------------------------
/docs/_themes/flask/layout.html:
--------------------------------------------------------------------------------
1 | {%- extends "basic/layout.html" %}
2 | {%- block extrahead %}
3 | {{ super() }}
4 | {% if theme_touch_icon %}
5 |
6 | {% endif %}
7 |
8 | {% endblock %}
9 | {%- block relbar2 %}{% endblock %}
10 | {% block header %}
11 | {{ super() }}
12 | {% if pagename == 'index' %}
13 | These are all the icons currently supported by Bootstrap-Flask.
27 |This is a total of {number} icons.
\n') 48 | file.write('{% endblock %}\n') 49 | print(f'For Bootstrap{version} {number} icons are supported.') 50 | 51 | 52 | for value in (4, 5): 53 | generate(value) 54 | -------------------------------------------------------------------------------- /flask_bootstrap/static/bootstrap4/css/bootswatch/spacelab/_variables.scss: -------------------------------------------------------------------------------- 1 | // Spacelab 4.6.1 2 | // Bootswatch 3 | 4 | // 5 | // Color system 6 | // 7 | 8 | $white: #fff !default; 9 | $gray-100: #f8f9fa !default; 10 | $gray-200: #eee !default; 11 | $gray-300: #dee2e6 !default; 12 | $gray-400: #ced4da !default; 13 | $gray-500: #999 !default; 14 | $gray-600: #777 !default; 15 | $gray-700: #495057 !default; 16 | $gray-800: #333 !default; 17 | $gray-900: #2d2d2d !default; 18 | $black: #000 !default; 19 | 20 | $blue: #446e9b !default; 21 | $indigo: #6610f2 !default; 22 | $purple: #6f42c1 !default; 23 | $pink: #e83e8c !default; 24 | $red: #cd0200 !default; 25 | $orange: #fd7e14 !default; 26 | $yellow: #d47500 !default; 27 | $green: #3cb521 !default; 28 | $teal: #20c997 !default; 29 | $cyan: #3399f3 !default; 30 | 31 | $primary: $blue !default; 32 | $secondary: $gray-500 !default; 33 | $success: $green !default; 34 | $info: $cyan !default; 35 | $warning: $yellow !default; 36 | $danger: $red !default; 37 | $light: $gray-200 !default; 38 | $dark: $gray-800 !default; 39 | 40 | $yiq-contrasted-threshold: 200 !default; 41 | 42 | // Body 43 | 44 | $body-color: $gray-600 !default; 45 | 46 | // Links 47 | 48 | $link-color: $info !default; 49 | 50 | // Fonts 51 | 52 | // stylelint-disable-next-line value-keyword-case 53 | $font-family-sans-serif: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default; 54 | $headings-color: $gray-900 !default; 55 | 56 | // Navbar 57 | 58 | $navbar-dark-color: rgba($white, .75) !default; 59 | $navbar-dark-hover-color: $white !default; 60 | $navbar-light-color: rgba($black, .4) !default; 61 | $navbar-light-hover-color: $info !default; 62 | $navbar-light-active-color: $info !default; 63 | -------------------------------------------------------------------------------- /examples/bootstrap4/templates/nav.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% from 'bootstrap4/nav.html' import render_nav_item, render_breadcrumb_item %} 3 | 4 | {% block content %} 5 |{% raw %}
7 | {{ render_nav_item('test_form', 'Form') }}
8 | {{ render_nav_item('test_nav', 'Nav') }}
9 | {{ render_nav_item('test_pagination', 'Pagination') }}
10 | {{ render_nav_item('test_static', 'Static') }}
11 | {{ render_nav_item('test_flash', 'Flash Messages') }}
12 | {% endraw %}
13 | {% raw %}
30 | {{ render_breadcrumb_item('test_form', 'Form') }}
31 | {{ render_breadcrumb_item('test_nav', 'Nav') }}
32 | {{ render_breadcrumb_item('test_pagination', 'Pagination') }}
33 | {{ render_breadcrumb_item('test_flash', 'Flash Messages') }}
34 | {% endraw %}
35 | {% raw %}
7 | {{ render_nav_item('test_form', 'Form') }}
8 | {{ render_nav_item('test_nav', 'Nav') }}
9 | {{ render_nav_item('test_pagination', 'Pagination') }}
10 | {{ render_nav_item('test_static', 'Static') }}
11 | {{ render_nav_item('test_flash', 'Flash Messages') }}
12 | {% endraw %}
13 | {% raw %}
30 | {{ render_breadcrumb_item('test_form', 'Form') }}
31 | {{ render_breadcrumb_item('test_nav', 'Nav') }}
32 | {{ render_breadcrumb_item('test_pagination', 'Pagination') }}
33 | {{ render_breadcrumb_item('test_flash', 'Flash Messages') }}
34 | {% endraw %}
35 | {% raw %}{{ render_icon('heart') }}{% endraw %}
7 | Output: {{ render_icon('heart') }}
8 |
9 | {% raw %}{{ render_icon('heart', 32) }}{% endraw %}
11 | Output: {{ render_icon('heart', 32) }}
12 |
13 | {% raw %}{{ render_icon('heart', 25, 'primary') }}{% endraw %}
15 | Output: {{ render_icon('heart', 25, 'primary') }}
16 |
17 | {% raw %}{{ render_icon('heart', '2em', 'red') }}{% endraw %}
19 | Output: {{ render_icon('heart', '2em', 'red') }}
20 |
21 | {% raw %}{{ render_icon('heart', title='Heart', desc='A heart.') }}{% endraw %}
23 | Output: {{ render_icon('heart', title='Heart', desc='A heart.') }}
24 |
25 | {% raw %}{{ render_icon('heart', '2em', classes='text-success bg-light p-2 rounded-lg') }}{% endraw %}
27 | Output: {{ render_icon('heart', '4em', classes='text-success bg-light p-2 rounded-lg') }}
28 |
29 | {% raw %}{{ render_icon('heart', '25px', 'primary', font=True) }}{% endraw %}
35 | Output: {{ render_icon('heart', '25px', 'primary', font=True) }}
36 |
37 | {% raw %}{{ render_icon('heart', '2em', 'red', font=True) }}{% endraw %}
39 | Output: {{ render_icon('heart', '2em', 'red', font=True) }}
40 |
41 | {% raw %}{{ render_icon('heart') }}{% endraw %}
7 | Output: {{ render_icon('heart') }}
8 |
9 | {% raw %}{{ render_icon('heart', 32) }}{% endraw %}
11 | Output: {{ render_icon('heart', 32) }}
12 |
13 | {% raw %}{{ render_icon('heart', 25, 'primary') }}{% endraw %}
15 | Output: {{ render_icon('heart', 25, 'primary') }}
16 |
17 | {% raw %}{{ render_icon('heart', '2em', 'red') }}{% endraw %}
19 | Output: {{ render_icon('heart', '2em', 'red') }}
20 |
21 | {% raw %}{{ render_icon('heart', title='Heart', desc='A heart.') }}{% endraw %}
23 | Output: {{ render_icon('heart', title='Heart', desc='A heart.') }}
24 |
25 | {% raw %}{{ render_icon('heart', '2em', classes='text-success bg-body-secondary p-2 rounded-3') }}{% endraw %}
27 | Output: {{ render_icon('heart', '4em', classes='text-success bg-body-secondary p-2 rounded-3') }}
28 |
29 | {% raw %}{{ render_icon('heart', '25px', 'primary', font=True) }}{% endraw %}
35 | Output: {{ render_icon('heart', '25px', 'primary', font=True) }}
36 |
37 | {% raw %}{{ render_icon('heart', '2em', 'red', font=True) }}{% endraw %}
39 | Output: {{ render_icon('heart', '2em', 'red', font=True) }}
40 |
41 |