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
665210e5
Commit
665210e5
authored
Apr 03, 2021
by
Ozzie Isaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for book edit with title sort and author sort
parent
91b9370a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
88 additions
and
68 deletions
+88
-68
editbooks.py
cps/editbooks.py
+62
-50
helper.py
cps/helper.py
+1
-0
isoLanguages.py
cps/isoLanguages.py
+1
-1
table.js
cps/static/js/table.js
+19
-10
book_table.html
cps/templates/book_table.html
+3
-5
user_table.html
cps/templates/user_table.html
+1
-1
messages.po
cps/translations/de/LC_MESSAGES/messages.po
+1
-1
No files found.
cps/editbooks.py
View file @
665210e5
This diff is collapsed.
Click to expand it.
cps/helper.py
View file @
665210e5
...
...
@@ -498,6 +498,7 @@ def generate_random_password():
def
uniq
(
inpt
):
output
=
[]
inpt
=
[
" "
.
join
(
inp
.
split
())
for
inp
in
inpt
]
for
x
in
inpt
:
if
x
not
in
output
:
output
.
append
(
x
)
...
...
cps/isoLanguages.py
View file @
665210e5
...
...
@@ -63,7 +63,7 @@ def get_language_codes(locale, language_names, remainder=None):
if
v
in
language_names
:
lang
.
append
(
k
)
language_names
.
remove
(
v
)
if
remainder
is
not
None
:
if
remainder
is
not
None
and
language_names
:
remainder
.
extend
(
language_names
)
return
lang
...
...
cps/static/js/table.js
View file @
665210e5
...
...
@@ -95,17 +95,22 @@ $(function() {
mode
:
"inline"
,
emptytext
:
"<span class='glyphicon glyphicon-plus'></span>"
,
success
:
function
(
response
,
__
)
{
if
(
!
response
.
success
)
return
response
.
msg
;
if
(
!
response
.
success
)
return
response
.
msg
;
return
{
newValue
:
response
.
newValue
};
},
params
:
function
(
params
)
{
params
.
checkA
=
$
(
'#autoupdate_authorsort'
).
prop
(
'checked'
);
params
.
checkT
=
$
(
'#autoupdate_titlesort'
).
prop
(
'checked'
);
return
params
}
}
};
}
var
validateText
=
$
(
this
).
attr
(
"data-edit-validate"
);
if
(
validateText
)
{
element
.
editable
.
validate
=
function
(
value
)
{
if
(
$
.
trim
(
value
)
===
""
)
return
validateText
;
}
;
var
validateText
=
$
(
this
).
attr
(
"data-edit-validate"
);
if
(
validateText
)
{
element
.
editable
.
validate
=
function
(
value
)
{
if
(
$
.
trim
(
value
)
===
""
)
return
validateText
;
}
;
}
}
column
.
push
(
element
);
});
...
...
@@ -132,7 +137,8 @@ $(function() {
},
// eslint-disable-next-line no-unused-vars
onEditableSave
:
function
(
field
,
row
,
oldvalue
,
$el
)
{
if
(
field
===
"title"
||
field
===
"authors"
)
{
if
(
$
.
inArray
(
field
,
[
"title"
,
"sort"
])
!==
-
1
&&
$
(
'#autoupdate_titlesort'
).
prop
(
'checked'
)
||
$
.
inArray
(
field
,
[
"authors"
,
"author_sort"
])
!==
-
1
&&
$
(
'#autoupdate_authorsort'
).
prop
(
'checked'
))
{
$
.
ajax
({
method
:
"get"
,
dataType
:
"json"
,
...
...
@@ -561,7 +567,10 @@ function TableActions (value, row) {
].
join
(
""
);
}
function
editEntry
(
param
)
{
console
.
log
(
param
);
}
/* Function for deleting domain restrictions */
function
RestrictionActions
(
value
,
row
)
{
return
[
...
...
@@ -598,7 +607,7 @@ function responseHandler(res) {
}
function
singleUserFormatter
(
value
,
row
)
{
return
'<
button type="button" className="btn btn-default"><a href="/admin/user/'
+
row
.
id
+
'">'
+
this
.
buttontext
+
'</a></button
>'
return
'<
a class="btn btn-default" href="/admin/user/'
+
row
.
id
+
'">'
+
this
.
buttontext
+
'</a
>'
}
function
checkboxFormatter
(
value
,
row
,
index
){
...
...
cps/templates/book_table.html
View file @
665210e5
...
...
@@ -30,8 +30,8 @@
<label
for=
"autoupdate_titlesort"
>
{{_('Update Title Sort automatically')}}
</label>
</div>
<div
class=
"row"
>
<input
type=
"checkbox"
id=
"autoupdate_aut
orsort"
name=
"autoupdate_aut
orsort"
checked
>
<label
for=
"autoupdate_autorsort"
>
{{_('Update Author Sort automatically')}}
</label>
<input
type=
"checkbox"
id=
"autoupdate_aut
horsort"
name=
"autoupdate_auth
orsort"
checked
>
<label
for=
"autoupdate_aut
h
orsort"
>
{{_('Update Author Sort automatically')}}
</label>
</div>
</div>
...
...
@@ -53,7 +53,7 @@
{{ text_table_row('languages', _('Enter Languages'),_('Languages'), false) }}
<!--th data-field="pubdate" data-type="date" data-visible="{{visiblility.get('pubdate')}}" data-viewformat="dd.mm.yyyy" id="pubdate" data-sortable="true">{{_('Publishing Date')}}</th-->
{{ text_table_row('publishers', _('Enter Publishers'),_('Publishers'), false) }}
{% if g.user.role_
edit()
%}
{% if g.user.role_
delete_books() and g.user.role_edit()
%}
<th
data-align=
"right"
data-formatter=
"EbookActions"
data-switchable=
"false"
>
{{_('Delete')}}
</th>
{% endif %}
</tr>
...
...
@@ -94,6 +94,4 @@
<script
src=
"{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-table-editable.min.js') }}"
></script>
<script
src=
"{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-editable.min.js') }}"
></script>
<script
src=
"{{ url_for('static', filename='js/table.js') }}"
></script>
<script>
</script>
{% endblock %}
cps/templates/user_table.html
View file @
665210e5
...
...
@@ -12,7 +12,7 @@
{%
endif
%}
{%
if
validate
%}
data-edit-validate=
"{{ _('This Field is Required') }}"
{%
endif
%}
>
{% if button %}
<
div><div
data-id=
"{{id}}"
data-toggle=
"modal"
data-target=
"#restrictModal"
class=
"btn btn-default button_head disabled"
aria-disabled=
"true"
>
{{edit_text}}
</div></div
><br>
<
!--div><button data-id="{{id}}" data-toggle="modal" data-target="#restrictModal" class="btn btn-default button_head disabled" aria-disabled="true">{{edit_text}}</button></div--
>
<br>
{% endif %}
{{ show_text }}
</th>
...
...
cps/translations/de/LC_MESSAGES/messages.po
View file @
665210e5
...
...
@@ -1693,7 +1693,7 @@ msgstr "Speicherort der Calibre-Datenbank"
#: cps/templates/config_edit.html:29
msgid "To activate serverside filepicker start Calibre-Web with -f option"
msgstr "Calibre-Web mit -f Option starten um die serverseitige Dateiauswahl zu aktivieren"
msgstr "Calibre-Web mit -f Option starten
,
um die serverseitige Dateiauswahl zu aktivieren"
#: cps/templates/config_edit.html:35
msgid "Use Google Drive?"
...
...
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