unserver-unify
Version:
353 lines • 16.6 kB
HTML
<div class="row" ng-controller="CourseDiscussCtrl as ctrl">
<div class="blog-page blog-item" ng-show="!topic && loginService.isLogged">
<div class="panel panel-body">
<div class="post-comment new_discussion active">
<div class="tag-box tag-box-v6 margin-bottom-30" style="background:#F1F0F0; padding: 10px;">
<div class="form-horizontal">
<h4 style="color:#337ab7; margin-top:0" translate="">
New Discussion
</h4>
</div>
<div class="alert alert-error" ng-if="error">
<strong style="color: RED;" translate="">
{{ error }}
</strong>
</div>
<form class="form-horizontal margin-bottom-10" name="new_form" ng-class='{"shake":shaking}'>
<div class="form-group">
<div class="col-xs-2 padding-left-0">
<label class="control-label" translate="">
Type
</label>
</div>
<div class="col-xs-10 padding-left-0">
<label class="radio-inline" style="padding-top: 0">
<input checked="checked" id="type_discuss" ng-model="ctrl.subtab" type="radio" value="Discuss"/>
<span translate="">
Discussion
</span>
</label>
<label class="radio-inline" style="padding-top: 0">
<input id="type_question" ng-model="ctrl.subtab" type="radio" value="Question"/>
<span translate="">
Question
</span>
</label>
</div>
</div>
<div class="form-group" ng-class='{"has-error":new_form.new_title.$invalid}' ng-if="ctrl.subtab=='Discuss'">
<div class="col-xs-12 no-padding">
<input class="form-control" name="new_title" ng-minlength="1" ng-model="ctrl.newtitle" placeholder="{{'Title here'|translate}}" required="" type="text" />
</div>
<div class="margin-bottom-10"></div>
</div>
<div class="form-group alert alert-danger" ng-if="ctrl.subtab=='Discuss'" ng-show="new_form.new_content.$invalid && addSubmitted">
<p class="help-block col-xs-12">
The content is required and the length can not less than 10.
</p>
<ul class="list-inline comment-list">
<li ng-if="topic.goodcount">
<i class="fa fa-heart">
</i> {{ topic.goodcount }}
</li>
<li>
<i class="fa fa-eye">
</i> {{ topic.visit_count }}
</li>
<li>
<i class="fa fa-comments">
</i> {{ topic.reply_count }}
</li>
</ul>
</div>
<textarea class="form-control" placeholder="{{'Enter your text'|translate}}" ng-model="ctrl.newcontent" ng-if="ctrl.subtab=='Discuss'" rows="4">
</textarea>
<!-- <div name="new_content" ng-if="ctrl.subtab=='Discuss'" ng-model="ctrl.newcontent" text-angular="">
</div> -->
<div class="form-group" ng-class='{"has-error":new_form.new_title.$invalid}' ng-if="ctrl.subtab=='Question'">
<div class="col-xs-12 no-padding">
<textarea class="form-control" placeholder="{{'Ask your question here'|translate}}" ng-minlength="1" ng-model="ctrl.newtitle" rows="4">
</textarea>
<!-- <div ng-model="ctrl.newtitle" text-angular=""></div> -->
</div>
</div>
<div class="col-sm-offset-2 col-sm-8" ng-repeat="file in ctrl.topic.files" style="border:1px solid #DCDCDC;padding:0.5%;border-radius: 4px;margin-top:0.5%;">
{{file.result}}
<a class="pull-right" ng-click="ctrl.deleteAttach(file)" style="font-size:11px;color:grey">
x
</a>
</div>
<button class="btn btn-sm btn-u pull-right" ng-click="ctrl.addPost(new_form)" style="margin-top: 1rem;" type="button">
{{ 'Submit' | translate }}
</button>
<button class="btn btn-sm btn-info pull-right" ng-click="ctrl.addFile()" ng-if="ctrl.subtab=='Discuss'" style="margin-top: 1rem; margin-right: 5px;" type="button">
<i class="fa fa-picture-o">
</i>
{{ 'Image' | translate }}
</button>
<button class="btn btn-sm btn-info pull-right" ng-click="ctrl.addFile2Q()" ng-if="ctrl.subtab=='Question'" style="margin-top: 1rem; margin-right: 5px;" type="button">
<i class="fa fa-picture-o">
</i>
{{ 'Image' | translate }}
</button>
<button class="btn btn-sm btn-primary pull-right" style="margin-top: 1rem; margin-right: 5px;" ng-click="ctrl.uploadAttachment()">
<span class="fa fa-file-text-o">
</span>
{{ 'Upload' | translate }}
</button>
<button class="btn btn-sm btn-warning pull-right" style="margin-top: 1rem; margin-right: 5px;" ui-sref="index.courses.course.section.video">
<span class="fa fa-angle-left">
</span>
{{ 'Back' | translate }}
</button>
<div class="clearfix">
</div>
</form>
</div>
</div>
<table class="table table-striped table-hover" ng-if="!topic && loginService.isLogged" st-pipe="ctrl.getTopics" st-table="displayedTopics">
<thead>
<tr class="info_hed">
<td style="padding:4px 8px; line-height: 40px;">
{{ 'Total'|translate }}:
<span class="badge badge-green rounded-2x">
{{ counter||0 }}
</span>
</td>
<td colspan="3">
<select class="form-control" st-search="subtab">
<option value="">
{{ 'All'|translate }}
</option>
<option value="Question">
{{ 'Question'|translate }}
</option>
<option value="Discuss">
{{ 'Discussion'|translate }}
</option>
</select>
</td>
</tr>
<tr class="info">
<th class="sortable" st-sort="title" translate="">
Topic Title
</th>
<th class="sortable" st-sort="visit_count" translate="">
Views
</th>
<th class="sortable" st-sort="reply_count" translate="">
Replies
</th>
<th class="sortable" st-sort="goodcount" translate="">
Likes
</th>
</tr>
</thead>
<tbody>
<tr ng-if="counter == 0">
<td colspan="4">
<div class="no_record" translate="">
No Records
</div>
</td>
</tr>
<tr ng-repeat="topic in topics">
<td class="hide_img">
<a href="javascript:;" ng-click="ctrl.displaytopic(topic._id)">
<strong ng-bind-html="topic.title"></strong>
</a>
<div class="clearfix"></div>
{{ topic.user.fullname }}
<div class="clearfix"></div>
<span class="info_text">{{ topic.update_at | date : 'dd-MM-yyyy' }}</span>
</td>
<td class="text_indent15">
{{ topic.visit_count || 0 }}
</td>
<td class="text_indent15">
{{ topic.reply_count || 0 }}
</td>
<td class="text_indent15">
{{ topic.goodcount || 0 }}
</td>
</tr>
</tbody>
<tfoot ng-if="counter> ctrl.pageSize">
<tr>
<td class="text-right" colspan="8" st-items-by-page="ctrl.pageSize" st-pagination="" st-template="components/content/tablePagination.html">
</td>
</tr>
</tfoot>
</table>
<!-- End Hot Topics -->
</div>
</div>
<div class="col-md-9 blog-page blog-item">
<div ng-if="topic">
<div class="profile" ng-if="!ctrl.editmode">
<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" style="position:relative; top:-20px;">
<a class="btn btn-warning pull-right btn-xs" ng-click="ctrl.reload()">
<i class="fa fa-angle-left" style="color:#fff;">
</i> {{'Return'|translate}}
</a>
<div class="clearfix"></div>
<h4 class="media-heading">
<strong ng-bind-html="topic.title">
<!-- {{ topic.title }} -->
</strong>
</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 }} {{ topic.create_at | date: 'M/d/yy' }}
</a>
</p>
<div class="tag-box tag-box-v2 unformat" ng-if="topic.content" style="margin-bottom:5px">
<div ng-bind-html="topic.content">
</div>
</div>
<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>
</ul>
<ul class="list-inline pull-right">
<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>
</ul>
<div class="clearfix">
</div>
<div class="col-sm-10" 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}}" style="margin:4px 5px 0 0;">
</a>
</div>
</div>
</div>
</div>
<div class="profile margin-bottom-30" ng-if="topic.replies | notEmpty">
<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" ng-repeat="reply in topic.replies">
<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 class="pull-right">
<ul class="list-unstyled list-inline blog-tags" ng-if="loginService.isLogged">
<li class="cursor-pointer" ng-click="ctrl.deleteReplay(reply)" ng-if="loginService.user.is_admin || loginService.user.grole=='admin'" title="{{'Delete'|translate}}">
<i class="fa fa-remove">
</i>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="profile" id="reply_comments" ng-if="loginService.isLogged && topic">
<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>
<textarea class="form-control margin-bottom-10" placeholder="{{'Add your reply'| translate}}" name="reply_content" ng-model="ctrl.r_content" rows="4"></textarea>
<div class="editor_buttons">
<button class="btn btn-u" ng-click="ctrl.addReply(reply_form, topic._id)" translate="">
Reply
</button>
<button class="btn btn-info" ng-click="ctrl.uploadReplyFile()" type="button">
<i class="fa fa-picture-o"></i>
{{ 'Image' | translate }}
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div 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-info pull-right" ng-click="ctrl.uploadFile()" ng-if="topic.subtab=='Discuss'" type="button">
<i class="fa fa-picture-o">
</i>
{{ 'Insert Image' | translate }}
</button>
<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>
</div>
</div>