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
OpenEdx
edx-platform
Commits
7a4c6847
Unverified
Commit
7a4c6847
authored
Nov 15, 2017
by
Bill Filler
Committed by
GitHub
Nov 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Add 'View Consent' button to dashboard when required"
parent
7622898d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
3 additions
and
96 deletions
+3
-96
common/djangoapps/student/tests/test_views.py
+0
-41
common/djangoapps/student/views.py
+1
-17
lms/static/sass/multicourse/_dashboard.scss
+1
-10
lms/templates/dashboard.html
+1
-2
lms/templates/dashboard/_dashboard_course_listing.html
+0
-0
lms/templates/dashboard/_dashboard_show_consent.html
+0
-26
No files found.
common/djangoapps/student/tests/test_views.py
View file @
7a4c6847
...
...
@@ -7,7 +7,6 @@ import json
import
unittest
import
ddt
import
mock
import
pytz
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
...
...
@@ -336,43 +335,3 @@ class StudentDashboardTests(SharedModuleStoreTestCase, MilestonesTestCaseMixin):
remove_prerequisite_course
(
self
.
course
.
id
,
get_course_milestones
(
self
.
course
.
id
)[
0
])
response
=
self
.
client
.
get
(
reverse
(
'dashboard'
))
self
.
assertNotIn
(
'<div class="prerequisites">'
,
response
.
content
)
@mock.patch
(
'student.views.consent_needed_for_course'
)
@mock.patch
(
'student.views.enterprise_customer_for_request'
)
@ddt.data
(
(
True
,
True
,
True
),
(
True
,
True
,
False
),
(
True
,
False
,
False
),
(
False
,
True
,
False
),
(
False
,
False
,
False
),
)
@ddt.unpack
def
test_enterprise_view_consent_for_course
(
self
,
enterprise_enabled
,
consent_needed
,
future_course
,
mock_enterprise_customer
,
mock_consent_necessary
):
"""
Verify that the 'View Consent' icon show up if data sharing consent turned on
for enterprise customer
"""
if
future_course
:
self
.
course
=
CourseFactory
.
create
(
start
=
self
.
TOMORROW
,
emit_signals
=
True
)
else
:
self
.
course
=
CourseFactory
.
create
(
emit_signals
=
True
)
self
.
course_enrollment
=
CourseEnrollmentFactory
(
course_id
=
self
.
course
.
id
,
user
=
self
.
user
)
if
enterprise_enabled
:
mock_enterprise_customer
.
return_value
=
{
'name'
:
'TestEnterprise'
,
'uuid'
:
'abc123xxx'
}
else
:
mock_enterprise_customer
.
return_value
=
None
mock_consent_necessary
.
return_value
=
consent_needed
# Assert 'View Consent' button shows up appropriately
response
=
self
.
client
.
get
(
reverse
(
'dashboard'
))
self
.
assertEquals
(
'View Consent'
in
response
.
content
,
enterprise_enabled
and
consent_needed
)
self
.
assertEquals
(
'TestEnterprise'
in
response
.
content
,
enterprise_enabled
and
consent_needed
)
common/djangoapps/student/views.py
View file @
7a4c6847
...
...
@@ -87,11 +87,7 @@ from openedx.core.djangoapps.theming import helpers as theming_helpers
from
openedx.core.djangoapps.user_api.preferences
import
api
as
preferences_api
from
openedx.core.djangolib.markup
import
HTML
from
openedx.features.course_experience
import
course_home_url_name
from
openedx.features.enterprise_support.api
import
(
consent_needed_for_course
,
enterprise_customer_for_request
,
get_dashboard_consent_notification
)
from
openedx.features.enterprise_support.api
import
get_dashboard_consent_notification
from
shoppingcart.api
import
order_history
from
shoppingcart.models
import
CourseRegistrationCode
,
DonationConfiguration
from
student.cookies
import
delete_logged_in_cookies
,
set_logged_in_cookies
,
set_user_info_cookie
...
...
@@ -738,16 +734,6 @@ def dashboard(request):
enterprise_message
=
get_dashboard_consent_notification
(
request
,
user
,
course_enrollments
)
enterprise_customer
=
enterprise_customer_for_request
(
request
)
consent_required_courses
=
set
()
enterprise_customer_name
=
None
if
enterprise_customer
:
consent_required_courses
=
{
enrollment
.
course_id
for
enrollment
in
course_enrollments
if
consent_needed_for_course
(
request
,
request
.
user
,
str
(
enrollment
.
course_id
),
True
)
}
enterprise_customer_name
=
enterprise_customer
[
'name'
]
# Account activation message
account_activation_messages
=
[
message
for
message
in
messages
.
get_messages
(
request
)
if
'account-activation'
in
message
.
tags
...
...
@@ -866,8 +852,6 @@ def dashboard(request):
context
=
{
'enterprise_message'
:
enterprise_message
,
'consent_required_courses'
:
consent_required_courses
,
'enterprise_customer_name'
:
enterprise_customer_name
,
'enrollment_message'
:
enrollment_message
,
'redirect_message'
:
redirect_message
,
'account_activation_messages'
:
account_activation_messages
,
...
...
lms/static/sass/multicourse/_dashboard.scss
View file @
7a4c6847
...
...
@@ -734,7 +734,7 @@
@include
clearfix
();
position
:
inherit
;
position
:
relative
;
@include
left
(
$baseline
/
2
);
@include
padding
((
$baseline
*
0
.4
)
,
0
,
(
$baseline
*
0
.4
)
,
(
$baseline
*
0
.75
));
...
...
@@ -785,15 +785,6 @@
opacity
:
0
.875
;
}
}
.action-view-consent
{
@extend
%btn-pl-white-base
;
@include
float
(
right
);
&
.archived
{
@extend
%btn-pl-default-base
;
}
}
}
// TYPE: status
...
...
lms/templates/dashboard.html
View file @
7a4c6847
...
...
@@ -128,8 +128,7 @@ from openedx.core.djangolib.markup import HTML, Text
<
%
course_verification_status =
verification_status_by_course.get(enrollment.course_id,
{})
%
>
<
%
course_requirements =
courses_requirements_not_met.get(enrollment.course_id)
%
>
<
%
related_programs =
inverted_programs.get(unicode(enrollment.course_id))
%
>
<
%
show_consent_link =
(enrollment.course_id
in
consent_required_courses
)
%
>
<
%
include
file=
'dashboard/_dashboard_course_listing.html'
args=
'course_overview=enrollment.course_overview, enrollment=enrollment, show_courseware_link=show_courseware_link, cert_status=cert_status, can_unenroll=can_unenroll, credit_status=credit_status, show_email_settings=show_email_settings, course_mode_info=course_mode_info, is_paid_course=is_paid_course, is_course_blocked=is_course_blocked, verification_status=course_verification_status, course_requirements=course_requirements, dashboard_index=dashboard_index, share_settings=share_settings, user=user, related_programs=related_programs, display_course_modes_on_dashboard=display_course_modes_on_dashboard, show_consent_link=show_consent_link, enterprise_customer_name=enterprise_customer_name'
/>
<
%
include
file=
'dashboard/_dashboard_course_listing.html'
args=
'course_overview=enrollment.course_overview, enrollment=enrollment, show_courseware_link=show_courseware_link, cert_status=cert_status, can_unenroll=can_unenroll, credit_status=credit_status, show_email_settings=show_email_settings, course_mode_info=course_mode_info, is_paid_course=is_paid_course, is_course_blocked=is_course_blocked, verification_status=course_verification_status, course_requirements=course_requirements, dashboard_index=dashboard_index, share_settings=share_settings, user=user, related_programs=related_programs, display_course_modes_on_dashboard=display_course_modes_on_dashboard'
/>
% endfor
</ul>
...
...
lms/templates/dashboard/_dashboard_course_listing.html
View file @
7a4c6847
This diff is collapsed.
Click to expand it.
lms/templates/dashboard/_dashboard_show_consent.html
deleted
100644 → 0
View file @
7622898d
<
%
page
expression_filter=
"h"
args=
"course_overview, course_target, enrollment, enterprise_customer_name"
/>
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<div
class=
"message message-upsell has-actions is-shown"
>
<div
class=
"wrapper-extended"
>
<p
class=
"message-copy"
align=
"justify"
>
<b
class=
"message-copy-bold"
>
${_("Consent to share your data")}
</b>
<br>
${_("To access this course, you must first consent to share your learning achievements with {enterprise_customer_name}.").format(enterprise_customer_name=enterprise_customer_name)}
</p>
<div
class=
"action-upgrade-container"
>
<a
class=
"action action-view-consent"
href=
"${course_target}"
data-course-key=
"${enrollment.course_id}"
>
<span
class=
"wrapper-copy"
>
<span
class=
"copy"
id=
"view-consent"
>
${_("View Consent")}
</span>
<span
class=
"sr"
>
${_(course_overview.display_name_with_default)}
</span>
</span>
</a>
</div>
</div>
</div>
\ No newline at end of file
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