hummingbird-me/hummingbird

View on GitHub
frontend/app/templates/group/index.hbs

Summary

Maintainability
Test Coverage
<div class="group-content">
  <div class="row">
    <div class="secondary-info">

      {{! Group Details }}
      <div class="group-about-panel">
        <div class="panel-heading">
          <h3 class="panel-title">Group Details</h3>
          <span class="edit-panel">
            {{#if controllers.group.isAdmin}}
              {{#if isEditing}}
                <button class="btn btn-default btn-xs" {{action "saveGroupDetails"}}> Save</button>
              {{else}}
                <a {{action "editGroupDetails"}}>
                  <i class="fa fa-pencil"></i>
                </a>
              {{/if}}
            {{/if}}
          </span>
        </div>
        <div class="panel-body">
          {{#if isEditing}}
            <div {{bind-attr class=":edit-bio-chars aboutCharactersLeft:hasleft:noleft"}}>
              {{aboutCharacterCount}} left
            </div>
            {{textarea class="edit-bio" rows="3" placeholder="Tell us about your group." value=group.truncatedAbout}}
          {{else}}
            <p class="about">
              {{#if group.aboutDisplay}}
                {{{group.aboutDisplay}}}
              {{/if}}
            </p>
          {{/if}}
        </div>
      </div>

      {{! Ad unit }}
      <div class="feed-sm-sidebar-advert">
        {{ad-unit adId="1298407" adClass="257f81e798bd68dd81e60f42838f361f"}}
      </div>

      {{! Group Members }}
      <div class="group-members-panel">
        <div class="panel-heading">
          <h3 class="panel-title">Group Members</h3>
        </div>
        <div class="panel-body">
          <ul>
            {{#each recentMembers as |member|}}
              <li {{bind-attr data-tooltip=member.user.username}}>
                {{#link-to 'user' member.user.username}}
                  {{avatar member.user 'thumb'}}
                {{/link-to}}
              </li>
            {{/each}}
          </ul>
          {{#if shouldViewAllMembers}}
            <div class="more-wrapper">
              {{#link-to 'group.members' class='view-more-button'}}
                View All ({{group.memberCount}})
              {{/link-to}}
            </div>
          {{/if}}
        </div>
      </div>

      {{! Suggested Groups }}
      <div class="group-suggestions-panel">
        <div class="panel-heading">
          <h3 class="panel-title">Suggested Groups</h3>
        </div>
        <div class="panel-body">
          <ul>
            {{#each suggestedGroups as |group|}}
              <li>
                {{group-box group=group}}
              </li>
            {{/each}}
          </ul>
          <div class="more-wrapper">
            {{#link-to 'groups' class='view-more-button'}}
              View All
            {{/link-to}}
          </div>
        </div>
      </div>

      {{! Ad unit }}
      <div class="feed-sidebar-advert">
        {{ad-unit adId="1298406" adClass="257f81e798bd68dd81e60f42838f361f"}}
      </div>
    </div>

    {{! Group Feed }}
    <div class="group-feed">
      {{#if group.currentMember}}
        {{#unless group.currentMember.pending}}
            {{post-comment action="postComment"}}
        {{/unless}}
      {{/if}}

      {{#each model itemController="story" as |story|}}
        {{#with story as |story|}}
          {{view "story" content=story}}
        {{/with}}
      {{/each}}

      {{#if canLoadMore}}
        {{load-more classNames="light" action="loadNextPage"}}
      {{/if}}
    </div>
  </div>
</div>