@ -45,6 +45,7 @@ define([
'cp-support-list' ,
'cp-support-list' ,
] ,
] ,
'new' : [ // Msg.support_cat_new
'new' : [ // Msg.support_cat_new
'cp-support-subscribe' ,
'cp-support-language' ,
'cp-support-language' ,
'cp-support-form' ,
'cp-support-form' ,
] ,
] ,
@ -166,28 +167,31 @@ define([
return $div ;
return $div ;
} ;
} ;
Messages . support _premiumPriority = "Premium users help support improvements to CryptPad's usability and benefit from prioritized responses to their support tickets." ; // XXX
create [ 'subscribe' ] = function ( ) {
Messages . support _premiumLink = 'View subscription options.' ; // XXX
if ( ! Pages . areSubscriptionsAllowed ( ) ) { return ; }
var url = Pages . accounts . upgradeURL ;
// Create a new tickets
create [ 'form' ] = function ( ) {
var key = 'form' ;
var $div = makeBlock ( key , true ) ; // Msg.support_formHint, .support_formTitle, .support_formButton
Pages . documentationLink ( $div . find ( 'a' ) [ 0 ] , 'https://docs.cryptpad.fr/en/user_guide/index.html' ) ;
var accountsLink = h ( 'a' , {
var accountsLink = h ( 'a' , {
href : Pages . accounts . upgradeURL ,
href : url ,
} , Messages . support _premiumLink , ) ;
} , Messages . support _premiumLink ) ;
$ ( accountsLink ) . click ( function ( ev ) {
ev . preventDefault ( ) ;
common . openURL ( url ) ;
} ) ;
var premium = h ( "div.alert.alert-info" , [
return $ ( h ( 'div.cp-support-subscribe.cp-sidebarlayout-element' , [
h ( 'div.alert.alert-info' , [
Messages . support _premiumPriority ,
Messages . support _premiumPriority ,
' ' ,
' ' ,
accountsLink ,
accountsLink ,
] ) ;
] ) ,
] ) ) ;
} ;
if ( Pages . areSubscriptionsAllowed ( ) ) {
// Create a new tickets
$div . find ( '.cp-sidebarlayout-description' ) . append ( premium ) ;
create [ 'form' ] = function ( ) {
}
var key = 'form' ;
var $div = makeBlock ( key , true ) ; // Msg.support_formHint, .support_formTitle, .support_formButton
Pages . documentationLink ( $div . find ( 'a' ) [ 0 ] , 'https://docs.cryptpad.fr/en/user_guide/index.html' ) ;
var form = APP . support . makeForm ( ) ;
var form = APP . support . makeForm ( ) ;