Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
3c3fda80
Commit
3c3fda80
authored
Aug 23, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change chosen To select2 lib
parent
ae9bbb40
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
46 additions
and
37 deletions
+46
-37
chosen-sprite.png
apps/static/css/plugins/chosen/chosen-sprite.png
+0
-0
chosen-sprite@2x.png
apps/static/css/plugins/chosen/chosen-sprite@2x.png
+0
-0
chosen.css
apps/static/css/plugins/chosen/chosen.css
+0
-0
select2.min.css
apps/static/css/plugins/select2/select2.min.css
+0
-0
style.css
apps/static/css/style.css
+36
-10
chosen.jquery.js
apps/static/js/plugins/chosen/chosen.jquery.js
+0
-0
chosen.jquery.min.js
apps/static/js/plugins/chosen/chosen.jquery.min.js
+0
-0
select2.full.min.js
apps/static/js/plugins/select2/select2.full.min.js
+0
-0
forms.py
apps/users/forms.py
+1
-1
_user.html
apps/users/templates/users/_user.html
+3
-12
user_detail.html
apps/users/templates/users/user_detail.html
+6
-14
No files found.
apps/static/css/plugins/chosen/chosen-sprite.png
deleted
100755 → 0
View file @
ae9bbb40
646 Bytes
apps/static/css/plugins/chosen/chosen-sprite@2x.png
deleted
100755 → 0
View file @
ae9bbb40
872 Bytes
apps/static/css/plugins/chosen/chosen.css
deleted
100755 → 0
View file @
ae9bbb40
This diff is collapsed.
Click to expand it.
apps/static/css/plugins/select2/select2.min.css
0 → 100755
View file @
3c3fda80
This diff is collapsed.
Click to expand it.
apps/static/css/style.css
View file @
3c3fda80
...
...
@@ -969,17 +969,43 @@ button.dim:active:before {
position
:
relative
;
width
:
100%
;
}
.select2-container--default
.select2-results__option--highlighted
[
aria-selected
]
{
background-color
:
#1ab394
;
color
:
white
;
}
.select2-selection--multiple
{
border
:
1px
solid
#e5e6e7
!important
;
cursor
:
text
!important
;
}
/*.select2-container--classic .select2-selection--multiple:focus {*/
/*border: 1px solid #1ab394;*/
/*}*/
.select2-container--forcus
{
border
:
1px
solid
#1AB394
!important
;
}
.select2-selection__choice
,
.chosen-container-multi
.chosen-choices
li
.search-choice
{
background
:
#f1f1f1
;
border
:
1px
solid
#ededed
;
border-radius
:
2px
;
box-shadow
:
none
;
color
:
#333333
;
cursor
:
default
;
line-height
:
13px
;
margin
:
3px
0
3px
5px
;
padding
:
3px
20px
3px
5px
;
position
:
relative
;
background
:
#f1f1f1
!important
;
border
:
1px
solid
#e5e6e7
!important
;
/*border: 1px solid #ededed;*/
border-radius
:
2px
!important
;
box-shadow
:
none
!important
;
color
:
#333333
!important
;
cursor
:
default
!important
;
line-height
:
13px
!important
;
/*margin: 3px 0 3px 5px !important;*/
padding
:
3px
20px
3px
5px
!important
;
position
:
relative
!important
;
}
.select2-container--default.select2-container--focus
.select2-selection--multiple
{
border
:
1px
solid
#1ab394
!important
;
box-shadow
:
0
0
5px
rgba
(
0
,
0
,
0
,
0.3
)
!important
;
}
.chosen-container
.chosen-results
li
.highlighted
{
...
...
apps/static/js/plugins/chosen/chosen.jquery.js
deleted
100755 → 0
View file @
ae9bbb40
This diff is collapsed.
Click to expand it.
apps/static/js/plugins/chosen/chosen.jquery.min.js
deleted
100755 → 0
View file @
ae9bbb40
This diff is collapsed.
Click to expand it.
apps/static/js/plugins/select2/select2.full.min.js
0 → 100755
View file @
3c3fda80
This diff is collapsed.
Click to expand it.
apps/users/forms.py
View file @
3c3fda80
...
...
@@ -21,7 +21,7 @@ class UserAddForm(ModelForm):
}
widgets
=
{
'groups'
:
forms
.
SelectMultiple
(
attrs
=
{
'class'
:
'
chosen-select
'
,
'data-placeholder'
:
'请选择用户组'
}),
'groups'
:
forms
.
SelectMultiple
(
attrs
=
{
'class'
:
'
select2
'
,
'data-placeholder'
:
'请选择用户组'
}),
}
...
...
apps/users/templates/users/_user.html
View file @
3c3fda80
...
...
@@ -2,9 +2,9 @@
{% load static %}
{% load bootstrap %}
{% block custom_head_css_js %}
<link
href=
"{% static "
css
/
plugins
/
chosen
/
chose
n
.
css
"
%}"
rel=
"stylesheet"
>
<link
href=
"{% static "
css
/
plugins
/
select2
/
select2
.
mi
n
.
css
"
%}"
rel=
"stylesheet"
>
<link
href=
"{% static "
css
/
plugins
/
datepicker
/
datepicker3
.
css
"
%}"
rel=
"stylesheet"
>
<script
src=
"{% static "
js
/
plugins
/
chosen
/
chosen
.
jquery
.
min
.
js
"
%}"
></script>
<script
src=
"{% static "
js
/
plugins
/
select2
/
select2
.
full
.
min
.
js
"
%}"
></script>
{% endblock %}
{% block content %}
...
...
@@ -80,16 +80,7 @@
<script
src=
"{% static 'js/plugins/datapicker/bootstrap-datepicker.js' %}"
></script>
<script>
$
(
document
).
ready
(
function
()
{
var
config
=
{
'.chosen-select'
:
{},
'.chosen-select-deselect'
:
{
allow_single_deselect
:
true
},
'.chosen-select-no-single'
:
{
disable_search_threshold
:
10
},
'.chosen-select-no-results'
:
{
no_results_text
:
'Oops, nothing found!'
},
'.chosen-select-width'
:
{
width
:
"95%"
}
};
for
(
var
selector
in
config
)
{
$
(
selector
).
chosen
(
config
[
selector
]);
}
$
(
'.select2'
).
select2
();
$
(
'.input-group.date'
).
datepicker
({
todayBtn
:
"linked"
,
...
...
apps/users/templates/users/user_detail.html
View file @
3c3fda80
...
...
@@ -4,8 +4,8 @@
{% load static %}
{% block custom_head_css_js %}
<link
href=
"{% static "
css
/
plugins
/
chosen
/
chose
n
.
css
"
%}"
rel=
"stylesheet"
>
<script
src=
"{% static "
js
/
plugins
/
chosen
/
chosen
.
jquery
.
min
.
js
"
%}"
></script>
<link
href=
"{% static "
css
/
plugins
/
select2
/
select2
.
mi
n
.
css
"
%}"
rel=
"stylesheet"
>
<script
src=
"{% static "
js
/
plugins
/
select2
/
select2
.
full
.
min
.
js
"
%}"
></script>
{% endblock %}
{% block content %}
<div
class=
"wrapper wrapper-content animated fadeInRight"
>
...
...
@@ -192,7 +192,7 @@
<form>
<tr>
<td
colspan=
"2"
class=
"no-borders"
>
<select
data-placeholder=
"选择用户组"
class=
"
chosen-select
"
style=
"width: 100%"
multiple=
""
tabindex=
"4"
>
<select
data-placeholder=
"选择用户组"
class=
"
select2
"
style=
"width: 100%"
multiple=
""
tabindex=
"4"
>
{% for group in groups %}
<option
value=
"{{ group.id }}"
>
{{ group.name }}
</option>
{% endfor %}
...
...
@@ -208,7 +208,7 @@
{% for group in user.groups.all %}
<tr>
<td
width=
"40%"
><b
style=
"font-size: medium"
>
{{ group.name }}
</b></td>
<td
><b
>
{{ group.name }}
</b></td>
<td>
<button
class=
"btn btn-danger btn-sm"
type=
"button"
style=
"float: right;"
><i
class=
"fa fa-minus"
></i></button>
</td>
...
...
@@ -230,16 +230,7 @@
{% block custom_foot_js %}
<script>
$
(
document
).
ready
(
function
()
{
var
config
=
{
'.chosen-select'
:
{},
'.chosen-select-deselect'
:
{
allow_single_deselect
:
true
},
'.chosen-select-no-single'
:
{
disable_search_threshold
:
10
},
'.chosen-select-no-results'
:
{
no_results_text
:
'Oops, nothing found!'
},
'.chosen-select-width'
:
{
width
:
"95%"
}
};
for
(
var
selector
in
config
)
{
$
(
selector
).
chosen
(
config
[
selector
]);
}
$
(
'.select2'
).
select2
();
})
</script>
{% endblock %}
\ No newline at end of file
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