Просмотр исходного кода

Only show university info box on new plans page student tab (#8823)

GitOrigin-RevId: 057baae295443d9a924b4b0754cdb12ebe330976
M Fahru 4 лет назад
Родитель
Сommit
4dbabe3a8d

+ 4 - 1
services/web/app/views/subscriptions/plans-marketing/v2/_university_info.pug

@@ -1,4 +1,7 @@
-.row.row-spaced-large.text-centered
+.row.row-spaced-large.text-centered(
+	data-ol-plans-university-info-container
+	hidden
+)
 	.col-sm-8.col-sm-offset-2.col-xs-12.card.plans-v2-university-info
 	.col-sm-8.col-sm-offset-2.col-xs-12.card.plans-v2-university-info
 		h3.plans-v2-university-info-header #{translate('would_you_like_to_see_a_university_subscription')}
 		h3.plans-v2-university-info-header #{translate('would_you_like_to_see_a_university_subscription')}
 		p.plans-v2-university-info-text #{translate('student_and_faculty_support_make_difference')}
 		p.plans-v2-university-info-text #{translate('student_and_faculty_support_make_difference')}

+ 8 - 0
services/web/frontend/js/pages/user/subscription/plans-v2/plans-v2-main.js

@@ -50,6 +50,8 @@ function selectTab(viewTab) {
   } else {
   } else {
     toggleMonthlyAnnualSwitching(viewTab, currentMonthlyAnnualSwitchValue)
     toggleMonthlyAnnualSwitching(viewTab, currentMonthlyAnnualSwitchValue)
   }
   }
+
+  toggleUniversityInfo(viewTab)
 }
 }
 
 
 function setUpTabSwitching() {
 function setUpTabSwitching() {
@@ -90,6 +92,12 @@ function setUpGroupPlanPricingChange() {
     )
     )
 }
 }
 
 
+function toggleUniversityInfo(viewTab) {
+  const el = document.querySelector('[data-ol-plans-university-info-container]')
+
+  el.hidden = viewTab !== 'student'
+}
+
 function selectViewFromHash() {
 function selectViewFromHash() {
   try {
   try {
     const params = new URLSearchParams(window.location.hash.substring(1))
     const params = new URLSearchParams(window.location.hash.substring(1))