<ion-view title="汇报" class="rp-index">
  <ion-nav-buttons side="right">
    <button class="button back-button buttons button-clear header-item" ng-if="isSet" ng-click="openManageModel()">
      <i class="icon-setting"></i>
    </button>
  </ion-nav-buttons>

  <ion-content delegate-handle="reportIndexScroll">
    <div class="rp-entry-block row">
      <div class="col col-50" ui-sref="report.receive" nav-direction="forward">
        <div class="rp-icon-entry-block rp-receive">
          <span class="rp-remind" ng-if=" unreadCount && unreadCount != 0 ">{{ unreadCount }}</span>
          <i class="rp-icon-receive"></i>
          <p class="fsl">我收到的</p>
        </div>
      </div>
      <div class="col col-50" ui-sref="report.send" nav-direction="forward">
        <div class="rp-icon-entry-block rp-send">
          <i class="rp-icon-send"></i>
          <p class="fsl">我发出的</p>
        </div>
      </div>
    </div>

    <div class="rp-modules">
      <div class="positive padding-top20" ng-if="loading">模板正在加载中...</div>
      <ul class="row" ng-repeat="group in (templates|concat:null|chunkBy:3:null)">
        <div class="col"
             ng-repeat-start="item in group track by $index"
             ng-if="$parent.$index * 3 + $index !== templates.length"
             ui-sref="report.form({ tid: item.tid })">
          <i class="rp-tpl-icon rp-tpl-icon-{{item.pictureurl}}" ng-if="item"></i>
          <p  ng-if="item">{{ item.tname }}</p>
        </div>
        <div class="col padding-top20" ng-repeat-end ng-click="openAddModal()" ng-if="$parent.$index * 3 + $index === templates.length">
          <i class="icon-plus"></i>
          <p>添加模板</p>
        </div>
      </ul>
    </div>
  </ion-content>
</ion-view>