This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/templates/invites/show.hbs
Sam 918a0ea3a4 FIX: use autocomplete="discourse" to disable Chrome address autofill
https://stackoverflow.com/a/47822599/17174

Chrome 63 and up start ignoring `autofill="off"`

Per: https://bugs.chromium.org/p/chromium/issues/detail?id=468153#c164

> The tricky part here is that somewhere along the journey of the web autocomplete=off become a default for many form fields, without any real thought being given as to whether or not that was good for users. This doesn't mean there aren't very valid cases where you don't want the browser autofilling data (e.g. on CRM systems), but by and large, we see those as the minority cases. And as a result, we started ignoring autocomplete=off for Chrome Autofill data

So to work around this decision we now explicitly say: autocomplete="discourse"
when we don't want Chrome to randomly fill in addressed (aka. always)
2019-02-20 10:15:59 +11:00

70 lines
2.5 KiB
Handlebars

<div class="container invites-show clearfix">
<h2>{{welcomeTitle}}</h2>
<div class="two-col">
<div class="col-image">
<img src={{inviteImageUrl}}>
</div>
<div class="col-form">
{{#if successMessage}}
<br/><br/>
<div class='alert alert-info'><p>{{{successMessage}}}</p></div>
{{else}}
<p>{{i18n 'invites.invited_by'}}</p>
<p>{{user-info user=invitedBy}}</p>
<p>{{{yourEmailMessage}}}
{{#if externalAuthsEnabled}}
{{i18n 'invites.social_login_available'}}
{{/if}}
</p>
<form>
<div class="input username-input">
<label>{{i18n 'user.username.title'}}</label>
{{input value=accountUsername id="new-account-username" name="username" maxlength=maxUsernameLength autocomplete="discourse"}}
&nbsp;{{input-tip validation=usernameValidation id="username-validation"}}
<div class="instructions">{{i18n 'user.username.instructions'}}</div>
</div>
{{#if fullnameRequired}}
<div class="input name-input">
<label>{{i18n 'invites.name_label'}}</label>
{{input value=accountName id="new-account-name" name="name"}}
<div class="instructions">{{nameInstructions}}</div>
</div>
{{/if}}
<div class="input password-input">
<label>{{i18n 'invites.password_label'}}</label>
{{password-field value=accountPassword type="password" id="new-account-password" capsLockOn=capsLockOn}}
&nbsp;{{input-tip validation=passwordValidation}}
<div class="instructions">
{{passwordInstructions}} {{i18n 'invites.optional_description'}}
<div class="caps-lock-warning {{unless capsLockOn 'invisible'}}">
{{d-icon "exclamation-triangle"}} {{i18n 'login.caps_lock_warning'}}</div>
</div>
</div>
{{#if userFields}}
<div class='user-fields'>
{{#each userFields as |f|}}
{{user-field field=f.field value=f.value}}
{{/each}}
</div>
{{/if}}
<button class='btn btn-primary' {{action "submit"}} disabled={{submitDisabled}}>{{i18n 'invites.accept_invite'}}</button>
{{#if errorMessage}}
<br/><br/>
<div class='alert alert-error'>{{errorMessage}}</div>
{{/if}}
</form>
{{/if}}
</div>
</div>
</div>