<!-- 任务评论页面 -->
<header class="bar bar-header bar-{{barTheme}}">
  <button class="button icon-left ion-ios-arrow-back button-clear sino-back-button" ng-click="goBack()">任务通知</button>
  <h1 class="title"></h1>
  <i class="button button-icon icon ion-ios-reloading" ng-show="loading"></i>
</header>
<div task-pushed-message></div>
<ion-content class="has-header has-tabs message-discussion-content" scroll="true" delegate-handle="mainScroll">
	
	<div class="card">
		<div class="item item-text-wrap">
			<h3>{{shortenStr(task.title)}}</h3>
			<p>{{parseDateStr(task.createDate)}}</p>
		</div>
		<a class="item item-icon-right" ng-click="toTaskDetail()">
		    <span class="reader">阅读全文</span>
	      	<span class="item-note">
	      		{{parseType(task.type)}}
	      	</span>
			<i class="icon ion-chevron-right icon-accessory"></i>
		</a>
	</div>
	<div class="messages">
		<div ng-repeat="item in task.discussions track by item.id" ng-show="showDiscussions" class="{{item.type==='0'?'message':item.sendPerson === loginUserId ? 'discussion-content-group self':'discussion-content-group buddy'}}">
			<span class="message-info">{{parseDateStr(item.sendDate)}} {{item.title}}</span>
			<!-- 聊天信息是当前登录人发送时，日期在前，用户名在后 -->
			<span class="discussion-title" ng-show="item.sendPerson === loginUserId">
				{{parseDateStr(item.sendDate)}}
				<div id-to-name id="item.sendPerson" type="user" show-me="true"></div>
				<!-- <img ng-src="http://112.126.73.50/base-user/user/{{item.sendPerson}}/photo_55x55"> -->
			</span>
			<!-- 聊天信息不是当前登录人发送时，用户名在前，日期在后 -->
			<span class="discussion-title" ng-show="item.sendPerson !== loginUserId">
				<div id-to-name id="item.sendPerson" type="user" show-me="true"></div>
				<!-- <img ng-src="http://112.126.73.50/base-user/user/{{discussion.sendPerson}}/photo_55x55"> -->
				{{parseDateStr(item.sendDate)}}
			</span>
			<!-- 聊天信息发送中，显示loading样式 -->
			<span ng-if="item.status === '3'">
				<i class="icon ion-loading-c" ng-click="cancelSend(item)"></i>
			</span>
			
			<!-- 聊天信息发送失败，显示叹号，点击可以重新发送 -->
			<i class="icon ion-alert" ng-if="item.status === '4'" ng-click="reSend(item)"></i>
			<!-- 聊天信息内容 -->
			<div class="discussion" ng-if="item.content.indexOf('audio-player') === -1">
				<span compile="item.content"></span>
			</div>
			<span style="display:inline-block;" compile="item.content" ng-if="item.content.indexOf('audio-player') !== -1"></span>
		</div>
	</div>
</ion-content>
<div class="bar bar-footer task-content-footer" ng-show="task.status !== '0'" keyboard-attach>
	<div footer-input footer-input-options="footerInputOptions"></div>
</div>
