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
f1858eaa
Commit
f1858eaa
authored
Oct 03, 2012
by
Priit Laes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace Chosen by Select2
parent
cf3b226c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
10 deletions
+10
-10
filters.js
flask_admin/static/js/filters.js
+2
-2
form.js
flask_admin/static/js/form.js
+4
-4
master.html
flask_admin/templates/admin/master.html
+1
-1
create.html
flask_admin/templates/admin/model/create.html
+1
-1
edit.html
flask_admin/templates/admin/model/edit.html
+1
-1
list.html
flask_admin/templates/admin/model/list.html
+1
-1
No files found.
flask_admin/static/js/filters.js
View file @
f1858eaa
...
@@ -41,7 +41,7 @@ var AdminFilters = function(element, filters_element, operations, options, types
...
@@ -41,7 +41,7 @@ var AdminFilters = function(element, filters_element, operations, options, types
$select
.
append
(
$
(
'<option/>'
).
attr
(
'value'
,
this
[
0
]).
text
(
this
[
1
]));
$select
.
append
(
$
(
'<option/>'
).
attr
(
'value'
,
this
[
0
]).
text
(
this
[
1
]));
});
});
$select
.
chosen
();
$select
.
select2
();
var
optId
=
op
[
0
][
0
];
var
optId
=
op
[
0
][
0
];
...
@@ -58,7 +58,7 @@ var AdminFilters = function(element, filters_element, operations, options, types
...
@@ -58,7 +58,7 @@ var AdminFilters = function(element, filters_element, operations, options, types
.
appendTo
(
$el
);
.
appendTo
(
$el
);
});
});
$field
.
chosen
();
$field
.
select2
();
}
else
}
else
{
{
$field
=
$
(
'<input type="text" class="filter-val" />'
)
$field
=
$
(
'<input type="text" class="filter-val" />'
)
...
...
flask_admin/static/js/form.js
View file @
f1858eaa
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
this
.
applyStyle
=
function
(
el
,
name
)
{
this
.
applyStyle
=
function
(
el
,
name
)
{
switch
(
name
)
{
switch
(
name
)
{
case
'chosen'
:
case
'chosen'
:
$
(
el
).
chosen
();
$
(
el
).
select2
();
break
;
break
;
case
'chosenblank'
:
case
'chosenblank'
:
$
(
el
).
chosen
({
allow_single_deselect
:
true
});
$
(
el
).
select2
({
allowClear
:
true
});
break
;
break
;
case
'datepicker'
:
case
'datepicker'
:
$
(
el
).
datepicker
();
$
(
el
).
datepicker
();
...
@@ -49,8 +49,8 @@
...
@@ -49,8 +49,8 @@
};
};
this
.
applyGlobalStyles
=
function
(
parent
)
{
this
.
applyGlobalStyles
=
function
(
parent
)
{
$
(
'[data-role=chosen]'
,
parent
).
chosen
();
$
(
'[data-role=chosen]'
,
parent
).
select2
();
$
(
'[data-role=chosenblank]'
,
parent
).
chosen
({
allow_single_deselect
:
true
});
$
(
'[data-role=chosenblank]'
,
parent
).
select2
({
allowClear
:
true
});
$
(
'[data-role=datepicker]'
,
parent
).
datepicker
();
$
(
'[data-role=datepicker]'
,
parent
).
datepicker
();
$
(
'[data-role=datetimepicker]'
,
parent
).
datepicker
({
displayTime
:
true
});
$
(
'[data-role=datetimepicker]'
,
parent
).
datepicker
({
displayTime
:
true
});
};
};
...
...
flask_admin/templates/admin/master.html
View file @
f1858eaa
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"
type=
"text/javascript"
></script>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"
type=
"text/javascript"
></script>
<script
src=
"{{ url_for('admin.static', filename='bootstrap/js/bootstrap.min.js') }}"
type=
"text/javascript"
></script>
<script
src=
"{{ url_for('admin.static', filename='bootstrap/js/bootstrap.min.js') }}"
type=
"text/javascript"
></script>
<script
src=
"{{ url_for('admin.static', filename='
chosen/chosen.jquery
.min.js') }}"
type=
"text/javascript"
></script>
<script
src=
"{{ url_for('admin.static', filename='
select2/select2
.min.js') }}"
type=
"text/javascript"
></script>
{% block tail %}
{% block tail %}
{% endblock %}
{% endblock %}
...
...
flask_admin/templates/admin/model/create.html
View file @
f1858eaa
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
{% import 'admin/lib.html' as lib with context %}
{% import 'admin/lib.html' as lib with context %}
{% block head %}
{% block head %}
<link
href=
"{{ url_for('admin.static', filename='
chosen/chosen
.css') }}"
rel=
"stylesheet"
>
<link
href=
"{{ url_for('admin.static', filename='
select2/select2
.css') }}"
rel=
"stylesheet"
>
<link
href=
"{{ url_for('admin.static', filename='css/datepicker.css') }}"
rel=
"stylesheet"
>
<link
href=
"{{ url_for('admin.static', filename='css/datepicker.css') }}"
rel=
"stylesheet"
>
{% endblock %}
{% endblock %}
...
...
flask_admin/templates/admin/model/edit.html
View file @
f1858eaa
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
{% import 'admin/lib.html' as lib with context %}
{% import 'admin/lib.html' as lib with context %}
{% block head %}
{% block head %}
<link
href=
"{{ url_for('admin.static', filename='
chosen/chosen
.css') }}"
rel=
"stylesheet"
>
<link
href=
"{{ url_for('admin.static', filename='
select2/select2
.css') }}"
rel=
"stylesheet"
>
<link
href=
"{{ url_for('admin.static', filename='css/datepicker.css') }}"
rel=
"stylesheet"
>
<link
href=
"{{ url_for('admin.static', filename='css/datepicker.css') }}"
rel=
"stylesheet"
>
{% endblock %}
{% endblock %}
...
...
flask_admin/templates/admin/model/list.html
View file @
f1858eaa
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
{% import 'admin/actions.html' as actionlib with context %}
{% import 'admin/actions.html' as actionlib with context %}
{% block head %}
{% block head %}
<link
href=
"{{ url_for('admin.static', filename='
chosen/chosen
.css') }}"
rel=
"stylesheet"
>
<link
href=
"{{ url_for('admin.static', filename='
select2/select2
.css') }}"
rel=
"stylesheet"
>
<link
href=
"{{ url_for('admin.static', filename='css/datepicker.css') }}"
rel=
"stylesheet"
>
<link
href=
"{{ url_for('admin.static', filename='css/datepicker.css') }}"
rel=
"stylesheet"
>
{% endblock %}
{% 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