FEATURE: add user profile public fields plugin putlet

This commit is contained in:
Arpit Jalan 2016-03-17 21:20:01 +05:30
parent 699b0d3e57
commit 577f0e9e4e
2 changed files with 4 additions and 1 deletions

View File

@ -71,6 +71,7 @@ export default Ember.Controller.extend(CanCheckEmails, {
if (!Ember.isEmpty(siteUserFields)) {
const userFields = this.get('model.user_fields');
return siteUserFields.filterProperty('show_on_profile', true).sortBy('position').map(field => {
field.dasherized_name = field.get('name').dasherize();
const value = userFields ? userFields[field.get('id').toString()] : null;
return Ember.isEmpty(value) ? null : Ember.Object.create({ value, field });
}).compact();

View File

@ -90,12 +90,14 @@
<div class="public-user-fields">
{{#each uf in publicUserFields}}
{{#if uf.value}}
<div class="public-user-field">
<div class="public-user-field {{uf.field.dasherized_name}}">
<span class="user-field-name">{{uf.field.name}}</span>:
<span class="user-field-value">{{uf.value}}</span>
</div>
{{/if}}
{{/each}}
{{plugin-outlet "user-profile-public-fields"}}
</div>
{{/if}}