FIX: Do not show Add or Change buttons if email is not editable (#10068)

This commit is contained in:
Dan Ungureanu 2020-06-18 11:15:44 +03:00 committed by GitHub
parent 75991a249e
commit 62faa0f5fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,9 +50,11 @@
<div class="emails">
{{#each emails as |email|}}
<div class="row email">
{{email-dropdown email=email
setPrimaryEmail=(action "setPrimaryEmail")
destroyEmail=(action "destroyEmail")}}
{{#if model.can_edit_email}}
{{email-dropdown email=email
setPrimaryEmail=(action "setPrimaryEmail")
destroyEmail=(action "destroyEmail")}}
{{/if}}
<div class="email-first">{{email.email}}</div>
@ -77,9 +79,11 @@
{{/each}}
</div>
{{#link-to "preferences.email" (query-params new=1) class="pull-right"}}
{{d-icon "plus"}} {{i18n "user.email.add_email"}}
{{/link-to}}
{{#if model.can_edit_email}}
{{#link-to "preferences.email" (query-params new=1) class="pull-right"}}
{{d-icon "plus"}} {{i18n "user.email.add_email"}}
{{/link-to}}
{{/if}}
{{else}}
<div class="controls">
<span class="static">{{model.email}}</span>