Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
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
captainwong
douban-api-proxy
Commits
3b81ea37
Commit
3b81ea37
authored
Jul 23, 2021
by
Ozzie Isaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix entries of user table are visible if database has no tags
parent
3c8bfc31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
58 deletions
+62
-58
table.js
cps/static/js/table.js
+62
-58
No files found.
cps/static/js/table.js
View file @
3b81ea37
...
@@ -661,33 +661,34 @@ function move_header_elements() {
...
@@ -661,33 +661,34 @@ function move_header_elements() {
}
}
});
});
$
(
".multi_selector"
).
selectpicker
();
$
(
".multi_selector"
).
selectpicker
();
if
(
$
(
".multi_head"
).
length
)
{
if
(
!
$
.
_data
(
$
(
".multi_head"
).
get
(
0
),
"events"
)
)
{
if
(
!
$
.
_data
(
$
(
".multi_head"
).
get
(
0
),
"events"
))
{
// Functions have to be here, otherwise the callbacks are not fired if visible columns are changed
// Functions have to be here, otherwise the callbacks are not fired if visible columns are changed
$
(
".multi_head"
).
on
(
"click"
,
function
()
{
$
(
".multi_head"
).
on
(
"click"
,
function
()
{
var
val
=
$
(
this
).
data
(
"set"
);
var
val
=
$
(
this
).
data
(
"set"
);
var
field
=
$
(
this
).
data
(
"name"
);
var
field
=
$
(
this
).
data
(
"name"
);
var
result
=
$
(
'#user-table'
).
bootstrapTable
(
'getSelections'
).
map
(
a
=>
a
.
id
);
var
result
=
$
(
'#user-table'
).
bootstrapTable
(
'getSelections'
).
map
(
a
=>
a
.
id
);
var
values
=
$
(
"#"
+
field
).
val
();
var
values
=
$
(
"#"
+
field
).
val
();
confirmDialog
(
confirmDialog
(
"restrictions"
,
"restrictions"
,
"GeneralChangeModal"
,
"GeneralChangeModal"
,
0
,
0
,
function
()
{
function
()
{
$
.
ajax
({
$
.
ajax
({
method
:
"post"
,
method
:
"post"
,
url
:
window
.
location
.
pathname
+
"/../../ajax/editlistusers/"
+
field
,
url
:
window
.
location
.
pathname
+
"/../../ajax/editlistusers/"
+
field
,
data
:
{
"pk"
:
result
,
"value"
:
values
,
"action"
:
val
},
data
:
{
"pk"
:
result
,
"value"
:
values
,
"action"
:
val
},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
handleListServerResponse
(
data
);
handleListServerResponse
(
data
);
},
},
error
:
function
(
data
)
{
error
:
function
(
data
)
{
handleListServerResponse
([{
type
:
"danger"
,
message
:
data
.
responseText
}])
handleListServerResponse
([{
type
:
"danger"
,
message
:
data
.
responseText
}])
},
},
});
});
}
}
);
);
});
});
}
}
}
$
(
"#user_delete_selection"
).
click
(
function
()
{
$
(
"#user_delete_selection"
).
click
(
function
()
{
...
@@ -699,38 +700,41 @@ function move_header_elements() {
...
@@ -699,38 +700,41 @@ function move_header_elements() {
$
(
"#select_default_language"
).
on
(
"change"
,
function
()
{
$
(
"#select_default_language"
).
on
(
"change"
,
function
()
{
selectHeader
(
this
,
"default_language"
);
selectHeader
(
this
,
"default_language"
);
});
});
if
(
$
(
".check_head"
).
length
)
{
if
(
!
$
.
_data
(
$
(
".check_head"
).
get
(
0
),
"events"
)
)
{
if
(
!
$
.
_data
(
$
(
".check_head"
).
get
(
0
),
"events"
))
{
$
(
".check_head"
).
on
(
"change"
,
function
()
{
$
(
".check_head"
).
on
(
"change"
,
function
()
{
var
val
=
$
(
this
).
data
(
"set"
);
var
val
=
$
(
this
).
data
(
"set"
);
var
name
=
$
(
this
).
data
(
"name"
);
var
name
=
$
(
this
).
data
(
"name"
);
var
data
=
$
(
this
).
data
(
"val"
);
var
data
=
$
(
this
).
data
(
"val"
);
checkboxHeader
(
val
,
name
,
data
);
checkboxHeader
(
val
,
name
,
data
);
});
});
}
}
}
if
(
!
$
.
_data
(
$
(
".button_head"
).
get
(
0
),
"events"
)
)
{
if
(
$
(
".button_head"
).
length
)
{
$
(
".button_head"
).
on
(
"click"
,
function
()
{
if
(
!
$
.
_data
(
$
(
".button_head"
).
get
(
0
),
"events"
))
{
var
result
=
$
(
'#user-table'
).
bootstrapTable
(
'getSelections'
).
map
(
a
=>
a
.
id
);
$
(
".button_head"
).
on
(
"click"
,
function
()
{
confirmDialog
(
var
result
=
$
(
'#user-table'
).
bootstrapTable
(
'getSelections'
).
map
(
a
=>
a
.
id
);
"btndeluser"
,
confirmDialog
(
"GeneralDeleteModal"
,
"btndeluser"
,
0
,
"GeneralDeleteModal"
,
function
()
{
0
,
$
.
ajax
({
function
()
{
method
:
"post"
,
$
.
ajax
({
url
:
window
.
location
.
pathname
+
"/../../ajax/deleteuser"
,
method
:
"post"
,
data
:
{
"userid"
:
result
},
url
:
window
.
location
.
pathname
+
"/../../ajax/deleteuser"
,
success
:
function
(
data
)
{
data
:
{
"userid"
:
result
},
selections
=
selections
.
filter
((
el
)
=>
!
result
.
includes
(
el
));
success
:
function
(
data
)
{
handleListServerResponse
(
data
);
selections
=
selections
.
filter
((
el
)
=>
!
result
.
includes
(
el
));
},
handleListServerResponse
(
data
);
error
:
function
(
data
)
{
},
handleListServerResponse
([{
type
:
"danger"
,
message
:
data
.
responseText
}])
error
:
function
(
data
)
{
},
handleListServerResponse
([{
type
:
"danger"
,
message
:
data
.
responseText
}])
});
},
}
});
);
}
});
);
});
}
}
}
}
}
...
...
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