DEV: render-invitee helper
This commit is contained in:
		
							parent
							
								
									02cc7a4a41
								
							
						
					
					
						commit
						43c62d6cec
					
				| 
						 | 
				
			
			@ -10,12 +10,7 @@
 | 
			
		|||
  <ul class="invitees">
 | 
			
		||||
    {{#each invitees as |invitee|}}
 | 
			
		||||
      <li class="invitee">
 | 
			
		||||
        <span class="user">
 | 
			
		||||
          {{avatar invitee.user imageSize="medium"}}
 | 
			
		||||
          <span class="username">
 | 
			
		||||
            {{format-username invitee.user.username}}
 | 
			
		||||
          </span>
 | 
			
		||||
        </span>
 | 
			
		||||
        {{render-invitee invitee}}
 | 
			
		||||
        {{#if invitee.status}}
 | 
			
		||||
          <span class="status {{invitee.status}}">
 | 
			
		||||
            {{i18n (concat "event.invitee_status." invitee.status)}}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,21 @@
 | 
			
		|||
import { renderAvatar } from "discourse/helpers/user-avatar";
 | 
			
		||||
import { userPath } from "discourse/lib/url";
 | 
			
		||||
import { htmlHelper } from "discourse-common/lib/helpers";
 | 
			
		||||
import { htmlSafe } from "@ember/template";
 | 
			
		||||
import { formatUsername } from "discourse/lib/utilities";
 | 
			
		||||
 | 
			
		||||
export default htmlHelper(invitee => {
 | 
			
		||||
  const path = userPath(invitee.user.username);
 | 
			
		||||
  const template = `
 | 
			
		||||
    <a href="${path}" data-user-card="${invitee.user.username}">
 | 
			
		||||
      <span class="user">
 | 
			
		||||
        ${renderAvatar(invitee.user, { imageSize: "medium" })}
 | 
			
		||||
        <span class="username">
 | 
			
		||||
         ${formatUsername(invitee.user.username)}
 | 
			
		||||
        </span>
 | 
			
		||||
      </span>
 | 
			
		||||
    </a>
 | 
			
		||||
  `;
 | 
			
		||||
 | 
			
		||||
  return htmlSafe(template);
 | 
			
		||||
});
 | 
			
		||||
		Loading…
	
		Reference in New Issue