Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
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
edx
edx-platform
Commits
21318d14
Commit
21318d14
authored
Jul 31, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add confirmation prompt when deleting a user from a course team
parent
2617b478
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
28 deletions
+56
-28
cms/templates/manage_users.html
+56
-28
No files found.
cms/templates/manage_users.html
View file @
21318d14
...
...
@@ -162,6 +162,14 @@
<
%
block
name=
"jsextra"
>
<script
type=
"text/javascript"
>
window
.
section
=
new
CMS
.
Models
.
Section
({
id
:
"${context_course.id}"
,
name
:
"${context_course.display_name_with_default | h}"
,
url_name
:
"${context_course.location.name | h}"
,
org
:
"${context_course.location.org | h}"
,
num
:
"${context_course.location.course | h}"
,
revision
:
"${context_course.location.revision | h}"
});
var
staffEmails
=
$
{
json
.
dumps
([
user
.
email
for
user
in
staff
])};
var
tplUserURL
=
"${reverse('course_team_user', kwargs=dict(
org=context_course.location.org,
...
...
@@ -270,38 +278,58 @@
});
$
(
'.remove-user'
).
click
(
function
()
{
var
url
=
tplUserURL
.
replace
(
"@@EMAIL@@"
,
$
(
this
).
data
(
'id'
))
$
.
ajax
({
url
:
url
,
type
:
'DELETE'
,
dataType
:
'json'
,
contentType
:
'application/json'
,
success
:
function
(
data
)
{
location
.
reload
();
},
notifyOnError
:
false
,
error
:
function
(
jqXHR
,
textStatus
,
errorThrown
)
{
var
message
;
try
{
message
=
JSON
.
parse
(
jqXHR
.
responseText
).
error
||
"Unknown"
;
}
catch
(
e
)
{
message
=
"Unknown"
;
}
var
prompt
=
new
CMS
.
Views
.
Prompt
.
Error
({
title
:
gettext
(
"Error removing user"
),
message
:
message
,
actions
:
{
primary
:
{
text
:
gettext
(
"OK"
),
click
:
function
(
view
)
{
view
.
hide
();
var
email
=
$
(
this
).
data
(
'id'
);
var
msg
=
new
CMS
.
Views
.
Prompt
.
Warning
({
title
:
gettext
(
"Are you sure?"
),
message
:
_
.
template
(
gettext
(
"Are you sure you want to delete {email} from the course team for {course}?"
),
{
email
:
email
,
course
:
section
.
get
(
'name'
)},
{
interpolate
:
/
\{(
.+
?)\}
/g
}),
actions
:
{
primary
:
{
text
:
gettext
(
"Delete"
),
click
:
function
(
view
)
{
view
.
hide
();
var
url
=
tplUserURL
.
replace
(
"@@EMAIL@@"
,
email
)
$
.
ajax
({
url
:
url
,
type
:
'DELETE'
,
dataType
:
'json'
,
contentType
:
'application/json'
,
success
:
function
(
data
)
{
location
.
reload
();
},
notifyOnError
:
false
,
error
:
function
(
jqXHR
,
textStatus
,
errorThrown
)
{
var
message
;
try
{
message
=
JSON
.
parse
(
jqXHR
.
responseText
).
error
||
"Unknown"
;
}
catch
(
e
)
{
message
=
"Unknown"
;
}
var
prompt
=
new
CMS
.
Views
.
Prompt
.
Error
({
title
:
gettext
(
"Error removing user"
),
message
:
message
,
actions
:
{
primary
:
{
text
:
gettext
(
"OK"
),
click
:
function
(
view
)
{
view
.
hide
();
}
}
}
})
prompt
.
show
();
}
}
}
);
}
})
prompt
.
show
();
},
secondary
:
{
text
:
gettext
(
"Cancel"
),
click
:
function
(
view
)
{
view
.
hide
();
}
}
}
});
msg
.
show
();
});
$
(
".toggle-admin-role"
).
click
(
function
(
e
)
{
...
...
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