diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 634f5ae82f..97de18b825 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -864,6 +864,7 @@ def dashboard(request): 'nav_hidden': True, 'inverted_programs': inverted_programs, 'show_program_listing': ProgramsApiConfig.is_enabled(), + 'show_dashboard_tabs': True, 'disable_courseware_js': True, 'display_course_modes_on_dashboard': enable_verified_certificates and display_course_modes_on_dashboard, 'display_sidebar_on_dashboard': display_sidebar_on_dashboard, diff --git a/common/test/acceptance/pages/lms/dashboard.py b/common/test/acceptance/pages/lms/dashboard.py index 24dbb07caf..a636638f0e 100644 --- a/common/test/acceptance/pages/lms/dashboard.py +++ b/common/test/acceptance/pages/lms/dashboard.py @@ -217,11 +217,18 @@ class DashboardPage(PageObject): """ return self.q(css='.user-dropdown-menu li a').text + @property + def tabs_link_text(self): + """ + Return the text of all the tabs on the dashboard. + """ + return self.q(css='.tab-nav-item a').text + def click_my_profile_link(self): """ Click on `Profile` link. """ - self.q(css='.user-dropdown-menu li a').nth(1).click() + self.q(css='.tab-nav-item a').nth(1).click() def click_account_settings_link(self): """ diff --git a/common/test/acceptance/tests/lms/test_learner_profile.py b/common/test/acceptance/tests/lms/test_learner_profile.py index f896cea2bb..f50fa56784 100644 --- a/common/test/acceptance/tests/lms/test_learner_profile.py +++ b/common/test/acceptance/tests/lms/test_learner_profile.py @@ -278,8 +278,7 @@ class OwnLearnerProfilePageTest(LearnerProfileTestMixin, AcceptanceTest): username, __ = self.log_in_as_unique_user() dashboard_page = DashboardPage(self.browser) dashboard_page.visit() - dashboard_page.click_username_dropdown() - self.assertIn('Profile', dashboard_page.username_dropdown_link_text) + self.assertIn('Profile', dashboard_page.tabs_link_text) dashboard_page.click_my_profile_link() my_profile_page = LearnerProfilePage(self.browser, username) my_profile_page.wait_for_page() diff --git a/lms/djangoapps/courseware/tests/test_masquerade.py b/lms/djangoapps/courseware/tests/test_masquerade.py index 072470b913..fbe1f9733c 100644 --- a/lms/djangoapps/courseware/tests/test_masquerade.py +++ b/lms/djangoapps/courseware/tests/test_masquerade.py @@ -154,20 +154,6 @@ class MasqueradeTestCase(SharedModuleStoreTestCase, LoginEnrollmentTestCase): self.assertIn(self.problem_display_name, problem_html) self.assertEqual(show_answer_expected, "Show Answer" in problem_html) - def verify_real_user_profile_link(self): - """ - Verifies that the 'Profile' link in the navigation dropdown is pointing - to the real user. - """ - content = self.get_courseware_page().content - self.assertIn( - 'Profile'.format( - self.test_user.username - ), - content, - "Profile link should point to real user", - ) - def ensure_masquerade_as_group_member(self, partition_id, group_id): """ Installs a masquerade for the test_user and test course, to enable the @@ -376,9 +362,6 @@ class TestStaffMasqueradeAsSpecificStudent(StaffMasqueradeTestCase, ProblemSubmi self.update_masquerade(role='student', user_name=self.student_user.username) self.assertEqual(self.get_progress_detail(), u'2/2') - # Verify that the user dropdown links have not changed - self.verify_real_user_profile_link() - # Temporarily override the student state. self.submit_answer('Correct', 'Incorrect') self.assertEqual(self.get_progress_detail(), u'1/2') @@ -461,7 +444,6 @@ class TestStaffMasqueradeAsSpecificStudent(StaffMasqueradeTestCase, ProblemSubmi masquerade_progress = self.get_progress_page().content self.assertNotIn("1 of 2 possible points", masquerade_progress) self.assertIn("2 of 2 possible points", masquerade_progress) - self.verify_real_user_profile_link() @attr(shard=1) diff --git a/lms/djangoapps/learner_dashboard/views.py b/lms/djangoapps/learner_dashboard/views.py index 4dc2baf769..afab6be29c 100644 --- a/lms/djangoapps/learner_dashboard/views.py +++ b/lms/djangoapps/learner_dashboard/views.py @@ -35,6 +35,7 @@ def program_listing(request): 'programs': meter.engaged_programs, 'progress': meter.progress(), 'show_program_listing': programs_config.enabled, + 'show_dashboard_tabs': True, 'uses_pattern_library': True, } @@ -75,6 +76,7 @@ def program_details(request, program_uuid): context = { 'urls': urls, 'show_program_listing': programs_config.enabled, + 'show_dashboard_tabs': True, 'nav_hidden': True, 'disable_courseware_js': True, 'uses_pattern_library': True, diff --git a/lms/djangoapps/student_account/views.py b/lms/djangoapps/student_account/views.py index 206a565754..49b90e2b9d 100644 --- a/lms/djangoapps/student_account/views.py +++ b/lms/djangoapps/student_account/views.py @@ -555,6 +555,7 @@ def account_settings_context(request): 'user_preferences_api_url': reverse('preferences_api', kwargs={'username': user.username}), 'disable_courseware_js': True, 'show_program_listing': ProgramsApiConfig.is_enabled(), + 'show_dashboard_tabs': True, 'order_history': user_orders } diff --git a/lms/envs/help_tokens.ini b/lms/envs/help_tokens.ini index 4abe982cb2..55ee7702fb 100644 --- a/lms/envs/help_tokens.ini +++ b/lms/envs/help_tokens.ini @@ -5,7 +5,7 @@ default = learner:index.html instructor = course_author:CA_instructor_dash_help.html course = learner:index.html -profile = learner:SFD_dashboard_profile_SectionHead.html +profile = learner:SFD_dashboard_profile_SectionHead.html#adding-profile-information dashboard = learner:SFD_dashboard_profile_SectionHead.html courseinfo = learner:SFD_start_course.html progress = learner:SFD_check_progress.html diff --git a/lms/templates/navigation/bootstrap/navbar-authenticated.html b/lms/templates/navigation/bootstrap/navbar-authenticated.html index 6aa709ddc3..bde233fd52 100644 --- a/lms/templates/navigation/bootstrap/navbar-authenticated.html +++ b/lms/templates/navigation/bootstrap/navbar-authenticated.html @@ -33,15 +33,26 @@ from django.utils.translation import ugettext as _ % endif - % if show_program_listing: + % if show_dashboard_tabs: + % if show_program_listing: + + % endif + <% + self.real_user = getattr(user, 'real_user', user) + is_on_profile_page = data and data.get('profile_user_id') is not None + %> % endif diff --git a/lms/templates/navigation/navbar-authenticated.html b/lms/templates/navigation/navbar-authenticated.html index 20d236cb13..b62b36d7d3 100644 --- a/lms/templates/navigation/navbar-authenticated.html +++ b/lms/templates/navigation/navbar-authenticated.html @@ -16,15 +16,26 @@ from django.utils.translation import ugettext as _ ${_('Explore courses')} % endif - % if show_program_listing: + % if show_dashboard_tabs:
  • ${_("Courses")}
  • + % if show_program_listing: +
  • + + ${_("Programs")} + +
  • + % endif + <% + self.real_user = getattr(user, 'real_user', user) + is_on_profile_page = data and data.get('profile_user_id') is not None + %>
  • - - ${_("Programs")} + + ${_("Profile")}
  • % endif diff --git a/lms/templates/navigation/navbar-logo-header.html b/lms/templates/navigation/navbar-logo-header.html index a800db33a7..b86bd5911b 100644 --- a/lms/templates/navigation/navbar-logo-header.html +++ b/lms/templates/navigation/navbar-logo-header.html @@ -4,6 +4,7 @@ <%namespace name='static' file='../static_content.html'/> <%! +from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from lms.djangoapps.ccx.overrides import get_current_ccx @@ -13,7 +14,7 @@ from branding import api as branding_api