<div ng-controller="HomeCtrl as home" ng-cloak>
  <div class="row hidden-xs hidden-sm">
    <div ng-controller="ProfilesCtrl as profiles">
      <div ng-repeat="profile in profiles.members">
        <div ng-if="!profile.isWoz" class="col-xs-12 col-md-4 text-center">
          <div class="profile-border profile-icon-top">
            <p>
              <a href="<%= profile_path %>/{{ profile.id }}" data-no-turbolink="true">
                <div><img ng-src="{{ profile.iconSrc }}"></div>
                <div>{{ profile.username }}</div>
              </a>
            </p>
          </div>

          <div class="profile-border profile-last-seen">
            <p ng-class="profile.isAdmin ? 'invisible' : ''">
              Last seen: {{ profile.latestAction | timeFromNow }}
            </p>
          </div>
        </div>
      </div>
    </div>
  </div>
  <ul class="list-group profile-icon-top" ng-show="home.inFeedBrowseMode()">
    <li class="list-group-item">
      <button class="btn-link faded" ng-click="home.newOnYourMindStatement();">What's on your mind?</button>
    </li>
  </ul>
  <form novalidate role="form" name="onYourMindForm" class="row" ng-show="home.inOnYourMindEntryMode()">
    <div class="form-group col-lg-8 col-md-8">
      <label for="new-on-your-mind-description">What's on your mind?</label>
      <input type="text" class="form-control" id="new-on-your-mind-description" ng-model="home.onYourMindModel.description" ng-maxlength="home.textMaxLength" required focus-on="new-goal" ng-focus="home.showCharLimit('input#new-on-your-mind-description')">
    </div>

    <div class="form-group col-lg-8 col-md-8">
      <button class="btn btn-primary" ng-click="home.saveOnYourMind()" ng-disabled="onYourMindForm.$invalid">Save</button>
      <button class="btn btn-default" ng-click="home.cancelOnYourMindEntryMode()">Cancel</button>
    </div>
  </form>

  <%= render "social_networking/homes/action_items" %>
  <ul class="list-group"
    id="infinite-feed"
    infinite-scroll="home.getMore()"
    infinite-scroll-immediate-check="true"
    infinite-scroll-disabled="false">
    <%= render "social_networking/shared/infinite_feed" %>
  </ul>

  <div ng-repeat="profile in home.memberProfiles">
    <div profile-status></div>
  </div>
</div>

<script>
  angular.module('socialNetworking.values')
    .value('currentParticipantId', <%= current_participant.id %>)
    .value('participantId', <%= current_participant.id %>)
    .value('actionItems', <%= action_items.to_json.html_safe %>)
    .value('feedItems', <%= feed_items.to_json.html_safe %>)
    .value('memberProfiles', <%= member_profiles.to_json.html_safe %>)
    .value('noticesEnabled', <%= Rails.configuration.enable_notices %>)
    .value('noticeUtility', Notice)
    .value('resource', 'shared_items');
</script>