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
c0a4addf
Commit
c0a4addf
authored
Apr 17, 2021
by
Ozzie Isaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cancel button in User edit now leads to the right page back #1938
parent
39bbee0e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
6 deletions
+23
-6
main.js
cps/static/js/main.js
+14
-0
table.js
cps/static/js/table.js
+3
-3
admin.html
cps/templates/admin.html
+1
-1
email_edit.html
cps/templates/email_edit.html
+1
-1
user_edit.html
cps/templates/user_edit.html
+1
-1
user_table.html
cps/templates/user_table.html
+3
-0
No files found.
cps/static/js/main.js
View file @
c0a4addf
...
...
@@ -114,6 +114,20 @@ $(document).ready(function() {
}
});
$
(
".session"
).
click
(
function
()
{
window
.
sessionStorage
.
setItem
(
"back"
,
window
.
location
.
pathname
);
});
$
(
"#back"
).
click
(
function
()
{
var
loc
=
sessionStorage
.
getItem
(
"back"
);
if
(
!
loc
)
{
loc
=
$
(
this
).
data
(
"back"
);
}
sessionStorage
.
removeItem
(
"back"
);
window
.
location
.
href
=
loc
;
});
function
confirmDialog
(
id
,
dialogid
,
dataValue
,
yesFn
,
noFn
)
{
var
$confirm
=
$
(
"#"
+
dialogid
);
$confirm
.
modal
(
'show'
);
...
...
cps/static/js/table.js
View file @
c0a4addf
...
...
@@ -600,7 +600,7 @@ function responseHandler(res) {
}
function
singleUserFormatter
(
value
,
row
)
{
return
'<a class="btn btn-default" href="'
+
window
.
location
.
pathname
+
'/../../admin/user/'
+
row
.
id
+
'">'
+
this
.
buttontext
+
'</a>'
return
'<a class="btn btn-default"
onclick="storeLocation()"
href="'
+
window
.
location
.
pathname
+
'/../../admin/user/'
+
row
.
id
+
'">'
+
this
.
buttontext
+
'</a>'
}
function
checkboxFormatter
(
value
,
row
,
index
){
...
...
@@ -741,6 +741,6 @@ function queryParams(params)
return
params
;
}
function
test
()
{
console
.
log
(
"hello"
);
function
storeLocation
()
{
window
.
sessionStorage
.
setItem
(
"back"
,
window
.
location
.
pathname
);
}
cps/templates/admin.html
View file @
c0a4addf
...
...
@@ -26,7 +26,7 @@
{% for user in allUser %}
{% if not user.role_anonymous() or config.config_anonbrowse %}
<tr>
<td><a
href=
"{{url_for('admin.edit_user', user_id=user.id)}}"
>
{{user.name}}
</a></td>
<td><a
class=
"session"
href=
"{{url_for('admin.edit_user', user_id=user.id)}}"
>
{{user.name}}
</a></td>
<td>
{{user.email}}
</td>
<td>
{{user.kindle_mail}}
</td>
<td>
{{user.downloads.count()}}
</td>
...
...
cps/templates/email_edit.html
View file @
c0a4addf
...
...
@@ -66,7 +66,7 @@
{% if feature_support['gmail'] %}
</div>
{% endif %}
<a
href=
"{{ url_for('admin.admin') }}"
id=
"back"
class=
"btn btn-default"
>
{{_('Back')}}
</a>
<a
href=
"{{ url_for('admin.admin') }}"
id=
"
email_
back"
class=
"btn btn-default"
>
{{_('Back')}}
</a>
</form>
{% if g.allow_registration %}
<div
class=
"col-md-10 col-lg-6"
>
...
...
cps/templates/user_edit.html
View file @
c0a4addf
...
...
@@ -129,7 +129,7 @@
<div
class=
"col-sm-12"
>
<div
id=
"user_submit"
class=
"btn btn-default"
>
{{_('Save')}}
</div>
{% if not profile %}
<
a
href=
"{{ url_for('admin.admin') }}"
id=
"back"
class=
"btn btn-default"
>
{{_('Cancel')}}
</a
>
<
div
class=
"btn btn-default"
data-back=
"{{ url_for('admin.admin') }}"
id=
"back"
>
{{_('Cancel')}}
</div
>
{% endif %}
{% if g.user and g.user.role_admin() and not profile and not new_user and not content.role_anonymous() %}
<div
class=
"btn btn-danger"
id=
"btndeluser"
data-value=
"{{ content.id }}"
data-remote=
"false"
>
{{_('Delete User')}}
</div>
...
...
cps/templates/user_table.html
View file @
c0a4addf
...
...
@@ -137,6 +137,9 @@
</tr>
</thead>
</table>
<div
class=
"errorlink"
>
<div
class=
"btn btn-default"
data-back=
"{{ url_for('admin.admin') }}"
id=
"back"
>
{{_('Back')}}
</div>
</div>
{% endblock %}
{% block modal %}
{{ delete_confirm_modal() }}
...
...
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