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
6f570e33
Unverified
Commit
6f570e33
authored
Sep 02, 2018
by
Alan Hamlett
Committed by
GitHub
Sep 02, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1521 from alanhamlett/master
remove need for some inline javascripts
parents
c9aeb1ba
b94874f2
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
89 additions
and
127 deletions
+89
-127
actions.js
flask_admin/static/admin/js/actions.js
+3
-0
bs2_modal.js
flask_admin/static/admin/js/bs2_modal.js
+5
-0
bs3_modal.js
flask_admin/static/admin/js/bs3_modal.js
+5
-0
filters.js
flask_admin/static/admin/js/filters.js
+49
-35
rediscli.js
flask_admin/static/admin/js/rediscli.js
+4
-0
actions.html
flask_admin/templates/bootstrap2/admin/actions.html
+3
-4
list.html
flask_admin/templates/bootstrap2/admin/model/list.html
+7
-17
create.html
...admin/templates/bootstrap2/admin/model/modals/create.html
+0
-5
edit.html
...k_admin/templates/bootstrap2/admin/model/modals/edit.html
+0
-5
console.html
flask_admin/templates/bootstrap2/admin/rediscli/console.html
+2
-5
actions.html
flask_admin/templates/bootstrap3/admin/actions.html
+3
-4
list.html
flask_admin/templates/bootstrap3/admin/model/list.html
+6
-33
create.html
...admin/templates/bootstrap3/admin/model/modals/create.html
+0
-7
edit.html
...k_admin/templates/bootstrap3/admin/model/modals/edit.html
+0
-7
console.html
flask_admin/templates/bootstrap3/admin/rediscli/console.html
+2
-5
No files found.
flask_admin/static/admin/js/actions.js
View file @
6f570e33
...
...
@@ -48,3 +48,6 @@ var AdminModelActions = function(actionErrorMessage, actionConfirmations) {
});
});
};
if
(
$
(
'#actions_confirmation'
).
length
==
1
)
{
var
modelActions
=
new
AdminModelActions
(
JSON
.
parse
(
$
(
'#message-data'
).
text
()),
JSON
.
parse
(
$
(
'#actions-confirmation-data'
).
text
()));
}
flask_admin/static/admin/js/bs2_modal.js
View file @
6f570e33
...
...
@@ -2,3 +2,8 @@
$
(
'.modal'
).
on
(
'hidden'
,
function
()
{
$
(
this
).
removeData
(
'modal'
);
});
$
(
function
()
{
// Apply flask-admin form styles after the modal is loaded
window
.
faForm
.
applyGlobalStyles
(
document
);
});
flask_admin/static/admin/js/bs3_modal.js
View file @
6f570e33
...
...
@@ -2,3 +2,8 @@
$
(
'body'
).
on
(
'hidden.bs.modal'
,
'.modal'
,
function
()
{
$
(
this
).
removeData
(
'bs.modal'
).
find
(
".modal-content"
).
empty
();
});
$
(
function
()
{
// Apply flask-admin form styles after the modal is loaded
window
.
faForm
.
applyGlobalStyles
(
document
);
});
flask_admin/static/admin/js/filters.js
View file @
6f570e33
...
...
@@ -179,3 +179,17 @@ var AdminFilters = function(element, filtersElement, filterGroups, activeFilters
lastCount
+=
1
;
};
(
function
(
$
)
{
$
(
'[data-role=tooltip]'
).
tooltip
({
html
:
true
,
placement
:
'bottom'
});
if
(
$
(
'#filter-groups-data'
).
length
==
1
)
{
var
filter
=
new
AdminFilters
(
'#filter_form'
,
'.field-filters'
,
JSON
.
parse
(
$
(
'#filter-groups-data'
).
text
()),
JSON
.
parse
(
$
(
'#active-filters-data'
).
text
())
);
}
})(
jQuery
);
flask_admin/static/admin/js/rediscli.js
View file @
6f570e33
...
...
@@ -115,3 +115,7 @@ var RedisCli = function(postUrl) {
sendCommand
(
'ping'
);
};
$
(
function
()
{
var
redisCli
=
new
RedisCli
(
JSON
.
parse
(
$
(
'#execute-view-data'
).
text
()));
});
flask_admin/templates/bootstrap2/admin/actions.html
View file @
6f570e33
...
...
@@ -27,9 +27,8 @@
{% macro script(message, actions, actions_confirmation) %}
{% if actions %}
<div
id=
"actions-confirmation-data"
style=
"display:none;"
>
{{ actions_confirmation|tojson|safe }}
</div>
<div
id=
"message-data"
style=
"display:none;"
>
{{ message|tojson|safe }}
</div>
<script
src=
"{{ admin_static.url(filename='admin/js/actions.js', v='1.0.0') }}"
></script>
<script
language=
"javascript"
>
var
modelActions
=
new
AdminModelActions
({{
message
|
tojson
|
safe
}},
{{
actions_confirmation
|
tojson
|
safe
}});
</script>
{% endif %}
{% endmacro %}
flask_admin/templates/bootstrap2/admin/model/list.html
View file @
6f570e33
...
...
@@ -179,26 +179,16 @@
{% block tail %}
{{ super() }}
{{ lib.form_js() }}
{% if filter_groups %}
<div
id=
"filter-groups-data"
style=
"display:none;"
>
{{ filter_groups|tojson|safe }}
</div>
<div
id=
"active-filters-data"
style=
"display:none;"
>
{{ active_filters|tojson|safe }}
</div>
{% endif %}
<script
src=
"{{ admin_static.url(filename='admin/js/filters.js', v='1.0.0') }}"
></script>
{{ lib.form_js() }}
{{ actionlib.script(_gettext('Please select at least one record.'),
actions,
actions_confirmation) }}
<script
language=
"javascript"
>
(
function
(
$
)
{
$
(
'[data-role=tooltip]'
).
tooltip
({
html
:
true
,
placement
:
'bottom'
});
{
%
if
filter_groups
%
}
var
filter
=
new
AdminFilters
(
'#filter_form'
,
'.field-filters'
,
{{
filter_groups
|
tojson
|
safe
}},
{{
active_filters
|
tojson
|
safe
}}
);
{
%
endif
%
}
})(
jQuery
);
</script>
{% endblock %}
flask_admin/templates/bootstrap2/admin/model/modals/create.html
View file @
6f570e33
...
...
@@ -21,10 +21,5 @@
$
(
'.modal-header h3'
).
html
(
'{% block header_text -%}
<h3>{{ _gettext('
Create
New
Record
') }}</h3>
{%- endblock %}'
);
$
(
function
()
{
// Apply flask-admin form styles after the modal is loaded
window
.
faForm
.
applyGlobalStyles
(
document
);
});
</script>
{% endblock %}
flask_admin/templates/bootstrap2/admin/model/modals/edit.html
View file @
6f570e33
...
...
@@ -21,10 +21,5 @@
$
(
'.modal-header h3'
).
html
(
'{% block header_text -%}
{{ _gettext('
Edit
Record
') + '
#
' + request.args.get('
id
') }}
{%- endblock %}'
);
$
(
function
()
{
// Apply flask-admin form styles after the modal is loaded
window
.
faForm
.
applyGlobalStyles
(
document
);
});
</script>
{% endblock %}
flask_admin/templates/bootstrap2/admin/rediscli/console.html
View file @
6f570e33
...
...
@@ -21,10 +21,7 @@
{% block tail %}
{{ super() }}
<div
id=
"execute-view-data"
style=
"display:none;"
>
{{ admin_view.get_url('.execute_view')|tojson|safe }}
</div>
<script
src=
"{{ admin_static.url(filename='admin/js/rediscli.js', v='1.0.0') }}"
></script>
<script
language=
"javascript"
>
$
(
function
()
{
var
redisCli
=
new
RedisCli
({{
get_url
(
'.execute_view'
)
|
tojson
}});
});
</script>
{% endblock %}
flask_admin/templates/bootstrap3/admin/actions.html
View file @
6f570e33
...
...
@@ -27,9 +27,8 @@
{% macro script(message, actions, actions_confirmation) %}
{% if actions %}
<div
id=
"actions-confirmation-data"
style=
"display:none;"
>
{{ actions_confirmation|tojson|safe }}
</div>
<div
id=
"message-data"
style=
"display:none;"
>
{{ message|tojson|safe }}
</div>
<script
src=
"{{ admin_static.url(filename='admin/js/actions.js', v='1.0.0') }}"
></script>
<script
language=
"javascript"
>
var
modelActions
=
new
AdminModelActions
({{
message
|
tojson
|
safe
}},
{{
actions_confirmation
|
tojson
|
safe
}});
</script>
{% endif %}
{% endmacro %}
flask_admin/templates/bootstrap3/admin/model/list.html
View file @
6f570e33
...
...
@@ -180,43 +180,16 @@
{% block tail %}
{{ super() }}
{% if filter_groups %}
<div
id=
"filter-groups-data"
style=
"display:none;"
>
{{ filter_groups|tojson|safe }}
</div>
<div
id=
"active-filters-data"
style=
"display:none;"
>
{{ active_filters|tojson|safe }}
</div>
{% endif %}
<script
src=
"{{ admin_static.url(filename='admin/js/filters.js', v='1.0.0') }}"
></script>
{{ lib.form_js() }}
{{ actionlib.script(_gettext('Please select at least one record.'),
actions,
actions_confirmation) }}
<script
language=
"javascript"
>
(
function
(
$
)
{
$
(
'[data-role=tooltip]'
).
tooltip
({
html
:
true
,
placement
:
'bottom'
});
{
%
if
filter_groups
%
}
var
filter
=
new
AdminFilters
(
'#filter_form'
,
'.field-filters'
,
{{
filter_groups
|
tojson
|
safe
}},
{{
active_filters
|
tojson
|
safe
}}
);
{
%
endif
%
}
})(
jQuery
);
// Catch exception when closing dialog with
<
esc
>
key
// and prevent accidental deletions.
function
safeConfirm
(
msg
)
{
try
{
var
isconfirmed
=
confirm
(
msg
);
if
(
isconfirmed
==
true
)
{
return
true
;
}
else
{
return
false
;
}
}
catch
(
err
)
{
return
false
;
}
}
</script>
{% endblock %}
flask_admin/templates/bootstrap3/admin/model/modals/create.html
View file @
6f570e33
...
...
@@ -21,11 +21,4 @@
{% block tail %}
<script
src=
"{{ admin_static.url(filename='admin/js/bs3_modal.js', v='1.0.0') }}"
></script>
<script>
$
(
function
()
{
// Apply flask-admin form styles after the modal is loaded
window
.
faForm
.
applyGlobalStyles
(
document
);
});
</script>
{% endblock %}
flask_admin/templates/bootstrap3/admin/model/modals/edit.html
View file @
6f570e33
...
...
@@ -23,11 +23,4 @@
{% block tail %}
<script
src=
"{{ admin_static.url(filename='admin/js/bs3_modal.js', v='1.0.0') }}"
></script>
<script>
$
(
function
()
{
// Apply flask-admin form styles after the modal is loaded
window
.
faForm
.
applyGlobalStyles
(
document
);
});
</script>
{% endblock %}
flask_admin/templates/bootstrap3/admin/rediscli/console.html
View file @
6f570e33
...
...
@@ -21,10 +21,7 @@
{% block tail %}
{{ super() }}
<div
id=
"execute-view-data"
style=
"display:none;"
>
{{ admin_view.get_url('.execute_view')|tojson|safe }}
</div>
<script
src=
"{{ admin_static.url(filename='admin/js/rediscli.js', v='1.0.0') }}"
></script>
<script
language=
"javascript"
>
$
(
function
()
{
var
redisCli
=
new
RedisCli
({{
admin_view
.
get_url
(
'.execute_view'
)
|
tojson
}});
});
</script>
{% endblock %}
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