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
2f833dc4
Commit
2f833dc4
authored
Jun 20, 2020
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix login with remember me token
parent
22344a39
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
5 deletions
+30
-5
table.js
cps/static/js/table.js
+1
-1
book_table.html
cps/templates/book_table.html
+22
-1
layout.html
cps/templates/layout.html
+4
-2
web.py
cps/web.py
+3
-1
No files found.
cps/static/js/table.js
View file @
2f833dc4
...
...
@@ -55,7 +55,7 @@ $(function() {
$
(
"#books-table"
).
bootstrapTable
(
'uncheckAll'
);
});
$
(
"#merge_
books
"
).
click
(
function
()
{
$
(
"#merge_
confirm
"
).
click
(
function
()
{
$
.
ajax
({
method
:
"post"
,
contentType
:
"application/json; charset=utf-8"
,
...
...
cps/templates/book_table.html
View file @
2f833dc4
...
...
@@ -20,7 +20,7 @@
<h2
class=
"{{page}}"
>
{{_(title)}}
</h2>
<div
class=
"col-xs-12 col-sm-6"
>
<div
class=
"row"
>
<div
class=
"btn btn-default disabled"
id=
"merge_books"
aria-disabled=
"true"
>
{{_('Merge selected books')}}
</div>
<div
class=
"btn btn-default disabled"
id=
"merge_books"
data-toggle=
"modal"
data-target=
"#mergeModal"
aria-disabled=
"true"
>
{{_('Merge selected books')}}
</div>
<div
class=
"btn btn-default disabled"
id=
"delete_selection"
aria-disabled=
"true"
>
{{_('Remove Selections')}}
</div>
</div>
</div>
...
...
@@ -62,6 +62,27 @@
{% endblock %}
{% block modal %}
{{ delete_book(0) }}
{% if g.user.role_edit() %}
<div
class=
"modal fade"
id=
"mergeModal"
role=
"dialog"
aria-labelledby=
"metaMergeLabel"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header bg-danger text-center"
>
<span>
{{_('Are you really sure?')}}
</span>
</div>
<div
class=
"modal-body text-center"
>
<p>
<span
id=
""
>
{{_('This books will merged together with the first selected book')}}
</span>
</p>
</div>
<div
class=
"modal-footer"
>
<input
type=
"button"
class=
"btn btn-danger"
value=
"{{_('Merge')}}"
name=
"merge_confirm"
id=
"merge_confirm"
data-dismiss=
"modal"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
{{_('Cancel')}}
</button>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
{% block js %}
<script
src=
"{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-table.min.js') }}"
></script>
...
...
cps/templates/layout.html
View file @
2f833dc4
...
...
@@ -222,9 +222,11 @@
});
$
(
document
).
ready
(
function
()
{
var
inp
=
$
(
'#query'
).
first
()
var
val
=
inp
.
val
()
if
(
val
.
length
)
{
if
(
inp
.
length
)
{
var
val
=
inp
.
val
()
if
(
val
.
length
)
{
inp
.
val
(
''
).
blur
().
focus
().
val
(
val
)
}
}
});
});
...
...
cps/web.py
View file @
2f833dc4
...
...
@@ -36,7 +36,7 @@ from babel.core import UnknownLocaleError
from
flask
import
Blueprint
from
flask
import
render_template
,
request
,
redirect
,
send_from_directory
,
make_response
,
g
,
flash
,
abort
,
url_for
from
flask_babel
import
gettext
as
_
from
flask_login
import
login_user
,
logout_user
,
login_required
,
current_user
from
flask_login
import
login_user
,
logout_user
,
login_required
,
current_user
,
confirm_login
from
sqlalchemy.exc
import
IntegrityError
,
InvalidRequestError
,
OperationalError
from
sqlalchemy.sql.expression
import
text
,
func
,
true
,
false
,
not_
,
and_
,
or_
from
werkzeug.exceptions
import
default_exceptions
,
InternalServerError
...
...
@@ -294,6 +294,8 @@ def render_title_template(*args, **kwargs):
@
web
.
before_app_request
def
before_request
():
if
current_user
.
is_authenticated
:
confirm_login
()
g
.
user
=
current_user
g
.
allow_registration
=
config
.
config_public_reg
g
.
allow_anonymous
=
config
.
config_anonbrowse
...
...
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