|
4 | 4 | * See COPYING.txt for license details.
|
5 | 5 | */
|
6 | 6 |
|
| 7 | +use Magento\Customer\Block\Widget\Name; |
| 8 | + |
7 | 9 | /** @var \Magento\Customer\Block\Form\Edit $block */
|
8 | 10 | ?>
|
9 |
| -<form class="form form-edit-account" action="<?= $block->escapeUrl($block->getUrl('customer/account/editPost')) ?>" method="post" id="form-validate" enctype="multipart/form-data" data-hasrequired="<?= $block->escapeHtmlAttr(__('* Required Fields')) ?>" autocomplete="off"> |
| 11 | +<form class="form form-edit-account" |
| 12 | + action="<?= $block->escapeUrl($block->getUrl('customer/account/editPost')) ?>" |
| 13 | + method="post" id="form-validate" |
| 14 | + enctype="multipart/form-data" |
| 15 | + data-hasrequired="<?= $block->escapeHtmlAttr(__('* Required Fields')) ?>" |
| 16 | + autocomplete="off"> |
10 | 17 | <fieldset class="fieldset info">
|
11 | 18 | <?= $block->getBlockHtml('formkey') ?>
|
12 | 19 | <legend class="legend"><span><?= $block->escapeHtml(__('Account Information')) ?></span></legend><br>
|
13 |
| - <?= $block->getLayout()->createBlock(\Magento\Customer\Block\Widget\Name::class)->setObject($block->getCustomer())->toHtml() ?> |
| 20 | + <?= $block->getLayout()->createBlock(Name::class)->setObject($block->getCustomer())->toHtml() ?> |
14 | 21 |
|
15 | 22 | <?php $_dob = $block->getLayout()->createBlock(\Magento\Customer\Block\Widget\Dob::class) ?>
|
16 | 23 | <?php $_taxvat = $block->getLayout()->createBlock(\Magento\Customer\Block\Widget\Taxvat::class) ?>
|
17 | 24 | <?php $_gender = $block->getLayout()->createBlock(\Magento\Customer\Block\Widget\Gender::class) ?>
|
18 |
| - <?php if ($_dob->isEnabled()) : ?> |
| 25 | + <?php if ($_dob->isEnabled()): ?> |
19 | 26 | <?= $_dob->setDate($block->getCustomer()->getDob())->toHtml() ?>
|
20 | 27 | <?php endif ?>
|
21 |
| - <?php if ($_taxvat->isEnabled()) : ?> |
| 28 | + <?php if ($_taxvat->isEnabled()): ?> |
22 | 29 | <?= $_taxvat->setTaxvat($block->getCustomer()->getTaxvat())->toHtml() ?>
|
23 | 30 | <?php endif ?>
|
24 |
| - <?php if ($_gender->isEnabled()) : ?> |
| 31 | + <?php if ($_gender->isEnabled()): ?> |
25 | 32 | <?= $_gender->setGender($block->getCustomer()->getGender())->toHtml() ?>
|
26 | 33 | <?php endif ?>
|
27 | 34 | <div class="field choice">
|
28 |
| - <input type="checkbox" name="change_email" id="change-email" data-role="change-email" value="1" title="<?= $block->escapeHtmlAttr(__('Change Email')) ?>" class="checkbox" /> |
29 |
| - <label class="label" for="change-email"><span><?= $block->escapeHtml(__('Change Email')) ?></span></label> |
| 35 | + <input type="checkbox" name="change_email" id="change-email" data-role="change-email" value="1" |
| 36 | + title="<?= $block->escapeHtmlAttr(__('Change Email')) ?>" class="checkbox" /> |
| 37 | + <label class="label" for="change-email"> |
| 38 | + <span><?= $block->escapeHtml(__('Change Email')) ?></span> |
| 39 | + </label> |
30 | 40 | </div>
|
31 | 41 | <div class="field choice">
|
32 |
| - <input type="checkbox" name="change_password" id="change-password" data-role="change-password" value="1" title="<?= $block->escapeHtmlAttr(__('Change Password')) ?>"<?php if ($block->getChangePassword()) : ?> checked="checked"<?php endif; ?> class="checkbox" /> |
33 |
| - <label class="label" for="change-password"><span><?= $block->escapeHtml(__('Change Password')) ?></span></label> |
| 42 | + <input type="checkbox" name="change_password" id="change-password" data-role="change-password" value="1" |
| 43 | + title="<?= $block->escapeHtmlAttr(__('Change Password')) ?>" |
| 44 | + <?php if ($block->getChangePassword()): ?> checked="checked"<?php endif; ?> class="checkbox" /> |
| 45 | + <label class="label" for="change-password"> |
| 46 | + <span><?= $block->escapeHtml(__('Change Password')) ?></span> |
| 47 | + </label> |
34 | 48 | </div>
|
35 | 49 | </fieldset>
|
36 | 50 |
|
37 | 51 | <fieldset class="fieldset password" data-container="change-email-password">
|
38 |
| - <legend class="legend"><span data-title="change-email-password"><?= $block->escapeHtml(__('Change Email and Password')) ?></span></legend><br> |
| 52 | + <legend class="legend"> |
| 53 | + <span data-title="change-email-password"><?= $block->escapeHtml(__('Change Email and Password')) ?></span> |
| 54 | + </legend><br> |
39 | 55 | <div class="field email required" data-container="change-email">
|
40 | 56 | <label class="label" for="email"><span><?= $block->escapeHtml(__('Email')) ?></span></label>
|
41 | 57 | <div class="control">
|
42 |
| - <input type="email" name="email" id="email" autocomplete="email" data-input="change-email" value="<?= $block->escapeHtmlAttr($block->getCustomer()->getEmail()) ?>" title="<?= $block->escapeHtmlAttr(__('Email')) ?>" class="input-text" data-validate="{required:true, 'validate-email':true}" /> |
| 58 | + <input type="email" name="email" id="email" autocomplete="email" data-input="change-email" |
| 59 | + value="<?= $block->escapeHtmlAttr($block->getCustomer()->getEmail()) ?>" |
| 60 | + title="<?= $block->escapeHtmlAttr(__('Email')) ?>" |
| 61 | + class="input-text" |
| 62 | + data-validate="{required:true, 'validate-email':true}" /> |
43 | 63 | </div>
|
44 | 64 | </div>
|
45 | 65 | <div class="field password current required">
|
46 |
| - <label class="label" for="current-password"><span><?= $block->escapeHtml(__('Current Password')) ?></span></label> |
| 66 | + <label class="label" for="current-password"> |
| 67 | + <span><?= $block->escapeHtml(__('Current Password')) ?></span> |
| 68 | + </label> |
47 | 69 | <div class="control">
|
48 |
| - <input type="password" class="input-text" name="current_password" id="current-password" data-input="current-password" autocomplete="off" /> |
| 70 | + <input type="password" class="input-text" name="current_password" id="current-password" |
| 71 | + data-input="current-password" |
| 72 | + autocomplete="off" /> |
49 | 73 | </div>
|
50 | 74 | </div>
|
51 | 75 | <div class="field new password required" data-container="new-password">
|
52 | 76 | <label class="label" for="password"><span><?= $block->escapeHtml(__('New Password')) ?></span></label>
|
53 | 77 | <div class="control">
|
| 78 | + <?php $minCharacterSets = $block->getRequiredCharacterClassesNumber() ?> |
54 | 79 | <input type="password" class="input-text" name="password" id="password"
|
55 | 80 | data-password-min-length="<?= $block->escapeHtml($block->getMinimumPasswordLength()) ?>"
|
56 |
| - data-password-min-character-sets="<?= $block->escapeHtml($block->getRequiredCharacterClassesNumber()) ?>" |
| 81 | + data-password-min-character-sets="<?= $block->escapeHtml($minCharacterSets) ?>" |
57 | 82 | data-input="new-password"
|
58 | 83 | data-validate="{required:true, 'validate-customer-password':true}"
|
59 | 84 | autocomplete="off" />
|
|
68 | 93 | </div>
|
69 | 94 | </div>
|
70 | 95 | <div class="field confirmation password required" data-container="confirm-password">
|
71 |
| - <label class="label" for="password-confirmation"><span><?= $block->escapeHtml(__('Confirm New Password')) ?></span></label> |
| 96 | + <label class="label" for="password-confirmation"> |
| 97 | + <span><?= $block->escapeHtml(__('Confirm New Password')) ?></span> |
| 98 | + </label> |
72 | 99 | <div class="control">
|
73 | 100 | <input type="password" class="input-text" name="password_confirmation" id="password-confirmation"
|
74 | 101 | data-input="confirm-password"
|
|
79 | 106 | <?= $block->getChildHtml('form_additional_info') ?>
|
80 | 107 | <div class="actions-toolbar">
|
81 | 108 | <div class="primary">
|
82 |
| - <button type="submit" class="action save primary" title="<?= $block->escapeHtmlAttr(__('Save')) ?>"><span><?= $block->escapeHtml(__('Save')) ?></span></button> |
| 109 | + <button type="submit" class="action save primary" title="<?= $block->escapeHtmlAttr(__('Save')) ?>"> |
| 110 | + <span><?= $block->escapeHtml(__('Save')) ?></span> |
| 111 | + </button> |
83 | 112 | </div>
|
84 | 113 | <div class="secondary">
|
85 |
| - <a class="action back" href="<?= $block->escapeUrl($block->getBackUrl()) ?>"><span><?= $block->escapeHtml(__('Go back')) ?></span></a> |
| 114 | + <a class="action back" href="<?= $block->escapeUrl($block->getBackUrl()) ?>"> |
| 115 | + <span><?= $block->escapeHtml(__('Go back')) ?></span> |
| 116 | + </a> |
86 | 117 | </div>
|
87 | 118 | </div>
|
88 | 119 | </form>
|
|
95 | 126 | var ignore = <?= /* @noEscape */ $_dob->isEnabled() ? '\'input[id$="full"]\'' : 'null' ?>;
|
96 | 127 |
|
97 | 128 | dataForm.mage('validation', {
|
98 |
| - <?php if ($_dob->isEnabled()) : ?> |
| 129 | + <?php if ($_dob->isEnabled()): ?> |
99 | 130 | errorPlacement: function(error, element) {
|
100 | 131 | if (element.prop('id').search('full') !== -1) {
|
101 | 132 | var dobElement = $(element).parents('.customer-dob'),
|
|
109 | 140 | }
|
110 | 141 | },
|
111 | 142 | ignore: ':hidden:not(' + ignore + ')'
|
112 |
| - <?php else : ?> |
| 143 | + <?php else: ?> |
113 | 144 | ignore: ignore ? ':hidden:not(' + ignore + ')' : ':hidden'
|
114 | 145 | <?php endif ?>
|
115 | 146 | });
|
116 | 147 |
|
117 | 148 | });
|
118 | 149 | </script>
|
| 150 | +<?php $changeEmailAndPasswordTitle = $block->escapeHtml(__('Change Email and Password')) ?> |
119 | 151 | <script type="text/x-magento-init">
|
120 | 152 | {
|
121 | 153 | "[data-role=change-email], [data-role=change-password]": {
|
122 | 154 | "changeEmailPassword": {
|
123 | 155 | "titleChangeEmail": "<?= $block->escapeJs($block->escapeHtml(__('Change Email'))) ?>",
|
124 | 156 | "titleChangePassword": "<?= $block->escapeJs($block->escapeHtml(__('Change Password'))) ?>",
|
125 |
| - "titleChangeEmailAndPassword": "<?= $block->escapeJs($block->escapeHtml(__('Change Email and Password'))) ?>" |
| 157 | + "titleChangeEmailAndPassword": "<?= $block->escapeJs($changeEmailAndPasswordTitle) ?>" |
126 | 158 | }
|
127 | 159 | },
|
128 | 160 | "[data-container=new-password]": {
|
|
0 commit comments