<div id="commentsTabView">
	<div class="newCommentRow comment" data-id="" ng-show="$ctrl.type === 'deck_card'">
		<div class="authorRow">
			<div class="avatardiv" avatar ng-attr-user="{{ $ctrl.currentUser.uid }}" ng-attr-displayname="{{ $ctrl.currentUser.displayName }}" ng-attr-size="24"></div>
			<div class="author currentUser">{{ $ctrl.currentUser.displayName }}</div>
		</div>
		<form class="newCommentForm" ng-submit="$ctrl.postComment()">
			<div ng-contenteditable contenteditable="true" class="message" ng-submit="$ctrl.postComment()" data-placeholder="{{ newCommentString }}" ng-model="$ctrl.$scope.newComment" ng-disabled="$ctrl.status.commentCreateLoading"></div>
			<input class="submit icon-confirm has-tooltip" type="submit"
				   value="" title="" data-original-title="Post" ng-if="!$ctrl.status.commentCreateLoading">
			<div class="submitLoading icon-loading-small" ng-if="$ctrl.status.commentCreateLoading"></div>
		</form>
	</div>
<ul class="activities" infinite-scroll="$ctrl.page()" infinite-scroll-container="'#app-sidebar'" infinite-scroll-disabled="$ctrl.activityservice.running" infinite-scroll-immediate-check="false">
	<li ng-if="$ctrl.loadingNewer()"><div class="icon-loading-small"></div></li>
	<li class="activity box" ng-repeat="activity in $ctrl.getActivityStream() track by $index">
		<div class="activity-icon">
			<img ng-if="!activity.commentModel" src="{{activity.icon}}" alt="">
			<div ng-if="activity.commentModel" avatar ng-attr-contactsmenu="true" ng-attr-size="24" ng-attr-user="{{ activity.commentModel.get('actorId') }}" ng-attr-displayname="{{ activity.actorDisplayName }}"></div>
		</div>
		<span class="activitytime has-tooltip live-relative-timestamp"
			  data-timestamp="{{ activity.timestamp }}">{{ activity.timestamp/1000 | relativeDateFilter }}</span>
		<div class="activitysubject" ng-if="!activity.commentModel" bind-html-compile="$ctrl.parseMessage(activity)"></div>
		<div class="activitysubject commentAuthor" ng-if="activity.commentModel">
			{{ activity.subject_rich[1].user.name }}
			<div class="app-popover-menu-utils">
				<button class="button-inline icon-more ng-pristine ng-valid ng-empty ng-touched" aria-label="Actions"></button>
				<div class="popovermenu hidden menu-left">
					<ul>
						<li><a ng-click="$ctrl.updateComment(activity)" class="menuitem action edit permanent" data-action="edit"><span class="icon icon-rename"></span><span>Edit comment</span></a></li>
						<li><a ng-click="$ctrl.deleteComment(activity)" class="menuitem action delete permanent" data-action="delete"><span class="icon icon-delete"></span><span>Delete comment</span></a></li>
					</ul>
				</div>
			</div>
		</div>
		<div class="activitymessage" ng-if="!activity.commentModel" ng-bind-html="activity.message"></div>
		<div class="activitymessage" ng-if="activity.commentModel && !activity.commentEdit" bind-html-compile="$ctrl.formatMessage(activity)"></div>
		<form class="newCommentForm" ng-show="activity.commentEdit">
			<div ng-contenteditable contenteditable="true" class="message" ng-model="activity.commentEdit"></div>
			<input class="submit icon-confirm has-tooltip" type="submit"
				   value="" title="" data-original-title="Post" ng-click="$ctrl.editComment(activity)">
		</form>
	</li>

	<li ng-if="$ctrl.loading"><div class="icon-loading-small"></div></li>
</ul>
</div>
