diff --git a/static/styles/popovers.css b/static/styles/popovers.css index a8d73c0b49..cad2a33c1c 100644 --- a/static/styles/popovers.css +++ b/static/styles/popovers.css @@ -383,6 +383,10 @@ ul { #profile-tab { margin: 1px 5px 0; + + li.custom_user_field { + display: block; + } } .top { diff --git a/static/templates/user_custom_profile_fields.hbs b/static/templates/user_custom_profile_fields.hbs new file mode 100644 index 0000000000..051351bd91 --- /dev/null +++ b/static/templates/user_custom_profile_fields.hbs @@ -0,0 +1,31 @@ +{{#each profile_fields}} +
  • + {{#unless ../for_user_info_popover}} +
    {{this.name}}
    + {{/unless}} + {{#if this.is_link}} + {{this.value}} + {{else if this.is_external_account}} + + {{#if ../for_user_info_popover}} + {{#if (eq this.subtype "github") }} + + {{else if (eq this.subtype "twitter") }} + + {{/if}} + {{/if}} + {{this.value}} + + {{else if this.is_user_field}} +
    + +
    + {{else}} + {{#if this.rendered_value}} + {{rendered_markdown this.rendered_value}} + {{else}} + {{this.value}} + {{/if}} + {{/if}} +
  • +{{/each}} diff --git a/static/templates/user_info_popover_content.hbs b/static/templates/user_info_popover_content.hbs index 52b2f53368..99b4bc9ecc 100644 --- a/static/templates/user_info_popover_content.hbs +++ b/static/templates/user_info_popover_content.hbs @@ -50,29 +50,7 @@
  • {{ user_type }}
  • {{/if}} {{!-- Display selected custom profile fields in this popover. --}} - {{#each display_profile_fields}} -
  • - {{#if this.is_link}} - {{this.value}} - {{else if this.is_external_account}} - - {{#if (eq this.subtype "github") }} - - {{else if (eq this.subtype "twitter") }} - - {{/if}} - {{this.value}} - - {{else}} - {{#if this.rendered_value}} - {{rendered_markdown this.rendered_value}} - {{else}} - {{this.value}} - {{/if}} - {{/if}} -
  • - {{/each}} - + {{> user_custom_profile_fields profile_fields=display_profile_fields for_user_info_popover=true}}
  • {{#tr}}Joined {date_joined}{{/tr}}
  • diff --git a/static/templates/user_profile_modal.hbs b/static/templates/user_profile_modal.hbs index f98b3b3432..08e27b1d51 100644 --- a/static/templates/user_profile_modal.hbs +++ b/static/templates/user_profile_modal.hbs @@ -81,26 +81,7 @@ {{/if}} {{else}} - {{#each profile_data}} -
    -
    {{this.name}}
    - {{#if this.is_user_field}} -
    - -
    - {{else if this.is_link}} - {{this.value}} - {{else if this.is_external_account}} - {{this.value}} - {{else}} - {{#if this.rendered_value}} -
    {{rendered_markdown this.rendered_value}}
    - {{else}} -
    {{this.value}}
    - {{/if}} - {{/if}} -
    - {{/each}} + {{> user_custom_profile_fields profile_fields=profile_data}} {{/if}}