unserver-unify
Version:
255 lines (254 loc) • 12.8 kB
HTML
<div class="frm" ng-controller="TopicCtrl as ctrl">
<div class="col-md-9" ng-if="!ctrl.editmode">
<div class="profile">
<div class="panel-body white-bg margin-bottom-30">
<div class="media media-v2">
<a class="pull-left" href="">
<img class="media-object rounded-x" height="80" ng-src="{{ topic.author_url }}" width="80"/>
</a>
<div class="media-body">
<h4 class="media-heading">
<strong ng-bind-html="topic.title">
</strong>
<a class="btn-u btn-u-green btn-xs" style="color: #fff" ui-sref="index.courses.course({ cid: topic.cid,cs:getCheckSum(topic.cid) })">
<i class="fa fa-link">
</i>
{{'Click to see the related course'| translate}}
</a>
<small>
{{ topic.create_at | date: 'M/d/yy' }}
</small>
</h4>
<p style="color:#0B426D">
<a ui-sref="index.setting.profile({ id: topic.author.loginname ,cs:getCheckSum(topic.author.loginname)})">
{{ topic.author.fullname }} @{{ topic.author.loginname }}
</a>
</p>
<ul class="list-inline results-list pull-left">
<li>
{{ topic.visit_count || 0 }} {{'Views'|translate}}
</li>
<li>
{{ topic.goodcount || 0 }} {{'Likes'|translate}}
</li>
<li>
{{ topic.reply_count || 0 }} {{'Comments'|translate}}
</li>
<li ng-if="topic.top">
<span class="badge badge-danger red">
{{'TOP'|translate}}
</span>
</li>
</ul>
<ul class="list-inline pull-right">
<li class="cmnt_clr" ng-if="ctrl.adminflag||loginService.user._id==topic.author_id">
<a class="cursor-pointer" ng-click="ctrl.edit()" title="{{'Edit'|translate}}">
<i class="expand-list rounded-x fa fa-pencil-square-o">
</i>
</a>
</li>
<li class="cmnt_clr">
<a class="Comment cursor-pointer" ng-click="ctrl.scrollToEdit()" title="{{'Reply'|translate}}">
<i class="expand-list rounded-x fa fa-comment">
</i>
</a>
</li>
<li class="like_clr" ng-if="loginService.user && loginService.isLogged" title="{{'Like'|translate}}">
<i class="expand-list rounded-x fa fa-heart-o cursor-pointer" ng-click="ctrl.good(topic._id, true)" ng-if="!topic.thumb">
</i>
<i class="expand-list rounded-x fa fa-heart" ng-if="topic.thumb">
</i>
</li>
<li class="top_clr" ng-if="topic.top">
<a class="cursor-pointer" ng-click="ctrl.top(topic._id, false)" ng-if="loginService.user.is_admin " title="Cancel Top">
<i class="fa fa-star expand-list rounded-x">
</i>
</a>
<i class="fa fa-star expand-list rounded-x" ng-if="!loginService.user.is_admin">
</i>
</li>
<li class="cursor-pointer top_clr" ng-click="ctrl.top(topic._id, true)" ng-if="loginService.user.is_admin && !topic.top" title="Top">
<i class="fa fa-star-o expand-list rounded-x">
</i>
</li>
</ul>
<div class="clearfix">
</div>
<div class="tag-box tag-box-v2 unformat" ng-if="topic.content" style="margin-bottom:5px">
<div ng-bind-html="topic.content">
</div>
<div class="clearfix">
</div>
</div>
<div class="col-sm-8" ng-repeat="file in topic.files" style="border:1px solid #DCDCDC;padding:0.5%;border-radius: 4px;margin-top:0.5%;">
<i aria-hidden="true" class="fa fa-paperclip">
</i>
{{file.result}}
<a aria-hidden="true" class="fa fa-download pull-right" download="" href="{{ctrl.attachmentsURL + file.result}}">
</a>
</div>
</div>
</div>
</div>
<div class="profile margin-bottom-30" ng-if="ctrl.totalCount">
<div class="panel-heading overflow-h">
<h2 class="panel-title heading-sm pull-left">
<i class="fa fa-comments">
</i>
{{ 'Users Comments' | translate }}
</h2>
</div>
<div class="panel-body white-bg">
<div class="media media-v2" current-page="ctrl.currentPage" dir-paginate="reply in ctrl.replies | itemsPerPage: ctrl.pageNumber" total-items="ctrl.totalCount">
<a class="pull-left" ui-sref="index.setting.profile({ id: topic.author.loginname ,cs:getCheckSum(topic.author.loginname)})">
<img class="media-object rounded-x" height="50" ng-src="{{ reply.avatar_url }}" title="{{ reply.authorname }}" width="50"/>
</a>
<div class="media-body">
<h4 class="media-heading">
<strong>
<a ui-sref="index.setting.profile({ id: reply.author.loginname ,cs:getCheckSum(reply.author.loginname)})">
{{ reply.authorname }}
</a>
</strong>
<small>
{{ reply.create_at | date: 'short' }}
</small>
</h4>
<p class="unformat unformat_text unformat_padding" ng-bind-html="reply.content">
</p>
<!-- <div ng-repeat="file in reply.files">
<div class="attachments_doc">
<div class="margin-bottom-4 clearfix"></div>
<a aria-hidden="true" class="fa fa-download" download="" href="{{ctrl.replyAttachmentURL + file}}"><span> {{ file }} </span>
</a>
</div>
</div> -->
<div ng-if="reply.files&&reply.files.length!=0" ng-init="reply.ext=[]">
<div ng-repeat="file in reply.files track by $index" ng-init="reply.ext[$index] = ( file | filterFileExt);" ng-switch="reply.ext[$index]">
<div class="attachments_img" ng-switch-when="png|jpg|jpeg|gif" ng-switch-when-separator="|">
<img ng-src="{{ctrl.replyAttachmentURL + file}}" />
<div class="margin-bottom-4 clearfix"></div>
<a aria-hidden="true" class="fa fa-download" download="" href="{{ctrl.replyAttachmentURL + file}}"><span> {{ file }}</span>
</a>
</div>
<div ng-switch-default class="attachments_doc">
<div class="margin-bottom-4 clearfix"></div>
<i ng-class="{'fa-file-word-o color-blue':(reply.ext[$index]=='docx'||reply.ext[$index]=='doc'),
'fa-file-excel-o color-green':(reply.ext[$index]=='xlsx'||reply.ext[$index]=='xls'),
'fa-file-powerpoint-o color-orange':(reply.ext[$index]=='pptx'||reply.ext[$index]=='ppt'),
'fa-file-pdf-o color-red':reply.ext[$index]=='pdf',
'fa-file-audio-o color-blue':reply.ext[$index]=='mp3',
'fa-file-movie-o color-blue':reply.ext[$index]=='mp4',
'fa-html5 color-blue':reply.ext[$index]=='html'}" class="fa fa-4x"></i>
<div class="margin-bottom-4 clearfix"></div>
<a aria-hidden="true" class="fa fa-download" download="" href="{{ctrl.replyAttachmentURL + file}}"><span> {{ file }}</span>
</a>
</div>
</div>
</div>
<div class="pull-right">
<ul class="list-unstyled list-inline blog-tags" ng-if="loginService.isLogged">
<li class="cursor-pointer dlt_clr" ng-click="ctrl.deleteReplay(reply)" ng-if="loginService.user.is_admin || loginService.user.grole=='admin'" title="{{'Delete'|translate}}">
<i class="fa fa-remove expand-list rounded-x">
</i>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="row" ng-show="ctrl.totalCount >ctrl.pageNumber">
<div class="col-md-12 forum">
<div class="text-right pagination_aln">
<dir-pagination-controls boundary-links="true" class="with-others" on-page-change="ctrl.pageChanged(newPageNumber)" template-url="components/content/dirPagination.tpl.html">
</dir-pagination-controls>
</div>
</div>
</div>
<div class="profile" id="reply_comments" ng-if="loginService.isLogged && topicexist">
<div class="panel-heading overflow-h">
<h2 class="panel-title heading-sm pull-left">
<i class="fa fa-comments">
</i>
{{ 'Add Reply' | translate }}
</h2>
</div>
<div class="panel-body white-bg margin-bottom-30">
<div class="alert alert-error" ng-if="rerror">
<strong style="color: RED;" translate="">
{{ rerror }}
</strong>
</div>
<div class="media media-v2">
<div class="media-body">
<form class="form-horizontal" name="reply_form" ng-class='{"shake":shaking}'>
<div class="form-group alert alert-danger" ng-show="reply_form.reply_content.$invalid && replySubmitted">
<p class="help-block col-xs-12">
The content is required and the length can not less than 10.
</p>
</div>
<div name="reply_content" ng-model="ctrl.r_content" text-angular="">
</div>
<p>
</p>
<div class="clearfix"></div>
<div ng-repeat="file in ctrl.attachmentFiles track by $index">
<div class="attachments_doc">
<div class="margin-bottom-4 clearfix"></div>
<a aria-hidden="true" class="fa fa-download" download="" href="{{ctrl.replyAttachmentURL + file}}"><span> {{ file }} </span>
</a> <a class="fa fa-times" ng-click="ctrl.deleteAttachment($index)"></a>
</div>
</div>
<div class="editor_buttons">
<button class="btn btn-u" ng-click="ctrl.addReply(topic._id)" translate="">
Reply
</button>
<button class="btn btn-primary" ng-click="ctrl.uploadFile()">
<i class="fa fa-picture-o"></i>
{{ 'Insert Image' | translate }}
</button>
<button class="btn btn-info" ng-click="ctrl.uploadAttachment()">
<i class="fa fa-paperclip">
</i>
{{'Insert Attachment' | translate }}
</button>
<button class="btn btn-info" ng-click="ctrl.uploadAttachment(ctrl.videoSetting)">
<i class="fa fa-file-video-o">
</i>
{{'Video Attachment' | translate }}
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-9" ng-if="ctrl.editmode">
<form class="form-horizontal " name="form" ng-class='{"shake":shaking}'>
<div class="form-group">
<div class="col-sm-2">
<label class="control-label" translate="">
Title
</label>
</div>
<div class="col-sm-9 input-group">
<input class="form-control" name="title" ng-minlength="1" ng-model="topic.title" type="text"/>
</div>
</div>
<div name="new_content" ng-if="topic.subtab=='Discuss'" ng-model="topic.content" text-angular="">
</div>
<button class="btn btn-u pull-right" ng-click="ctrl.update(topic)">
<i class="fa fa-refresh">
</i>
{{ 'Update' | translate }}
</button>
<div class="clearfix">
</div>
</form>
</div>
<div class="col-md-3 hidden-xs padding-left-0" ng-include="" src="'app/topic/topicsidebar.html'">
</div>
</div>