assemblymade/coderwall

View on GitHub
app/views/invitations/_team_members.html.haml

Summary

Maintainability
Test Coverage
- # Local params
- # @param [ Team ] - team

%ul#teams
  %li.team{id: dom_id(team)}
    .team-inside.cf
      %h3= team.name
      .members
        - team.top_three_team_members.each do |member|
          =link_to(image_tag(member.avatar.url, class: 'avatar', alt: member.username), profile_path(member.username))
        -if team.size > 3
          .size
            ="+ #{team.size - 3}"
      -if current_user.belongs_to_team?(team)
        =link_to('Stay with this team', team_path(current_user.team, flash: "Great, you're still on team #{current_user.team.name}"), class: 'button stay')
      -else
        =link_to('Join this team', accept_team_path(team, r: params[:r]), class: 'join')