Нет описания

editor.html 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <% extends 'layout.html' %>
  2. <% block container %>
  3. <script type="text/javascript">
  4. var mailpoet_beacon_articles = [
  5. '5fac13f2cff47e00160b8dff',
  6. '5e43d3ec2c7d3a7e9ae79da9',
  7. ];
  8. </script>
  9. <div class="block-editor">
  10. <div id="mailpoet_form_edit" class="block-editor__container">
  11. </div>
  12. </div>
  13. <script>
  14. <% autoescape 'js' %>
  15. var mailpoet_form_data = <%= json_encode(form) %>;
  16. var mailpoet_form_exports = <%= json_encode(form_exports) %>;
  17. var mailpoet_form_segments = <%= json_encode(segments) %>;
  18. var mailpoet_custom_fields = <%= json_encode(custom_fields) %>;
  19. var mailpoet_date_types = <%= json_encode(date_types) %>;
  20. var mailpoet_date_formats = <%= json_encode(date_formats) %>;
  21. var mailpoet_month_names = <%= json_encode(month_names) %>;
  22. var mailpoet_form_preview_page = <%= json_encode(preview_page_url) %>;
  23. var mailpoet_custom_fonts = <%= json_encode(custom_fonts) %>;
  24. var mailpoet_translations = <%= json_encode(translations) %>;
  25. var mailpoet_all_wp_posts = <%= json_encode(posts) %>;
  26. var mailpoet_all_wp_pages = <%= json_encode(pages) %>;
  27. var mailpoet_all_wp_categories = <%= json_encode(categories) %>;
  28. var mailpoet_all_wp_tags = <%= json_encode(tags) %>;
  29. var mailpoet_woocommerce_products = <%= json_encode(products) %>;
  30. var mailpoet_woocommerce_categories = <%= json_encode(product_categories) %>;
  31. var mailpoet_woocommerce_tags = <%= json_encode(product_tags) %>;
  32. var mailpoet_close_icons_url = '<%= image_url("form_close_icon") %>';
  33. var mailpoet_tutorial_seen = '<%= editor_tutorial_seen %>';
  34. var mailpoet_tutorial_url = '<%= cdn_url('form-editor/tutorial.mp4') %>';
  35. var mailpoet_is_administrator = <%= is_administrator ? 'true' : 'false' %>;
  36. var mailpoet_form_edit_url = "<%= admin_url('admin.php?page=mailpoet-form-editor&id=') %>";
  37. <% endautoescape %>
  38. </script>
  39. <style id="mailpoet-form-editor-form-styles"></style>
  40. <% endblock %>
  41. <% block translations %>
  42. <%= localize({
  43. 'displayForm': __('Display the form'),
  44. 'enable': __('Enable'),
  45. 'addFormName': _x('Add form name', 'A placeholder for form name input'),
  46. 'changesNotSaved': __('The changes you made may not be saved'),
  47. 'back': __('Back'),
  48. 'form': __('Form'),
  49. 'formSettings': _x('Settings', 'A settings section heading'),
  50. 'formSettingsStyles': __('Styles'),
  51. 'formSettingsStylesBackgroundColor': __('Background Color'),
  52. 'formSettingsStylesBackgroundImage': __('Background Image'),
  53. 'formSettingsStylesSelectImage': __('Select Image…'),
  54. 'formSettingsStylesFontSize': __('Font Size'),
  55. 'formSettingsStylesFontColor': __('Font Color'),
  56. 'formSettingsStylesFontColorInherit': __('Inherit from theme'),
  57. 'formSettingsInheritStyleFromTheme': __('Inherit style from theme'),
  58. 'formSettingsDisplayFullWidth': _x('Display Fullwidth', 'A label for checkbox in form style settings'),
  59. 'formSettingsBold': _x('Bold', 'A label for checkbox in form style settings'),
  60. 'formSettingsBorderSize': _x('Border Size', 'A label for checkbox in form style settings'),
  61. 'formSettingsBorderRadius': _x('Border Radius', 'A label for checkbox in form style settings'),
  62. 'formSettingsInputPadding': _x('Input Padding', 'A label for form style settings'),
  63. 'formSettingsFormPadding': _x('Form Padding', 'A label for form style settings'),
  64. 'formSettingsAlignment': _x('Alignment', 'A label for form style settings'),
  65. 'formSettingsAlignmentLeft': _x('left', 'An alignment value for form editor'),
  66. 'formSettingsAlignmentCenter': _x('center', 'An alignment value for form editor'),
  67. 'formSettingsAlignmentRight': _x('right', 'An alignment value for form editor'),
  68. 'formSettingsBorderColor': _x('Border Color', 'A label for checkbox in form style settings'),
  69. 'formSettingsApplyToAll': __('Apply styles to all inputs'),
  70. 'formSettingsWidth': _x('Form width', 'A label for form width settings'),
  71. 'customFieldSettings': _x('Custom field settings', 'A settings section heading'),
  72. 'customFieldsFormSettings': _x('Form settings', 'A settings section heading'),
  73. 'formPlacement': _x('Form Placement', 'A settings section heading'),
  74. 'formPlacementLabel': _x('Form placement', 'A label for a select box'),
  75. 'customCss': _x('Custom CSS', 'A settings section heading'),
  76. 'formSaved': __('Form saved.'),
  77. 'formSavedAppendix': __('Cookies reset — you will see all your dismissed popup forms again.'),
  78. 'customFieldSaved': __('Custom field saved.'),
  79. 'placeFixedBarFormOnPages': _x('Fixed bar', 'This is a text on a widget that leads to settings for form placement - form type is fixed bar'),
  80. 'placeFixedBarFormOnPagesDescription': __('Display your form in a fixed horizontal bar at the top or bottom of posts or pages.'),
  81. 'placeSlideInFormOnPages': _x('Slide–in', 'This is a text on a widget that leads to settings for form placement - form type is slide in'),
  82. 'placeSlideInFormOnPagesDescription': __('Display your form in a slide–in form on top of your page content.'),
  83. 'placePopupFormOnPages': _x('Pop-up', 'This is a text on a widget that leads to settings for form placement - form type is pop-up, it will be displayed on page in a small modal window'),
  84. 'placePopupFormOnPagesDescription': __('Display your form in a pop-up window.'),
  85. 'exitIntentTitle': __('Display on exit-intent'),
  86. 'exitIntentDescription': __('Show the form immediately if the visitor attempts to leave the site.'),
  87. 'exitIntentSwitch': __('Exit-intent display'),
  88. 'placeFormBellowPages': _x('Below pages', 'This is a text on a widget that leads to settings for form placement'),
  89. 'placeFormBellowPagesDescription': __('This form placement allows you to add this form at the end of all the pages or posts, below the content.'),
  90. 'placeFormOnAllPages': _x('Display on all pages', 'This is a text on a switch if a form should be displayed bellow all pages'),
  91. 'placeFormOnAllPosts': _x('Display on all posts/products', 'This is a text on a switch if a form should be displayed bellow all posts'),
  92. 'placeFormOthers': _x('Others (widget)', 'Placement of the form using theme widget'),
  93. 'formPlacementDelay': _x('Display with a delay of', 'Label on a selection of different times'),
  94. 'formPlacementPlacementPosition': _x('Position', 'Placement of a fixed bar form, on top of the page or on the bottom'),
  95. 'formPlacementPlacementPositionTop': _x('top', 'Placement of a fixed bar form, on top of the page or on the bottom'),
  96. 'formPlacementPlacementPositionBottom': _x('bottom', 'Placement of a fixed bar form, on top of the page or on the bottom'),
  97. 'formPlacementPlacementPositionLeft': _x('left', 'Placement of a slide in form, on the left or right side of the page'),
  98. 'formPlacementPlacementPositionRight': _x('right', 'Placement of a slide in form, on the left or right side of the page'),
  99. 'formPlacementDelaySeconds': _x('%1s sec', 'times selection should be in the end "30 sec"'),
  100. 'formPlacementSave': _x('Close', 'Text on a button to save and close a form'),
  101. 'formPlacementOtherLabel': _x('Shortcode & other', 'Label in the form placement section (Other form placements)'),
  102. 'animationHeader': __('Show animation on display'),
  103. 'animationNone': _x('No Animation', 'Value in a selectbox with a list of animations'),
  104. 'addFormWidgetHint': __('You can add this form to a [link]widget area of your theme[/link] (new tab).'),
  105. 'addFormShortcodeHint': __('Or in any page or post as a block, or with this shortcode if you prefer [shortcode].'),
  106. 'addFormPhpIframeHint': __('Use [link]PHP[/link] or [link]iFrame[/link].'),
  107. 'settingsListLabel': __('This form adds the subscribers to these lists'),
  108. 'settingsAfterSubmit': __('After submit…'),
  109. 'settingsShowMessage': __('Show message'),
  110. 'settingsGoToPage': __('Go to Page'),
  111. 'settingsPleaseSelectList': __('Please select a list'),
  112. 'fieldsBlocksCategory': __('Fields'),
  113. 'customFieldsBlocksCategory': __('Custom Fields'),
  114. 'layoutBlocksCategory': __('Layout'),
  115. 'customFieldNumberOfLines': __('Number of lines'),
  116. 'customFieldSaveCTA': _x('Update custom field', 'Text on the save button'),
  117. 'customFieldDeleteCTA': _x('Delete this custom field', 'Text on the delete button'),
  118. 'customFieldDeleteConfirm': __('This field will be deleted for all your subscribers. Are you sure?'),
  119. 'customFieldTypeText': __('Text Input'),
  120. 'customFieldTypeTextarea': __('Text Area'),
  121. 'customFieldTypeRadio': __('Radio buttons'),
  122. 'customFieldTypeCheckbox': __('Checkbox'),
  123. 'customFieldTypeSelect': _x('Select', 'Form input type'),
  124. 'selectPage': _x('Select', 'It is a placeholder in the select box - verb'),
  125. 'displayOnCategories': __('Display on posts with these categories'),
  126. 'displayOnTags': __('Display on posts with these tags'),
  127. 'customFieldTypeDate': __('Date'),
  128. 'customFieldDateType': __('Type of date'),
  129. 'customFieldDateFormat': __('Order'),
  130. 'customFieldDefaultToday': __('Preselect today’s date'),
  131. 'customFieldDay': __('Day'),
  132. 'customFieldMonth': __('Month'),
  133. 'customFieldYear': __('Year'),
  134. 'customField1Line': _x('1 line', 'Number of rows in textarea'),
  135. 'customField2Lines': _x('2 lines', 'Number of rows in textarea'),
  136. 'customField3Lines': _x('3 lines', 'Number of rows in textarea'),
  137. 'customField4Lines': _x('4 lines', 'Number of rows in textarea'),
  138. 'customField5Lines': _x('5 lines', 'Number of rows in textarea'),
  139. 'customFieldValidateFor': __('Validate for'),
  140. 'customFieldValidateNothing': __('Nothing'),
  141. 'customFieldValidateNumbersOnly': __('Numbers only'),
  142. 'customFieldValidateAlphanumerical': __('Alphanumerical'),
  143. 'customFieldValidatePhoneNumber': __('Phone number, (+,-,#,(,) and spaces allowed)'),
  144. 'customFieldAddItem': __('Add item'),
  145. 'blockMandatory': __('Mandatory field'),
  146. 'blockFirstName': __('First name'),
  147. 'blockFirstNameDescription': __('Input field used to catch subscribers’ first names.'),
  148. 'blockLastName': __('Last name'),
  149. 'blockLastNameDescription': __('Input field used to catch subscribers’ last names.'),
  150. 'blockSegmentSelect': __('List selection'),
  151. 'blockLastNameDescription': __('Allow your subscribers to select which list(s) they want to subscribe to.'),
  152. 'blockSegmentSelectLabel': __('Select list(s):'),
  153. 'blockSegmentSelectNoLists': __('Please select at least one list'),
  154. 'blockSegmentSelectListLabel': __('Select the segment that you want to add'),
  155. 'blockEmail': __('Email'),
  156. 'blockEmailDescription': __('Input field used to catch subscribers’ email addresses.'),
  157. 'blockSubmit': __('Submit button'),
  158. 'blockSubmitDescription': __('Button used to submit the form.'),
  159. 'blockSubmitLabel': _x('Subscribe!', 'a default value for a subscription form button'),
  160. 'missingObligatoryBlock': __('Email input or submit is missing. Try reloading the form editor.'),
  161. 'label': _x('Label', 'settings for a label of an input'),
  162. 'displayLabelWithinInput': __('Display label within input'),
  163. 'displayLabel': _x('Display label', 'Settings - if label should be displayed'),
  164. 'blockDivider': _x('Divider / Spacer', 'The name of the block in the editor'),
  165. 'blockCustomHtml' : __('Custom HTML'),
  166. 'blockCustomHtmlDescription': __('Display custom text or HTML code in your form.'),
  167. 'blockCustomHtmlDefault': __('Subscribe to our newsletter and join [mailpoet_subscribers_count] other subscribers.'),
  168. 'blockCustomHtmlContentLabel': _x('Custom text', 'Textarea label'),
  169. 'blockCustomHtmlNl2br': __('Automatically add paragraphs'),
  170. 'blockAddCustomField': __('Create Custom Field'),
  171. 'blockAddCustomFieldDescription': __('Create a new custom field for your subscribers.'),
  172. 'blockAddCustomFieldFormHeading': __('New Custom Field.'),
  173. 'blockCreateButton': _x('Create', 'Label on form submit button.'),
  174. 'customFieldName': _x('Field name', 'Label for form field for custom input name'),
  175. 'selectCustomFieldType': _x('Select a field type', 'Label for form field for custom input type'),
  176. 'customFieldWithNameExists': __('The custom field [name] already exists. Please choose another name.'),
  177. 'successMessage': __('This is what the success message looks like.'),
  178. 'errorMessage': __('This is what the error message looks like.'),
  179. 'formPreview': __('Form Preview'),
  180. 'formSettingsStylesFontFamily': __('Font Family'),
  181. 'formFontsDefaultTheme': __('Theme’s default fonts'),
  182. 'formFontsStandard': _x('Standard fonts', 'Heading in the font selection list: Arial, Times, ...'),
  183. 'formFontsCustom': _x('Custom fonts', 'Heading in the font selection list for a list of custom fonts'),
  184. 'blockSpacerHeight': _x('Height', 'Settings in the spacer block'),
  185. 'blockSpacerEnableDivider': _x('Enable Divider', 'Settings in the spacer block'),
  186. 'imagePlacementScale': _x('Scale', 'How a background image will be rendered: scale, fit or tile'),
  187. 'imagePlacementFit': _x('Fit', 'How a background image will be rendered: scale, fit or tile'),
  188. 'imagePlacementTile': _x('Tile', 'How a background image will be rendered: scale, fit or tile'),
  189. 'blockDividerStyle': _x('Divider Style', 'Settings in the divider block (solid, dotted, …)'),
  190. 'blockDividerStyleSolid': _x('Solid', 'Setting in the divider block'),
  191. 'blockDividerStyleDashed': _x('Dashed', 'Setting in the divider block'),
  192. 'blockDividerStyleDotted': _x('Dotted', 'Setting in the divider block'),
  193. 'blockDividerDividerHeight': _x('Divider Height', 'Settings in the divider block'),
  194. 'blockDividerDividerWidth': _x('Divider Width', 'Settings in the divider block'),
  195. 'blockDividerColor': _x('Color', 'Settings in the divider block'),
  196. 'successValidationColorTitle': _x('Success Message Color', 'heading above the settings'),
  197. 'errorValidationColorTitle': _x('Error Message Color', 'heading above the settings'),
  198. 'formPreviewDesktop': _x('Desktop', 'Desktop browser preview mode'),
  199. 'formPreviewMobile': _x('Mobile', 'Mobile browser preview mode'),
  200. 'formPreviewOthersDisclaimer': __('Psssst. We try our best to show you what the widget might look like, but better check the final result on your website.'),
  201. 'formPreviewMobileDisclaimer': __('Psssst. Forms on mobile appear smaller automatically because it’s better for SEO.'),
  202. 'closeButtonHeading': __('Close Button Style'),
  203. 'tutorialHeading': __('A video tour of the form editor'),
  204. 'noName': _x('no name', 'fallback for forms without a name in a form list'),
  205. }) %>
  206. <% endblock %>
  207. <% block after_javascript %>
  208. <%= javascript('form_editor.js')%>
  209. <% endblock %>