Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
8ec3b8ad
Commit
8ec3b8ad
authored
Aug 08, 2020
by
Michael Bukachi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Correct navbar styling issue
parent
c5f44b10
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
app.py
examples/bootstrap4/app.py
+3
-3
base.html
flask_admin/templates/bootstrap4/admin/base.html
+1
-1
layout.html
flask_admin/templates/bootstrap4/admin/layout.html
+1
-1
No files found.
examples/bootstrap4/app.py
View file @
8ec3b8ad
...
@@ -12,7 +12,7 @@ app = Flask(__name__)
...
@@ -12,7 +12,7 @@ app = Flask(__name__)
# Create dummy secrey key so we can use sessions
# Create dummy secrey key so we can use sessions
app
.
config
[
'SECRET_KEY'
]
=
'123456790'
app
.
config
[
'SECRET_KEY'
]
=
'123456790'
app
.
config
[
'FLASK_ADMIN_SWATCH'
]
=
'
F
latly'
app
.
config
[
'FLASK_ADMIN_SWATCH'
]
=
'
f
latly'
# Create in-memory database
# Create in-memory database
app
.
config
[
'DATABASE_FILE'
]
=
'sample_db.sqlite'
app
.
config
[
'DATABASE_FILE'
]
=
'sample_db.sqlite'
...
@@ -62,8 +62,8 @@ def index():
...
@@ -62,8 +62,8 @@ def index():
admin
=
admin
.
Admin
(
app
,
'Example: Bootstrap4'
,
template_mode
=
'bootstrap4'
)
admin
=
admin
.
Admin
(
app
,
'Example: Bootstrap4'
,
template_mode
=
'bootstrap4'
)
# Add views
# Add views
admin
.
add_view
(
UserAdmin
(
User
,
db
.
session
))
admin
.
add_view
(
UserAdmin
(
User
,
db
.
session
,
category
=
'Menu'
))
admin
.
add_view
(
CustomView
(
Page
,
db
.
session
))
admin
.
add_view
(
CustomView
(
Page
,
db
.
session
,
category
=
'Menu'
))
def
build_sample_db
():
def
build_sample_db
():
...
...
flask_admin/templates/bootstrap4/admin/base.html
View file @
8ec3b8ad
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<body>
<body>
{% block page_body %}
{% block page_body %}
<div
class=
"container{% if config.get('FLASK_ADMIN_FLUID_LAYOUT', False) %}-fluid{% endif %}"
>
<div
class=
"container{% if config.get('FLASK_ADMIN_FLUID_LAYOUT', False) %}-fluid{% endif %}"
>
<nav
class=
"navbar navbar-expand-lg navbar-dark bg-primary"
role=
"navigation"
>
<nav
class=
"navbar navbar-expand-lg navbar-dark bg-primary
mb-2
"
role=
"navigation"
>
<!-- Brand and toggle get grouped for better mobile display -->
<!-- Brand and toggle get grouped for better mobile display -->
<button
class=
"navbar-toggler"
type=
"button"
data-toggle=
"collapse"
data-target=
"#admin-navbar-collapse"
<button
class=
"navbar-toggler"
type=
"button"
data-toggle=
"collapse"
data-target=
"#admin-navbar-collapse"
aria-controls=
"admin-navbar-collapse"
aria-expanded=
"false"
aria-label=
"Toggle navigation"
>
aria-controls=
"admin-navbar-collapse"
aria-expanded=
"false"
aria-label=
"Toggle navigation"
>
...
...
flask_admin/templates/bootstrap4/admin/layout.html
View file @
8ec3b8ad
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
{% else %}
{% else %}
<li
{%
if
class_name
%}
class=
"{{class_name}}"
{%
endif
%}
>
<li
{%
if
class_name
%}
class=
"{{class_name}}"
{%
endif
%}
>
{%- endif %}
{%- endif %}
<a
class=
"nav-link"
href=
"{{ child.get_url() }}"
{%
if
child
.
target
%}
<a
class=
"nav-link
text-reset
"
href=
"{{ child.get_url() }}"
{%
if
child
.
target
%}
target=
"{{ child.target }}"
{%
endif
%}
>
target=
"{{ child.target }}"
{%
endif
%}
>
{{ menu_icon(child) }}{{ child.name }}
</a>
{{ menu_icon(child) }}{{ child.name }}
</a>
</li>
</li>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment