diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 616d732bfeadfa7b601cdda989d0c5f8046ba860..559f7e68c829e1b2418e6e9c143ad4458d58b63f 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -800,6 +800,9 @@ def dashboard(request): else: redirect_message = '' + valid_verification_statuses = ['approved', 'must_reverify', 'pending', 'expired'] + display_sidebar_on_dashboard = len(order_history_list) or verification_status in valid_verification_statuses + context = { 'enrollment_message': enrollment_message, 'redirect_message': redirect_message, @@ -833,6 +836,7 @@ def dashboard(request): 'show_program_listing': ProgramsApiConfig.current().show_program_listing, '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, } ecommerce_service = EcommerceService() diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index 002e12a730c3953f1fe1c007e01b2ee3e1d3488c..cc8daffd4782b8fd34e557158042e218c6228ed8 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -155,27 +155,29 @@ from openedx.core.djangolib.markup import HTML, Text <div id="dashboard-search-results" class="search-results dashboard-search-results"></div> % endif - <div class="profile-sidebar" id="profile-sidebar" role="region" aria-label="Account Status Info"> - <header class="profile"> - <h2 class="account-status-title sr">${_("Account Status Info")}: </h2> - </header> - <div class="user-info"> - <ul> - - % if len(order_history_list): - <li class="order-history"> - <span class="title">${_("Order History")}</span> - % for order_history_item in order_history_list: - <span><a href="${order_history_item['receipt_url']}" target="_blank" class="edit-name">${order_history_item['order_date']}</a></span> - % endfor - </li> - % endif - - <%include file="${static.get_template_path('dashboard/_dashboard_status_verification.html')}" /> - - </ul> - </div> + % if display_sidebar_on_dashboard: + <div class="profile-sidebar" id="profile-sidebar" role="region" aria-label="Account Status Info"> + <header class="profile"> + <h2 class="account-status-title sr">${_("Account Status Info")}: </h2> + </header> + <div class="user-info"> + <ul> + + % if len(order_history_list): + <li class="order-history"> + <span class="title">${_("Order History")}</span> + % for order_history_item in order_history_list: + <span><a href="${order_history_item['receipt_url']}" target="_blank" class="edit-name">${order_history_item['order_date']}</a></span> + % endfor + </li> + % endif + + <%include file="${static.get_template_path('dashboard/_dashboard_status_verification.html')}" /> + + </ul> + </div> </div> + % endif </div> </main> diff --git a/themes/edx.org/lms/templates/dashboard.html b/themes/edx.org/lms/templates/dashboard.html index db28f630faf04087d9035f8dc2a9468eea67353c..96376da4254662d259051ddce265a1492241c0f3 100644 --- a/themes/edx.org/lms/templates/dashboard.html +++ b/themes/edx.org/lms/templates/dashboard.html @@ -173,27 +173,29 @@ from openedx.core.djangoapps.theming import helpers as theming_helpers </div> % endif - <section class="profile-sidebar" id="profile-sidebar" role="region" aria-label="Account Status Info"> - <header class="profile"> - <h2 class="account-status-title sr">${_("Account Status Info")}: </h2> - </header> - <section class="user-info"> - <ul> + % if display_sidebar_on_dashboard: + <section class="profile-sidebar" id="profile-sidebar" role="region" aria-label="Account Status Info"> + <header class="profile"> + <h2 class="account-status-title sr">${_("Account Status Info")}: </h2> + </header> + <section class="user-info"> + <ul> - % if len(order_history_list): - <li class="order-history"> - <span class="title">${_("Order History")}</span> - % for order_history_item in order_history_list: - <span><a href="${order_history_item['receipt_url']}" target="_blank" class="edit-name">${order_history_item['order_date']}</a></span> - % endfor - </li> - % endif + % if len(order_history_list): + <li class="order-history"> + <span class="title">${_("Order History")}</span> + % for order_history_item in order_history_list: + <span><a href="${order_history_item['receipt_url']}" target="_blank" class="edit-name">${order_history_item['order_date']}</a></span> + % endfor + </li> + % endif - <%include file="${theming_helpers.get_template_path('dashboard/_dashboard_status_verification.html')}" /> + <%include file="${theming_helpers.get_template_path('dashboard/_dashboard_status_verification.html')}" /> - </ul> + </ul> + </section> </section> - </section> + % endif </section> <section id="email-settings-modal" class="modal" aria-hidden="true">