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

Merge pull request #2183 from overleaf/em-plans-faq

Allow linking inside plans FAQ invoice answer

GitOrigin-RevId: 20fb07f0f8fafee65efaa1f4467013cccc7a154d
Simon Detheridge 7 лет назад
Родитель
Сommit
c1f43ad60e

+ 2 - 2
services/web/app/views/subscriptions/_plans_faq.pug

@@ -21,7 +21,7 @@
 		.col-md-6
 			h3 #{translate('faq_purchase_more_licenses_question')}
 			p !{translate('faq_purchase_more_licenses_answer', { groupLink: translate('discounted_group_accounts') })} 
-				a(href, ng-click="openGroupPlanModal()") #{translate("get_in_touch_for_details")}
+				a(href='#groups', ng-click="openGroupPlanModal()") #{translate("get_in_touch_for_details")}
 		.col-md-6
 			h3 #{translate('faq_monthly_or_annual_question')}
 			p #{translate('faq_monthly_or_annual_answer')}
@@ -31,4 +31,4 @@
 			p #{translate('faq_how_to_pay_answer')}
 		.col-md-6
 			h3 #{translate('faq_pay_by_invoice_question')}
-			p !{translate('faq_pay_by_invoice_answer', { groupLink: translate('discounted_group_accounts') })}
+			p !{translate('faq_pay_by_invoice_answer', { payByInvoiceLinkOpen: '<a href="#pay-by-invoice" ng-click="openPayByInvoiceModal()">', payByInvoiceLinkClose: '</a>' })}

+ 20 - 0
services/web/public/src/main/plans.js

@@ -275,6 +275,26 @@ define(['base'], function(App) {
       $scope.openGroupPlanModal()
     }
 
+    $scope.openPayByInvoiceModal = function() {
+      const path = `${window.location.pathname}${window.location.search}`
+      history.replaceState(null, document.title, path + '#pay-by-invoice')
+      $modal
+        .open({
+          templateUrl: 'groupPlanModalInquiryTemplate'
+        })
+        .result.finally(() =>
+          history.replaceState(null, document.title, window.location.pathname)
+        )
+      event_tracking.send(
+        'subscription-funnel',
+        'plans-page',
+        'group-inquiry-potential'
+      )
+    }
+    if ($location.hash() === 'pay-by-invoice') {
+      $scope.openPayByInvoiceModal()
+    }
+
     var eventLabel = (label, location) => label
 
     switchEvent = function(e, label, location) {