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
7b71f95f
Commit
7b71f95f
authored
Oct 19, 2015
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10007 from open-craft/unenroll-course-name
Display course name in course unenroll confirmation popup.
parents
ab78069a
90274746
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
22 deletions
+29
-22
lms/static/js/dashboard/legacy.js
+2
-0
lms/templates/dashboard/_dashboard_course_listing.html
+27
-22
No files found.
lms/static/js/dashboard/legacy.js
View file @
7b71f95f
...
@@ -128,6 +128,7 @@
...
@@ -128,6 +128,7 @@
$
(
".action-unenroll"
).
click
(
function
(
event
)
{
$
(
".action-unenroll"
).
click
(
function
(
event
)
{
$
(
"#unenroll_course_id"
).
val
(
$
(
event
.
target
).
data
(
"course-id"
)
);
$
(
"#unenroll_course_id"
).
val
(
$
(
event
.
target
).
data
(
"course-id"
)
);
$
(
"#unenroll_course_number"
).
text
(
$
(
event
.
target
).
data
(
"course-number"
)
);
$
(
"#unenroll_course_number"
).
text
(
$
(
event
.
target
).
data
(
"course-number"
)
);
$
(
"#unenroll_course_name"
).
text
(
$
(
event
.
target
).
data
(
"course-name"
)
);
});
});
$
(
'#unenroll_form'
).
on
(
'ajax:complete'
,
function
(
event
,
xhr
)
{
$
(
'#unenroll_form'
).
on
(
'ajax:complete'
,
function
(
event
,
xhr
)
{
...
@@ -190,6 +191,7 @@
...
@@ -190,6 +191,7 @@
$
(
"#unregister_block_course"
).
click
(
function
(
event
)
{
$
(
"#unregister_block_course"
).
click
(
function
(
event
)
{
$
(
"#unenroll_course_id"
).
val
(
$
(
event
.
target
).
data
(
"course-id"
));
$
(
"#unenroll_course_id"
).
val
(
$
(
event
.
target
).
data
(
"course-id"
));
$
(
"#unenroll_course_number"
).
text
(
$
(
event
.
target
).
data
(
"course-number"
));
$
(
"#unenroll_course_number"
).
text
(
$
(
event
.
target
).
data
(
"course-number"
));
$
(
"#unenroll_course_name"
).
text
(
$
(
event
.
target
).
data
(
"course-name"
));
});
});
};
};
...
...
lms/templates/dashboard/_dashboard_course_listing.html
View file @
7b71f95f
...
@@ -165,7 +165,7 @@ from student.helpers import (
...
@@ -165,7 +165,7 @@ from student.helpers import (
% endif
% endif
% endif
% endif
<div
class=
"wrapper-action-more"
>
<div
class=
"wrapper-action-more"
>
<a
href=
"#actions-dropdown-${dashboard_index}"
class=
"action action-more"
id=
"actions-dropdown-link-${dashboard_index}"
aria-haspopup=
"true"
aria-expanded=
"false"
data-course-number=
"${course_overview.number | h}"
data-dashboard-index=
"${dashboard_index}"
>
<a
href=
"#actions-dropdown-${dashboard_index}"
class=
"action action-more"
id=
"actions-dropdown-link-${dashboard_index}"
aria-haspopup=
"true"
aria-expanded=
"false"
data-course-number=
"${course_overview.number | h}"
data-
course-name=
"${course_overview.display_name_with_default | h}"
data-
dashboard-index=
"${dashboard_index}"
>
<span
class=
"sr"
>
${_('Course options dropdown')}
</span>
<span
class=
"sr"
>
${_('Course options dropdown')}
</span>
<i
class=
"fa fa-cog"
aria-hidden=
"true"
></i>
<i
class=
"fa fa-cog"
aria-hidden=
"true"
></i>
</a>
</a>
...
@@ -176,56 +176,56 @@ from student.helpers import (
...
@@ -176,56 +176,56 @@ from student.helpers import (
## Translators: The course name will be added to the end of this sentence.
## Translators: The course name will be added to the end of this sentence.
% if not is_course_blocked:
% if not is_course_blocked:
<a
href=
"#unenroll-modal"
class=
"action action-unenroll"
rel=
"leanModal"
data-course-id=
"${course_overview.id | h}"
data-course_overview-number=
"${course_overview.number | h}"
data-dashboard-index=
"${dashboard_index}"
<a
href=
"#unenroll-modal"
class=
"action action-unenroll"
rel=
"leanModal"
data-course-id=
"${course_overview.id | h}"
data-course_overview-number=
"${course_overview.number | h}"
data-dashboard-index=
"${dashboard_index}"
onclick=
"set_unenroll_message('${_("
Are
you
sure
you
want
to
unenroll
from
the
purchased
course
%(
course_n
umber
)
s
?")}',
'${
_
("
You
will
be
refunded
the
amount
you
paid
.")}')"
>
onclick=
"set_unenroll_message('${_("
Are
you
sure
you
want
to
unenroll
from
the
purchased
course
%(
course_n
ame
)
s
($(
course_number
)
s
)
?")}',
'${
_
("
You
will
be
refunded
the
amount
you
paid
.")}')"
>
${_('Unenroll')}
${_('Unenroll')}
</a>
</a>
% else:
% else:
<a
class=
"action action-unenroll is-disabled"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-dashboard-index=
"${dashboard_index}"
<a
class=
"action action-unenroll is-disabled"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-
course-name=
"${course_overview.display_name_with_default | h}"
data-
dashboard-index=
"${dashboard_index}"
onclick=
"set_unenroll_message('${_("
Are
you
sure
you
want
to
unenroll
from
the
purchased
course
%(
course_n
umber
)
s
?")}',
'${
_
("
You
will
be
refunded
the
amount
you
paid
.")}')"
>
onclick=
"set_unenroll_message('${_("
Are
you
sure
you
want
to
unenroll
from
the
purchased
course
%(
course_n
ame
)
s
(%(
course_number
)
s
)
?")}',
'${
_
("
You
will
be
refunded
the
amount
you
paid
.")}')"
>
${_('Unenroll')}
${_('Unenroll')}
</a>
</a>
% endif
% endif
% elif is_paid_course and not show_refund_option:
% elif is_paid_course and not show_refund_option:
## Translators: The course's name will be added to the end of this sentence.
## Translators: The course's name will be added to the end of this sentence.
% if not is_course_blocked:
% if not is_course_blocked:
<a
href=
"#unenroll-modal"
class=
"action action-unenroll"
rel=
"leanModal"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-dashboard-index=
"${dashboard_index}"
<a
href=
"#unenroll-modal"
class=
"action action-unenroll"
rel=
"leanModal"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-
course-name=
"${course_overview.display_name_with_default | h}"
data-
dashboard-index=
"${dashboard_index}"
onclick=
"set_unenroll_message('${_("
Are
you
sure
you
want
to
unenroll
from
the
purchased
course
%(
course_n
umber
)
s
?")}',
'${
_
("
You
will
not
be
refunded
the
amount
you
paid
.")}')"
>
onclick=
"set_unenroll_message('${_("
Are
you
sure
you
want
to
unenroll
from
the
purchased
course
%(
course_n
ame
)
s
(%(
course_number
)
s
)
?")}',
'${
_
("
You
will
not
be
refunded
the
amount
you
paid
.")}')"
>
${_('Unenroll')}
${_('Unenroll')}
</a>
</a>
% else:
% else:
<a
class=
"action action-unenroll is-disabled"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-dashboard-index=
"${dashboard_index}"
<a
class=
"action action-unenroll is-disabled"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-
course-name=
"${course_overview.display_name_with_default | h}"
data-
dashboard-index=
"${dashboard_index}"
onclick=
"set_unenroll_message('${_("
Are
you
sure
you
want
to
unenroll
from
the
purchased
course
%(
course_n
umber
)
s
?")}',
'${
_
("
You
will
not
be
refunded
the
amount
you
paid
.")}')"
>
onclick=
"set_unenroll_message('${_("
Are
you
sure
you
want
to
unenroll
from
the
purchased
course
%(
course_n
ame
)
s
(%(
course_number
)
s
)
?")}',
'${
_
("
You
will
not
be
refunded
the
amount
you
paid
.")}')"
>
${_('Unenroll')}
${_('Unenroll')}
</a>
</a>
% endif
% endif
% elif enrollment.mode != "verified":
% elif enrollment.mode != "verified":
## Translators: The course's name will be added to the end of this sentence.
## Translators: The course's name will be added to the end of this sentence.
% if not is_course_blocked:
% if not is_course_blocked:
<a
href=
"#unenroll-modal"
class=
"action action-unenroll"
rel=
"leanModal"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-dashboard-index=
"${dashboard_index}"
<a
href=
"#unenroll-modal"
class=
"action action-unenroll"
rel=
"leanModal"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-
course-name=
"${course_overview.display_name_with_default | h}"
data-
dashboard-index=
"${dashboard_index}"
onclick=
"set_unenroll_message('${_("
Are
you
sure
you
want
to
unenroll
from
%(
course_n
umber
)
s
?")}',
'')"
>
onclick=
"set_unenroll_message('${_("
Are
you
sure
you
want
to
unenroll
from
%(
course_n
ame
)
s
(%(
course_number
)
s
)
?")}',
'')"
>
${_('Unenroll')}
${_('Unenroll')}
</a>
</a>
% else:
% else:
<a
class=
"action action-unenroll is-disabled"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-dashboard-index=
"${dashboard_index}"
<a
class=
"action action-unenroll is-disabled"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-
course-name=
"${course_overview.display_name_with_default | h}"
data-
dashboard-index=
"${dashboard_index}"
onclick=
"set_unenroll_message('${_("
Are
you
sure
you
want
to
unenroll
from
%(
course_n
umber
)
s
?")}',
'')"
>
onclick=
"set_unenroll_message('${_("
Are
you
sure
you
want
to
unenroll
from
%(
course_n
ame
)
s
(%(
course_number
)
s
)
?")}',
'')"
>
${_('Unenroll')}
${_('Unenroll')}
</a>
</a>
% endif
% endif
% elif show_refund_option:
% elif show_refund_option:
## Translators: The course's name will be added to the end of this sentence.
## Translators: The course's name will be added to the end of this sentence.
% if not is_course_blocked:
% if not is_course_blocked:
<a
href=
"#unenroll-modal"
class=
"action action-unenroll"
rel=
"leanModal"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-dashboard-index=
"${dashboard_index}"
<a
href=
"#unenroll-modal"
class=
"action action-unenroll"
rel=
"leanModal"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-
course-name=
"${course_overview.display_name_with_default | h}"
data-
dashboard-index=
"${dashboard_index}"
onclick=
"set_unenroll_message(
onclick=
"set_unenroll_message(
'${_("
Are
you
sure
you
want
to
unenroll
from
the
verified
{
cert_name_long
}
track
of
%(
course_number
)
s
?").
format
(
cert_name_long=
cert_name_long
)}',
'${_("
Are
you
sure
you
want
to
unenroll
from
the
verified
%(
cert_name_long
)
s
track
of
%(
course_name
)
s
(%(
course_number
)
s
)?"
)}',
'${
_
("
You
will
be
refunded
the
amount
you
paid
.")}'
'${
_
("
You
will
be
refunded
the
amount
you
paid
.")}'
)"
)"
>
>
${_('Unenroll')}
${_('Unenroll')}
</a>
</a>
% else:
% else:
<a
class=
"action action-unenroll is-disabled"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-dashboard-index=
"${dashboard_index}"
<a
class=
"action action-unenroll is-disabled"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-
course-name=
"${course_overview.display_name_with_default | h}"
data-
dashboard-index=
"${dashboard_index}"
onclick=
"set_unenroll_message(
onclick=
"set_unenroll_message(
'${_("
Are
you
sure
you
want
to
unenroll
from
the
verified
{
cert_name_long
}
track
of
%(
course_number
)
s
?").
format
(
cert_name_long=
cert_name_long
)}',
'${_("
Are
you
sure
you
want
to
unenroll
from
the
verified
%(
cert_name_long
)
s
track
of
%(
course_name
)
s
(%(
course_number
)
s
)?"
)}',
'${
_
("
You
will
be
refunded
the
amount
you
paid
.")}'
'${
_
("
You
will
be
refunded
the
amount
you
paid
.")}'
)"
)"
>
>
...
@@ -235,18 +235,18 @@ from student.helpers import (
...
@@ -235,18 +235,18 @@ from student.helpers import (
% else:
% else:
## Translators: The course's name will be added to the end of this sentence.
## Translators: The course's name will be added to the end of this sentence.
% if not is_course_blocked:
% if not is_course_blocked:
<a
href=
"#unenroll-modal"
class=
"action action-unenroll"
rel=
"leanModal"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-dashboard-index=
"${dashboard_index}"
<a
href=
"#unenroll-modal"
class=
"action action-unenroll"
rel=
"leanModal"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-
course-name=
"${course_overview.display_name_with_default | h}"
data-
dashboard-index=
"${dashboard_index}"
onclick=
"set_unenroll_message(
onclick=
"set_unenroll_message(
'${_("
Are
you
sure
you
want
to
unenroll
from
the
verified
{
cert_name_long
}
track
of
%(
course_number
)
s
?").
format
(
cert_name_long=
cert_name_long
)}',
'${_("
Are
you
sure
you
want
to
unenroll
from
the
verified
%(
cert_name_long
)
s
track
of
%(
course_name
)
s
(%(
course_number
)
s
)?"
)}',
'${
_
("
The
refund
deadline
for
this
course
has
passed
,
so
you
will
not
receive
a
refund
.")}'
'${
_
("
The
refund
deadline
for
this
course
has
passed
,
so
you
will
not
receive
a
refund
.")}'
)"
)"
>
>
${_('Unenroll')}
${_('Unenroll')}
</a>
</a>
% else:
% else:
<a
class=
"action action-unenroll is-disabled"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-dashboard-index=
"${dashboard_index}"
<a
class=
"action action-unenroll is-disabled"
data-course-id=
"${course_overview.id | h}"
data-course-number=
"${course_overview.number | h}"
data-
course-name=
"${course_overview.display_name_with_default | h}"
data-
dashboard-index=
"${dashboard_index}"
onclick=
"set_unenroll_message(
onclick=
"set_unenroll_message(
'${_("
Are
you
sure
you
want
to
unenroll
from
the
verified
{
cert_name_long
}
track
of
%(
course_number
)
s
?").
format
(
cert_name_long=
cert_name_long
)}',
'${_("
Are
you
sure
you
want
to
unenroll
from
the
verified
%(
cert_name_long
)
s
track
of
%(
course_name
)
s
(%(
course_number
)
s
)?"
)}',
'${
_
("
The
refund
deadline
for
this
course
has
passed
,
so
you
will
not
receive
a
refund
.")}'
'${
_
("
The
refund
deadline
for
this
course
has
passed
,
so
you
will
not
receive
a
refund
.")}'
)"
)"
>
>
...
@@ -354,10 +354,11 @@ from student.helpers import (
...
@@ -354,10 +354,11 @@ from student.helpers import (
contact_link_end='
</a>
',
contact_link_end='
</a>
',
unenroll_link_start=(
unenroll_link_start=(
'
<a
id=
"unregister_block_course"
rel=
"leanModal"
'
'
<a
id=
"unregister_block_course"
rel=
"leanModal"
'
'
data-course-id=
"{course_id}"
data-course-number=
"{course_number}"
'
'
data-course-id=
"{course_id}"
data-course-number=
"{course_number}"
data-course-name=
"{course_name}"
'
'
href=
"#unenroll-modal"
>
'.format(
'
href=
"#unenroll-modal"
>
'.format(
course_id=escape(course_overview.id),
course_id=escape(course_overview.id),
course_number=escape(course_overview.number),
course_number=escape(course_overview.number),
course_name=escape(course_overview.display_name_with_default),
)
)
),
),
unenroll_link_end="
</a>
",
unenroll_link_end="
</a>
",
...
@@ -394,7 +395,11 @@ from student.helpers import (
...
@@ -394,7 +395,11 @@ from student.helpers import (
});
});
function
set_unenroll_message
(
track_info
,
refund_info
)
{
function
set_unenroll_message
(
track_info
,
refund_info
)
{
document
.
getElementById
(
'track-info'
).
innerHTML
=
interpolate
(
track_info
,
{
course_number
:
"<span id='unenroll_course_number'></span>"
},
true
);
document
.
getElementById
(
'track-info'
).
innerHTML
=
interpolate
(
track_info
,
{
course_number
:
"<span id='unenroll_course_number'></span>"
,
course_name
:
"<span id='unenroll_course_name'></span>"
,
cert_name_long
:
"${cert_name_long | h}"
},
true
);
document
.
getElementById
(
'refund-info'
).
innerHTML
=
refund_info
;
document
.
getElementById
(
'refund-info'
).
innerHTML
=
refund_info
;
}
}
</script>
</script>
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