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
003fca0f
Commit
003fca0f
authored
Aug 08, 2020
by
Michael Bukachi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Correct boolean fields display
parent
012ec957
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
app.py
examples/bootstrap4/app.py
+1
-0
lib.html
flask_admin/templates/bootstrap4/admin/lib.html
+6
-2
No files found.
examples/bootstrap4/app.py
View file @
003fca0f
...
@@ -26,6 +26,7 @@ class User(db.Model):
...
@@ -26,6 +26,7 @@ class User(db.Model):
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
name
=
db
.
Column
(
db
.
Unicode
(
64
))
name
=
db
.
Column
(
db
.
Unicode
(
64
))
email
=
db
.
Column
(
db
.
Unicode
(
64
))
email
=
db
.
Column
(
db
.
Unicode
(
64
))
active
=
db
.
Column
(
db
.
Boolean
,
default
=
True
)
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
self
.
name
return
self
.
name
...
...
flask_admin/templates/bootstrap4/admin/lib.html
View file @
003fca0f
...
@@ -120,7 +120,7 @@
...
@@ -120,7 +120,7 @@
{% set prepend = kwargs.pop('prepend', None) %}
{% set prepend = kwargs.pop('prepend', None) %}
{% set append = kwargs.pop('append', None) %}
{% set append = kwargs.pop('append', None) %}
<div
class=
"form-group {{ kwargs.get('column_class', '') }}"
>
<div
class=
"form-group {{ kwargs.get('column_class', '') }}"
>
<label
for=
"{{ field.id }}"
class=
"control-label"
>
{{ field.label.text }}
<label
for=
"{{ field.id }}"
class=
"control-label"
{%
if
field
.
widget
.
input_type =
=
'
checkbox
'
%}
style=
"display: block"
{%
endif
%}
>
{{ field.label.text }}
{% if h.is_required_form_field(field) %}
{% if h.is_required_form_field(field) %}
<strong
style=
"color: red"
>
*
</strong>
<strong
style=
"color: red"
>
*
</strong>
{%- else -%}
{%- else -%}
...
@@ -135,7 +135,11 @@
...
@@ -135,7 +135,11 @@
</div>
</div>
{%- endif -%}
{%- endif -%}
{% endif %}
{% endif %}
{% if field.widget.input_type == 'checkbox' %}
{% set _class = kwargs.setdefault('class', 'form-control-lg') %}
{% else %}
{% set _class = kwargs.setdefault('class', 'form-control') %}
{% set _class = kwargs.setdefault('class', 'form-control') %}
{% endif %}
{%- if direct_error %} {% set _ = kwargs.update({'class': kwargs['class'] ~ ' is-invalid'}) %} {% endif -%}
{%- if direct_error %} {% set _ = kwargs.update({'class': kwargs['class'] ~ ' is-invalid'}) %} {% endif -%}
{{ field(**kwargs) | safe }}
{{ field(**kwargs) | safe }}
{%- if append -%}
{%- if append -%}
...
...
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