Skip to content

Commit

Permalink
Merge pull request #2477 from pallets-eco/remove-bootstrap-2-and-3
Browse files Browse the repository at this point in the history
Remove bootstrap 2 and 3
  • Loading branch information
samuelhwilliams authored Jul 24, 2024
2 parents edf5990 + cbedb22 commit 16f688b
Show file tree
Hide file tree
Showing 124 changed files with 41 additions and 25,253 deletions.
4 changes: 2 additions & 2 deletions doc/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ can use it by adding a FileAdmin view to your app::

# Flask setup here

admin = Admin(app, name='microblog', theme=Bootstrap2Theme())
admin = Admin(app, name='microblog', theme=Bootstrap4Theme())

path = op.join(op.dirname(__file__), 'static')
admin.add_view(FileAdmin(path, '/static/', name='Static Files'))
Expand Down Expand Up @@ -173,7 +173,7 @@ instance running on the same machine as your app, you can::

# Flask setup here

admin = Admin(app, name='microblog', theme=Bootstrap2Theme())
admin = Admin(app, name='microblog', theme=Bootstrap4Theme())

admin.add_view(rediscli.RedisCli(Redis()))

Expand Down
4 changes: 2 additions & 2 deletions examples/custom-layout/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from flask_sqlalchemy import SQLAlchemy

import flask_admin as admin
from flask_admin.theme import Bootstrap3Theme
from flask_admin.theme import Bootstrap4Theme
from flask_admin.contrib.sqla import ModelView


Expand Down Expand Up @@ -59,7 +59,7 @@ def index():


# Create admin with custom base template
admin = admin.Admin(app, 'Example: Layout-BS3', theme=Bootstrap3Theme(base_template='layout.html'))
admin = admin.Admin(app, 'Example: Layout-BS4', theme=Bootstrap4Theme(base_template='layout.html'))

# Add views
admin.add_view(UserAdmin(User, db.session))
Expand Down
7 changes: 3 additions & 4 deletions flask_admin/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from flask_admin.blueprints import _BlueprintWithHostSupport as Blueprint
from flask_admin.consts import ADMIN_ROUTES_HOST_VARIABLE
from flask_admin.menu import MenuCategory, MenuView, MenuLink, SubMenuCategory # noqa: F401
from flask_admin.theme import Theme, Bootstrap2Theme
from flask_admin.theme import Theme, Bootstrap4Theme


def expose(url='/', methods=('GET',)):
Expand Down Expand Up @@ -501,8 +501,7 @@ def __init__(self, app=None, name=None,
Static URL Path. If provided, this specifies the default path to the static url directory for
all its views. Can be overridden in view configuration.
:param theme:
Base theme. Defaults to `Bootstrap2Theme()`. If you want to use
Bootstrap 3 or 4 integration, change it to `Bootstrap3Theme()` or `Bootstrap4Theme()`.
Base theme. Defaults to `Bootstrap4Theme()`.
:param category_icon_classes:
A dict of category names as keys and html classes as values to be added to menu category icons.
Example: {'Favorites': 'glyphicon glyphicon-star'}
Expand All @@ -528,7 +527,7 @@ def __init__(self, app=None, name=None,
self.static_url_path = static_url_path
self.subdomain = subdomain
self.host = host
self.theme = theme or Bootstrap2Theme()
self.theme = theme or Bootstrap4Theme()
self.category_icon_classes = category_icon_classes or dict()

self._validate_admin_host_and_subdomain()
Expand Down
5 changes: 0 additions & 5 deletions flask_admin/form/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
__all__ = ['Select2Widget', 'DatePickerWidget', 'DateTimePickerWidget', 'RenderTemplateWidget', 'Select2TagsWidget', ]


def _is_bootstrap3():
view = h.get_current_view()
return view and view.admin.theme.folder == 'bootstrap3'


class Select2Widget(widgets.Select):
"""
`Select2 <https://github.com/ivaynberg/select2>`_ styled select widget.
Expand Down
165 changes: 0 additions & 165 deletions flask_admin/static/admin/css/bootstrap2/admin.css

This file was deleted.

48 changes: 0 additions & 48 deletions flask_admin/static/admin/css/bootstrap2/rediscli.css

This file was deleted.

Loading

0 comments on commit 16f688b

Please sign in to comment.