Redo the form placement page according the spec
[MAILPOET-2639]
This commit is contained in:
committed by
Jack Kitterhing
parent
353a16fcb5
commit
645e1a825d
@@ -35,7 +35,7 @@ const FormPlacementPanel = ({ onToggle, isOpened }) => {
|
||||
|
||||
const addFormWidgetHint = ReactStringReplace(
|
||||
MailPoet.I18n.t('addFormWidgetHint'),
|
||||
/\[link\](.*?)\[\/link\]/g,
|
||||
/\[link](.*?)\[\/link]/g,
|
||||
(match) => (
|
||||
<a key="addFormWidgetHintLink" href="widgets.php" target="_blank">{match}</a>
|
||||
)
|
||||
@@ -43,15 +43,22 @@ const FormPlacementPanel = ({ onToggle, isOpened }) => {
|
||||
|
||||
const addFormShortcodeHint = ReactStringReplace(
|
||||
MailPoet.I18n.t('addFormShortcodeHint'),
|
||||
/\[link\](.*?)\[\/link\]/g,
|
||||
(match) => (
|
||||
<a key="exportShortcode" href="#" onClick={exportLinkClicked('shortcode')}>{match}</a>
|
||||
)
|
||||
/(\[link].*\[\/link])|(\[shortcode])/g,
|
||||
(match) => {
|
||||
if (match === '[shortcode]') {
|
||||
return (<code key={match}>{formExports.shortcode}</code>);
|
||||
}
|
||||
if (typeof match === 'string' && match.includes('[link]')) {
|
||||
const link = match.replace(/\[.?link]/g, '');
|
||||
return (<a key={match} href="TODO KB link" target="_blank">{link}</a>);
|
||||
}
|
||||
return match;
|
||||
}
|
||||
);
|
||||
|
||||
const addFormPhpIframeHint = ReactStringReplace(
|
||||
MailPoet.I18n.t('addFormPhpIframeHint'),
|
||||
/\[link\](.*?)\[\/link\]/g,
|
||||
/\[link](.*?)\[\/link]/g,
|
||||
(match) => {
|
||||
if (match === 'PHP') {
|
||||
return (<a key="exportPHP" href="#" onClick={exportLinkClicked('php')}>{match}</a>);
|
||||
@@ -76,8 +83,8 @@ const FormPlacementPanel = ({ onToggle, isOpened }) => {
|
||||
return (
|
||||
<Panel>
|
||||
<PanelBody title={MailPoet.I18n.t('formPlacement')} opened={isOpened} onToggle={onToggle}>
|
||||
<p>{addFormWidgetHint}</p>
|
||||
<p>{addFormShortcodeHint}</p>
|
||||
<p>{addFormWidgetHint}</p>
|
||||
<p>{addFormPhpIframeHint}</p>
|
||||
{getCopyTextArea()}
|
||||
</PanelBody>
|
||||
|
@@ -40,9 +40,9 @@
|
||||
'customCss': _x('Custom CSS', 'A settings section heading'),
|
||||
'formSaved': __('Form saved.'),
|
||||
'customFieldSaved': __('Custom field saved.'),
|
||||
'addFormWidgetHint': __('Add this form to your sidebar or footer on the [link]Widgets page[/link].'),
|
||||
'addFormShortcodeHint': __('Copy and paste this [link]shortcode[/link] on to a post or page.'),
|
||||
'addFormPhpIframeHint': __('[link]PHP[/link] and [link]iFrame[/link] versions are also available.'),
|
||||
'addFormWidgetHint': __('Add this form to a [link]widget area[/link].'),
|
||||
'addFormShortcodeHint': __('[link]Use Gutenberg block[/link] available on any page or post. Or use the shortcode [shortcode].'),
|
||||
'addFormPhpIframeHint': __('Use [link]PHP[/link] or [link]iFrame[/link].'),
|
||||
'settingsListLabel': __('This form adds the subscribers to these lists'),
|
||||
'settingsAfterSubmit': __('After submit…'),
|
||||
'settingsShowMessage': __('Show message'),
|
||||
|
Reference in New Issue
Block a user