I have this form:
<form {{action 'resetPassword' on="submit"}}>
{{input type="password" value=newPassword placeholder="reset password"}}<br>
{{#if newPassword}}
{{input type="password" value=confirmPassword placeholder="confirm password"}}
{{#if passwordOK}}
<button>Reset</button>
{{/if}}
{{/if}}
</form>
It relies on the resetPassword action being available and also the passwordOK function which tests that a password has been entered and that the confirmation matches.
This is all smashing but the logic for whether the currently logged in user can see this form to edit the password of a particular user is complex. Developer users can do anything but are also protected from administrators who can edit normal users passwords.
The upshot is, I think I need to access this form multiple times in my template. So I assume I should make it into a component.
How can I turn this form into a reusable component?
Aucun commentaire:
Enregistrer un commentaire