FEATURE: support SSO website and location overrides

Add location and website + the ability to override using SSO using the `sso_overrides_location` and `sso_overrides_website` site settings.
This commit is contained in:
mentalstring
2020-04-28 07:06:35 +01:00
committed by GitHub
parent 23ff071ebd
commit 67f3fe14aa
12 changed files with 89 additions and 12 deletions

View File

@@ -48,6 +48,16 @@ export default Controller.extend({
return canChangeBio;
},
@discourseComputed("model.can_change_location")
canChangeLocation(canChangeLocation) {
return canChangeLocation;
},
@discourseComputed("model.can_change_website")
canChangeWebsite(canChangeWebsite) {
return canChangeWebsite;
},
actions: {
showFeaturedTopicModal() {
showModal("feature-topic-on-profile", {

View File

@@ -17,19 +17,23 @@
{{d-button icon="globe" label="user.use_current_timezone" action=(action "useCurrentTimezone") }}
</div>
<div class="control-group pref-location">
<label class="control-label">{{i18n "user.location"}}</label>
<div class="controls">
{{input type="text" value=model.location class="input-xxlarge" id="edit-location"}}
{{#if model.can_change_location}}
<div class="control-group pref-location">
<label class="control-label">{{i18n "user.location"}}</label>
<div class="controls">
{{input type="text" value=model.location class="input-xxlarge" id="edit-location"}}
</div>
</div>
</div>
{{/if}}
<div class="control-group pref-website">
<label class="control-label">{{i18n "user.website"}}</label>
<div class="controls">
{{input type="text" value=model.website class="input-xxlarge"}}
{{#if model.can_change_website}}
<div class="control-group pref-website">
<label class="control-label">{{i18n "user.website"}}</label>
<div class="controls">
{{input type="text" value=model.website class="input-xxlarge"}}
</div>
</div>
</div>
{{/if}}
{{#each userFields as |uf|}}
<div class="control-group">