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
91f192f6
Commit
91f192f6
authored
Jul 25, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added error prompts for the course team page
parent
4a2b5519
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
9 deletions
+66
-9
cms/templates/manage_users.html
+66
-9
No files found.
cms/templates/manage_users.html
View file @
91f192f6
...
@@ -42,10 +42,6 @@
...
@@ -42,10 +42,6 @@
<div
class=
"wrapper-form"
>
<div
class=
"wrapper-form"
>
<h3
class=
"title"
>
${_("Add a User to Your Course's Team")}
</h3>
<h3
class=
"title"
>
${_("Add a User to Your Course's Team")}
</h3>
<div
id=
"add-user-error"
class=
"message message-status message-status error"
name=
"add-user-error"
>
</div>
<fieldset
class=
"form-fields"
>
<fieldset
class=
"form-fields"
>
<legend
class=
"sr"
>
${_("Textbook information")}
</legend>
<legend
class=
"sr"
>
${_("Textbook information")}
</legend>
<div
class=
"field text required add-user-email"
>
<div
class=
"field text required add-user-email"
>
...
@@ -173,8 +169,26 @@
...
@@ -173,8 +169,26 @@
},
},
notifyOnError
:
false
,
notifyOnError
:
false
,
error
:
function
(
jqXHR
,
textStatus
,
errorThrown
)
{
error
:
function
(
jqXHR
,
textStatus
,
errorThrown
)
{
data
=
JSON
.
parse
(
jqXHR
.
responseText
);
var
message
;
$
(
'#add-user-error'
).
toggleClass
(
'is-shown'
).
empty
().
append
(
data
.
error
);
try
{
message
=
JSON
.
parse
(
jqXHR
.
responseText
).
error
||
"Unknown"
;
}
catch
(
e
)
{
message
=
"Unknown"
;
}
var
prompt
=
new
CMS
.
Views
.
Prompt
.
Error
({
title
:
gettext
(
"Error adding user"
),
message
:
message
,
actions
:
{
primary
:
{
text
:
gettext
(
"OK"
),
click
:
function
(
view
)
{
view
.
hide
();
$
(
"#user-email-input"
).
focus
()
}
}
}
})
prompt
.
show
();
}
}
});
});
});
});
...
@@ -184,7 +198,6 @@
...
@@ -184,7 +198,6 @@
e
.
preventDefault
();
e
.
preventDefault
();
$
(
'.new-user-button'
).
removeClass
(
'is-disabled'
);
$
(
'.new-user-button'
).
removeClass
(
'is-disabled'
);
$newUserForm
.
toggleClass
(
'is-shown'
);
$newUserForm
.
toggleClass
(
'is-shown'
);
$
(
'#add-user-error'
).
removeClass
(
'is-shown'
);
$
(
'#user-email-input'
).
val
(
''
);
$
(
'#user-email-input'
).
val
(
''
);
});
});
...
@@ -208,8 +221,30 @@
...
@@ -208,8 +221,30 @@
type
:
'DELETE'
,
type
:
'DELETE'
,
dataType
:
'json'
,
dataType
:
'json'
,
contentType
:
'application/json'
,
contentType
:
'application/json'
,
complete
:
function
(
)
{
success
:
function
(
data
)
{
location
.
reload
();
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
();
}
}
});
});
});
});
...
@@ -231,8 +266,30 @@
...
@@ -231,8 +266,30 @@
data
:
JSON
.
stringify
({
data
:
JSON
.
stringify
({
role
:
role
role
:
role
}),
}),
complete
:
function
(
)
{
success
:
function
(
data
)
{
location
.
reload
();
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 changing user"
),
message
:
message
,
actions
:
{
primary
:
{
text
:
gettext
(
"OK"
),
click
:
function
(
view
)
{
view
.
hide
();
}
}
}
})
prompt
.
show
();
}
}
})
})
})
})
...
...
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