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
3110cf6b
Commit
3110cf6b
authored
Mar 27, 2015
by
muzaffaryousaf
Committed by
Andy Armstrong
Apr 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove account settings display and editing from dashboard sidebar.
TNL-1516
parent
429984ef
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
279 deletions
+40
-279
common/djangoapps/student/views.py
+0
-38
common/test/acceptance/pages/lms/dashboard.py
+10
-32
common/test/acceptance/tests/lms/test_lms.py
+5
-58
lms/static/js/dashboard/legacy.js
+0
-82
lms/static/sass/multicourse/_dashboard.scss
+23
-67
lms/templates/dashboard.html
+0
-0
lms/templates/dashboard/_dashboard_status_verification.html
+2
-2
No files found.
common/djangoapps/student/views.py
View file @
3110cf6b
...
...
@@ -620,40 +620,11 @@ def dashboard(request):
enrolled_courses_either_paid
=
frozenset
(
course
.
id
for
course
,
_enrollment
in
course_enrollment_pairs
if
_enrollment
.
is_paid_course
())
# get info w.r.t ExternalAuthMap
external_auth_map
=
None
try
:
external_auth_map
=
ExternalAuthMap
.
objects
.
get
(
user
=
user
)
except
ExternalAuthMap
.
DoesNotExist
:
pass
# If there are *any* denied reverifications that have not been toggled off,
# we'll display the banner
denied_banner
=
any
(
item
.
display
for
item
in
reverifications
[
"denied"
])
language_options
=
DarkLangConfig
.
current
()
.
released_languages_list
# add in the default language if it's not in the list of released languages
if
settings
.
LANGUAGE_CODE
not
in
language_options
:
language_options
.
append
(
settings
.
LANGUAGE_CODE
)
# Re-alphabetize language options
language_options
.
sort
()
# try to get the preferred language for the user
preferred_language_code
=
preferences_api
.
get_user_preference
(
request
.
user
,
LANGUAGE_KEY
)
# try and get the current language of the user
current_language_code
=
get_language
()
if
preferred_language_code
and
preferred_language_code
in
settings
.
LANGUAGE_DICT
:
# if the user has a preference, get the name from the code
current_language
=
settings
.
LANGUAGE_DICT
[
preferred_language_code
]
elif
current_language_code
in
settings
.
LANGUAGE_DICT
:
# if the user's browser is showing a particular language,
# use that as the current language
current_language
=
settings
.
LANGUAGE_DICT
[
current_language_code
]
else
:
# otherwise, use the default language
current_language
=
settings
.
LANGUAGE_DICT
[
settings
.
LANGUAGE_CODE
]
# Populate the Order History for the side-bar.
order_history_list
=
order_history
(
user
,
course_org_filter
=
course_org_filter
,
org_filter_out_set
=
org_filter_out_set
)
...
...
@@ -678,7 +649,6 @@ def dashboard(request):
'course_enrollment_pairs'
:
course_enrollment_pairs
,
'course_optouts'
:
course_optouts
,
'message'
:
message
,
'external_auth_map'
:
external_auth_map
,
'staff_access'
:
staff_access
,
'errored_courses'
:
errored_courses
,
'show_courseware_links_for'
:
show_courseware_links_for
,
...
...
@@ -693,11 +663,7 @@ def dashboard(request):
'block_courses'
:
block_courses
,
'denied_banner'
:
denied_banner
,
'billing_email'
:
settings
.
PAYMENT_SUPPORT_EMAIL
,
'language_options'
:
language_options
,
'current_language'
:
current_language
,
'current_language_code'
:
current_language_code
,
'user'
:
user
,
'duplicate_provider'
:
None
,
'logout_url'
:
reverse
(
logout_user
),
'platform_name'
:
platform_name
,
'enrolled_courses_either_paid'
:
enrolled_courses_either_paid
,
...
...
@@ -707,10 +673,6 @@ def dashboard(request):
'ccx_membership_triplets'
:
ccx_membership_triplets
,
}
if
third_party_auth
.
is_enabled
():
context
[
'duplicate_provider'
]
=
pipeline
.
get_duplicate_provider
(
messages
.
get_messages
(
request
))
context
[
'provider_user_states'
]
=
pipeline
.
get_provider_user_states
(
user
)
return
render_to_response
(
'dashboard.html'
,
context
)
...
...
common/test/acceptance/pages/lms/dashboard.py
View file @
3110cf6b
...
...
@@ -50,19 +50,18 @@ class DashboardPage(PageObject):
return
self
.
q
(
css
=
'h3.course-title > a'
)
.
map
(
_get_course_name
)
.
results
@property
def
full_name
(
self
):
"""Return the displayed value for the user's full name"""
return
self
.
q
(
css
=
'li.info--username .data'
)
.
text
[
0
]
@property
def
email
(
self
):
"""Return the displayed value for the user's email address"""
return
self
.
q
(
css
=
'li.info--email .data'
)
.
text
[
0
]
def
sidebar_menu_title
(
self
):
"""
Return the title value for sidebar menu.
"""
return
self
.
q
(
css
=
'.user-info span.title'
)
.
text
[
0
]
@property
def
username
(
self
):
"""Return the displayed value for the user's username"""
return
self
.
q
(
css
=
'.username-label'
)
.
text
[
0
]
def
sidebar_menu_description
(
self
):
"""
Return the description text for sidebar menu.
"""
return
self
.
q
(
css
=
'.user-info span.copy'
)
.
text
[
0
]
def
get_enrollment_mode
(
self
,
course_name
):
"""Get the enrollment mode for a given course on the dashboard.
...
...
@@ -149,27 +148,6 @@ class DashboardPage(PageObject):
else
:
return
None
def
change_language
(
self
,
code
):
"""
Change the language on the dashboard to the language corresponding with `code`.
"""
self
.
q
(
css
=
".edit-language"
)
.
first
.
click
()
self
.
q
(
css
=
'select[name="language"] option[value="{}"]'
.
format
(
code
))
.
first
.
click
()
self
.
q
(
css
=
"#submit-lang"
)
.
first
.
click
()
# Clicking the submit-lang button does a jquery ajax post, so make sure that
# has completed before continuing on.
self
.
wait_for_ajax
()
self
.
_changed_lang_promise
(
code
)
.
fulfill
()
def
_changed_lang_promise
(
self
,
code
):
def
_check_func
():
language_is_selected
=
self
.
q
(
css
=
'select[name="language"] option[value="{}"]'
.
format
(
code
))
.
selected
modal_is_visible
=
self
.
q
(
css
=
'section#change_language.modal'
)
.
visible
return
(
language_is_selected
and
not
modal_is_visible
)
return
EmptyPromise
(
_check_func
,
"language changed and modal hidden"
)
def
pre_requisite_message_displayed
(
self
):
"""
Verify if pre-requisite course messages are being displayed.
...
...
common/test/acceptance/tests/lms/test_lms.py
View file @
3110cf6b
...
...
@@ -173,9 +173,11 @@ class RegisterFromCombinedPageTest(UniqueCourseTest):
course_names
=
self
.
dashboard_page
.
wait_for_page
()
.
available_courses
self
.
assertIn
(
self
.
course_info
[
"display_name"
],
course_names
)
self
.
assertEqual
(
"Test User"
,
self
.
dashboard_page
.
full_name
)
self
.
assertEqual
(
email
,
self
.
dashboard_page
.
email
)
self
.
assertEqual
(
username
,
self
.
dashboard_page
.
username
)
self
.
assertEqual
(
"want to change your account settings?"
,
self
.
dashboard_page
.
sidebar_menu_title
.
lower
())
self
.
assertEqual
(
"click the arrow next to your username above."
,
self
.
dashboard_page
.
sidebar_menu_description
.
lower
()
)
def
test_register_failure
(
self
):
# Navigate to the registration page
...
...
@@ -369,61 +371,6 @@ class PayAndVerifyTest(EventsTestMixin, UniqueCourseTest):
self
.
assertEqual
(
enrollment_mode
,
'verified'
)
class
LanguageTest
(
WebAppTest
):
"""
Tests that the change language functionality on the dashboard works
"""
def
setUp
(
self
):
"""
Initiailize dashboard page
"""
super
(
LanguageTest
,
self
)
.
setUp
()
self
.
dashboard_page
=
DashboardPage
(
self
.
browser
)
self
.
test_new_lang
=
'eo'
# This string is unicode for "ÇÜRRÉNT ÇØÜRSÉS", which should appear in our Dummy Esperanto page
# We store the string this way because Selenium seems to try and read in strings from
# the HTML in this format. Ideally we could just store the raw ÇÜRRÉNT ÇØÜRSÉS string here
self
.
current_courses_text
=
u'
\xc7\xdc
RR
\xc9
NT
\xc7\xd6\xdc
RS
\xc9
S'
self
.
username
=
"test"
self
.
password
=
"testpass"
self
.
email
=
"test@example.com"
def
test_change_lang
(
self
):
AutoAuthPage
(
self
.
browser
)
.
visit
()
self
.
dashboard_page
.
visit
()
# Change language to Dummy Esperanto
self
.
dashboard_page
.
change_language
(
self
.
test_new_lang
)
changed_text
=
self
.
dashboard_page
.
current_courses_text
# We should see the dummy-language text on the page
self
.
assertIn
(
self
.
current_courses_text
,
changed_text
)
def
test_language_persists
(
self
):
auto_auth_page
=
AutoAuthPage
(
self
.
browser
,
username
=
self
.
username
,
password
=
self
.
password
,
email
=
self
.
email
)
auto_auth_page
.
visit
()
self
.
dashboard_page
.
visit
()
# Change language to Dummy Esperanto
self
.
dashboard_page
.
change_language
(
self
.
test_new_lang
)
# destroy session
self
.
browser
.
delete_all_cookies
()
# log back in
auto_auth_page
.
visit
()
self
.
dashboard_page
.
visit
()
changed_text
=
self
.
dashboard_page
.
current_courses_text
# We should see the dummy-language text on the page
self
.
assertIn
(
self
.
current_courses_text
,
changed_text
)
class
CourseWikiTest
(
UniqueCourseTest
):
"""
Tests that verify the course wiki.
...
...
lms/static/js/dashboard/legacy.js
View file @
3110cf6b
...
...
@@ -23,10 +23,7 @@
* Specifically:
* - dashboard
* - signInUser
* - passwordReset
* - changeEmail
* - changeEmailSettings
* - changeName
* - verifyToggleBannerFailedOff
*/
edx
.
dashboard
.
legacy
.
init
=
function
(
urls
)
{
...
...
@@ -160,67 +157,6 @@
}
});
$
(
'#pwd_reset_button'
).
click
(
function
()
{
$
.
post
(
urls
.
passwordReset
,
{
"email"
:
$
(
'#id_email'
).
val
()},
function
()
{
$
(
"#password_reset_complete_link"
).
click
();
}
);
});
$
(
"#submit-lang"
).
click
(
function
(
event
)
{
event
.
preventDefault
();
$
.
post
(
'/lang_pref/setlang/'
,
{
language
:
$
(
'#settings-language-value'
).
val
()}
).
done
(
function
()
{
// submit form as normal
$
(
'.settings-language-form'
).
submit
();
});
});
$
(
"#change_email_form"
).
submit
(
function
(){
var
new_email
=
$
(
'#new_email_field'
).
val
();
var
new_password
=
$
(
'#new_email_password'
).
val
();
$
.
post
(
urls
.
changeEmail
,
{
"new_email"
:
new_email
,
"password"
:
new_password
},
function
(
data
)
{
if
(
data
.
success
)
{
$
(
"#change_email_title"
).
html
(
gettext
(
"Please verify your new email address"
));
$
(
"#change_email_form"
).
html
(
"<p>"
+
gettext
(
"You'll receive a confirmation in your inbox. Please follow the link in the email to confirm your email address change."
)
+
"</p>"
);
}
else
{
$
(
"#change_email_error"
).
html
(
data
.
error
).
stop
().
css
(
"display"
,
"block"
);
}
}
);
return
false
;
});
$
(
"#change_name_form"
).
submit
(
function
(){
var
new_name
=
$
(
'#new_name_field'
).
val
();
var
rationale
=
$
(
'#name_rationale_field'
).
val
();
$
.
post
(
urls
.
changeName
,
{
"new_name"
:
new_name
,
"rationale"
:
rationale
},
function
(
data
)
{
if
(
data
.
success
)
{
location
.
reload
();
}
else
{
$
(
"#change_name_error"
).
html
(
data
.
error
).
stop
().
css
(
"display"
,
"block"
);
}
}
);
return
false
;
});
$
(
"#email_settings_form"
).
submit
(
function
(){
$
.
ajax
({
type
:
"POST"
,
...
...
@@ -240,24 +176,6 @@
return
false
;
});
accessibleModal
(
".edit-name"
,
"#apply_name_change .close-modal"
,
"#apply_name_change"
,
"#dashboard-main"
);
accessibleModal
(
".edit-email"
,
"#change_email .close-modal"
,
"#change_email"
,
"#dashboard-main"
);
accessibleModal
(
"#pwd_reset_button"
,
"#password_reset_complete .close-modal"
,
"#password_reset_complete"
,
"#dashboard-main"
);
$
(
".action-email-settings"
).
each
(
function
(
index
){
$
(
this
).
attr
(
"id"
,
"email-settings-"
+
index
);
...
...
lms/static/sass/multicourse/_dashboard.scss
View file @
3110cf6b
...
...
@@ -16,33 +16,13 @@
padding
:
(
$baseline
*
2
)
0
0
0
;
.profile-sidebar
{
background
:
transparent
;
@include
float
(
right
);
@include
margin-left
(
flex-gutter
()
);
margin-top
:
(
$baseline
*
2
);
width
:
flex-grid
(
3
);
background
:
transparent
;
.profile
{
@include
box-sizing
(
border-box
);
border
:
1px
solid
$border-color-2
;
border-radius
:
(
$baseline
/
4
)
(
$baseline
/
4
)
0
0
;
width
:
flex-grid
(
12
);
.username-header
{
margin-bottom
:
0
;
}
.username-label
{
@extend
%t-title7
;
@extend
%t-ultrastrong
;
@extend
%cont-truncated
;
text-align
:
center
;
display
:
block
;
margin
:
0
;
padding
:
(
$baseline
*
0
.75
)
$baseline
;
color
:
$base-font-color
;
text-transform
:
none
;
}
}
box-shadow
:
0
0
1px
$shadow-l1
;
border
:
1px
solid
$border-color-2
;
border-radius
:
3px
;
.user-info
{
@include
clearfix
();
...
...
@@ -51,12 +31,8 @@
@include
box-sizing
(
border-box
);
@include
clearfix
();
margin
:
0
;
border
:
1px
solid
$border-color-2
;
border-top
:
none
;
border-radius
:
0
0
(
$baseline
/
4
)
(
$baseline
/
4
);
padding
:
$baseline
;
width
:
flex-grid
(
12
);
background
:
$white
;
li
{
@include
clearfix
();
...
...
@@ -79,19 +55,22 @@
span
{
display
:
block
;
margin-bottom
:
(
$baseline
/
4
);
}
span
.title
{
color
:
$gray
;
font-family
:
$sans-serif
;
font-size
:
13px
;
text-transform
:
uppercase
;
@extend
%t-copy-sub1
;
@extend
%t-strong
;
a
{
text-transform
:
none
;
}
}
span
.copy
{
@extend
%t-copy-sub1
;
}
span
.data
{
color
:
$base-font-color
;
font-weight
:
600
;
...
...
@@ -104,40 +83,6 @@
font-weight
:
inherit
;
}
.auth-provider
{
width
:
flex-grid
(
12
);
display
:
block
;
margin-top
:
(
$baseline
/
4
);
.status
{
width
:
flex-grid
(
1
);
display
:
inline-block
;
color
:
$gray-l2
;
.fa-link
{
color
:
$base-font-color
;
}
.copy
{
@extend
%text-sr
;
}
}
.provider
{
width
:
flex-grid
(
9
);
display
:
inline-block
;
}
.control
{
width
:
flex-grid
(
2
);
display
:
inline-block
;
text-align
:
right
;
a
:link
,
a
:visited
{
@extend
%t-copy-sub2
;
}
}
}
}
}
...
...
@@ -147,6 +92,17 @@
line-height
:
20px
;
}
}
.heads-up
{
.title
{
display
:
inline
;
}
.copy
{
@extend
%t-copy-sub2
;
display
:
inline
;
}
}
}
.reverify-status-list
{
...
...
lms/templates/dashboard.html
View file @
3110cf6b
This diff is collapsed.
Click to expand it.
lms/templates/dashboard/_dashboard_status_verification.html
View file @
3110cf6b
...
...
@@ -7,7 +7,7 @@
%if verification_status == 'approved':
<li
class=
"status status-verification is-accepted"
>
<span
class=
"title status-title"
>
${_("ID
-
Verification Status")}
</span>
<span
class=
"title status-title"
>
${_("ID
Verification Status")}
</span>
<div
class=
"status-data"
>
<span
class=
"status-data-message"
>
${_("Reviewed and Verified")}
</span>
...
...
@@ -23,7 +23,7 @@
%if verification_status == 'pending':
<li
class=
"status status-verification is-pending"
>
<span
class=
"title status-title"
>
${_("ID
-
Verification Status")}
</span>
<span
class=
"title status-title"
>
${_("ID
Verification Status")}
</span>
<div
class=
"status-data"
>
<span
class=
"status-data-message"
>
${_("Pending")}
</span>
...
...
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