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
b4d308f7
Commit
b4d308f7
authored
Nov 17, 2019
by
iCaiCai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix modal window
parent
a4f2c6a0
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
714 additions
and
17 deletions
+714
-17
bs4_modal.js
flask_admin/static/admin/js/bs4_modal.js
+5
-0
select2-bootstrap4.css
flask_admin/static/vendor/select2/select2-bootstrap4.css
+6
-1
bootstrap4-editable.css
...dmin/static/vendor/x-editable/css/bootstrap4-editable.css
+663
-0
bootstrap4-editable.min.js
...in/static/vendor/x-editable/js/bootstrap4-editable.min.js
+7
-0
base.html
flask_admin/templates/bootstrap4/admin/base.html
+2
-2
create.html
...admin/templates/bootstrap4/admin/model/modals/create.html
+18
-6
edit.html
...k_admin/templates/bootstrap4/admin/model/modals/edit.html
+13
-8
No files found.
flask_admin/static/admin/js/bs4_modal.js
View file @
b4d308f7
...
...
@@ -2,3 +2,8 @@
$
(
'body'
).
on
(
'click.modal.data-api'
,
'[data-toggle="modal"]'
,
function
()
{
$
(
$
(
this
).
data
(
"target"
)
+
' .modal-content'
).
load
(
$
(
this
).
attr
(
'href'
));
});
$
(
function
()
{
// Apply flask-admin form styles after the modal is loaded
window
.
faForm
.
applyGlobalStyles
(
document
);
});
flask_admin/static/vendor/select2/select2-bootstrap4.css
View file @
b4d308f7
This diff is collapsed.
Click to expand it.
flask_admin/static/vendor/x-editable/css/bootstrap4-editable.css
0 → 100644
View file @
b4d308f7
This diff is collapsed.
Click to expand it.
flask_admin/static/vendor/x-editable/js/bootstrap4-editable.min.js
0 → 100644
View file @
b4d308f7
This diff is collapsed.
Click to expand it.
flask_admin/templates/bootstrap4/admin/base.html
View file @
b4d308f7
...
...
@@ -78,13 +78,13 @@
{% endblock %}
{% block tail_js %}
<script
src=
"{{ admin_static.url(filename='bootstrap/bootstrap4/js/popper.min.js') }}"
type=
"text/javascript"
></script>
<script
src=
"{{ admin_static.url(filename='vendor/jquery.min.js', v='2.1.4') }}"
type=
"text/javascript"
></script>
<script
src=
"{{ admin_static.url(filename='bootstrap/bootstrap4/js/popper.min.js') }}"
type=
"text/javascript"
></script>
<script
src=
"{{ admin_static.url(filename='bootstrap/bootstrap4/js/bootstrap.min.js', v='4.2.1') }}"
type=
"text/javascript"
></script>
<script
src=
"{{ admin_static.url(filename='vendor/moment.min.js', v='2.9.0') }}"
type=
"text/javascript"
></script>
<script
src=
"{{ admin_static.url(filename='vendor/bootstrap4/dropdown.js', v='4.3.1') }}"
type=
"text/javascript"
></script>
<script
src=
"{{ admin_static.url(filename='vendor/bootstrap4/util.js', v='4.3.1') }}"
type=
"text/javascript"
></script>
<script
src=
"{{ admin_static.url(filename='vendor/bootstrap4/dropdown.js', v='4.3.1') }}"
type=
"text/javascript"
></script>
<script
src=
"{{ admin_static.url(filename='vendor/select2/select2.min.js', v='4.2.1') }}"
type=
"text/javascript"
></script>
{% if admin_view.extra_js %}
...
...
flask_admin/templates/bootstrap4/admin/model/modals/create.html
View file @
b4d308f7
...
...
@@ -5,20 +5,32 @@
{% set render_ctx = h.resolve_ctx() %}
{% block body %}
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
{% block header_text %}
<h3>
{{ _gettext('Create New Record') }}
</h3>
{% endblock %}
{% block header_text %}
<h5
class=
"modal-title"
>
{{ _gettext('Create New Record') }}
</h5>
{% endblock %}
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
{% call lib.form_tag(action=url_for('.create_view', url=return_url)) %}
<div
class=
"modal-body"
>
{{ lib.render_form_fields(form, form_opts=form_opts) }}
</div>
<div
class=
"modal-footer"
>
{{ lib.render_form_buttons(return_url, extra=None, is_modal=True) }}
</div>
{% endcall %}
{# "save and add" button is removed from modal (it won't function properly) #}
{% block create_form %}
{
#
% block create_form %}
{{ lib.render_form(form, return_url, extra=None, form_opts=form_opts,
action=url_for('.create_view', url=return_url),
is_modal=True) }}
{% endblock %}
</div>
{% endblock % #}
{% endblock %}
{% block tail %}
<script
src=
"{{ admin_static.url(filename='admin/js/bs
3
_modal.js', v='1.0.0') }}"
></script>
<script
src=
"{{ admin_static.url(filename='admin/js/bs
4
_modal.js', v='1.0.0') }}"
></script>
{% endblock %}
flask_admin/templates/bootstrap4/admin/model/modals/edit.html
View file @
b4d308f7
...
...
@@ -6,19 +6,24 @@
{% block body %}
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
{% block header_text %}
<h3>
{{ _gettext('Edit Record') + ' #' + request.args.get('id') }}
</h3
>
<h5
class=
"modal-title"
>
{{ _gettext('Edit Record') + ' #' + request.args.get('id') }}
</h5
>
{% endblock %}
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
{% call lib.form_tag(action=url_for('.edit_view', id=request.args.get('id'), url=return_url)) %}
<div
class=
"modal-body"
>
{# "save and continue" button is removed from modal (it won't function properly) #}
{% block edit_form %}
{{ lib.render_form(form, return_url, extra=None, form_opts=form_opts,
action=url_for('.edit_view', id=request.args.get('id'), url=return_url),
is_modal=True) }}
{% endblock %}
{{ lib.render_form_fields(form, form_opts=form_opts) }}
</div>
<div
class=
"modal-footer"
>
{{ lib.render_form_buttons(return_url, extra=None, is_modal=True) }}
</div>
{% endcall %}
{% endblock %}
{% block tail %}
...
...
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