Files
meanTorrent/modules/forums/client/views/topic.client.view.html
2017-12-14 13:32:38 +08:00

300 lines
22 KiB
HTML

<section ng-controller="ForumsTopicController as vm" ng-init="vm.init();">
<div ng-include="'/modules/forums/client/views/search.client.view.html'"></div>
<div class="container reply-list">
<div class="path margin-top-20">
<ol class="breadcrumb">
<li><a ui-sref="forums.list"><span class="small glyphicon glyphicon-home"></span> {{'FORUMS.HOME_INDEX' | translate}}</a></li>
<li ng-repeat="p in vm.forumPath" ng-class="{'active': !g.state}">
<a ui-sref="{{p.state}}( {{p.params}} )"
ng-if="p.state!=undefined">{{p.name}}
</a>
<span ng-if="p.state==undefined">{{p.name}}</span>
</li>
</ol>
</div>
<div id="top_of_reply_list">
<div class="row">
<div class="col-sm-12">
<div class="box-uib-and-post-btn">
<div class="box-uib">
<ul uib-pagination boundary-links="true" max-size="8" items-per-page="vm.itemsPerPage" total-items="vm.filterLength"
ng-model="vm.currentPage"
ng-change="vm.pageChanged()"
first-text="{{ 'PAGE_TEXT_FIRST' | translate}}" previous-text="{{ 'PAGE_TEXT_PREVIOUS' | translate}}"
next-text="{{ 'PAGE_TEXT_NEXT' | translate}}" last-text="{{ 'PAGE_TEXT_LAST' | translate}}">
</ul>
</div>
<div class="box-post-btn">
<div ng-if="!vm.topic.readOnly || vm.canEdit(vm.topic) || vm.isOwner(vm.topic)">
<a class="btn btn-success btn-width-100"
href="#" ng-click="vm.beginPostReply();">{{'FORUMS.BTN_POST_NEW_REPLY' | translate}}</a>
<a class="btn btn-default btn-width-100"
href="#" ng-if="vm.canEdit(vm.topic) || vm.isOwner(vm.topic)"
ng-click="vm.toggleReadonly(vm.topic);">{{ vm.topic.readOnly ? 'FORUMS.BTN_UNSET_READONLY' : 'FORUMS.BTN_SET_READONLY' | translate}}</a>
</div>
<h5 class="text-danger text-uppercase" translate="FORUMS.READ_ONLY_REPLY"
ng-if="vm.topic.readOnly && !vm.canEdit(vm.topic) && !vm.isOwner(vm.topic)"></h5>
</div>
</div>
</div>
</div>
</div>
<div class="table-responsive table-category">
<table class="table table-valign-middle">
<thead>
<tr>
<th>
<!--<div class="text-long"><span>{{vm.topic.title}}</span></div>-->
<div class="topic-view-title text-long">
<span editable-line readonly="!vm.canEdit() && !vm.isOwner(vm.topic)" ng-model="vm.topic.title" callback="onTopicTitleEdited"></span>
</div>
<div class="count-info xs-hide sm-hide">
<span>{{'FORUMS.FIELDS.VIEWS' | translate}}: {{vm.topic.viewCount}}</span>,
<span>{{'FORUMS.FIELDS.REPLIES' | translate}}: {{vm.topic.replyCount}}</span>
</div>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div class="reply-item">
<!-- topic content -->
<div class="reply-wrapper">
<span user-info="vm.topic.user" info-class="reply-avatar" info-avatar></span>
<div class="reply-comment">
<div class="reply-comment-header">
<div class="reply-comment-header-text">
<span user-info="vm.topic.user" info-name></span>
<span vip-flag="vm.topic.user"></span>
<!--<span score-level-curr="vm.topic.user"></span>-->
<!--<span message-to="vm.topic.user" to-class="message-to-icon"></span>-->
<span class="user-ud-text xs-hide" ng-if="vm.announce.privateTorrentCmsMode">
(<span class="glyphicon glyphicon-arrow-up torrent-up"></span>{{vm.topic.user.uploaded | bytes}}
<span class="glyphicon glyphicon-arrow-down torrent-down"></span>{{vm.topic.user.downloaded | bytes}}
)
</span>
<span class="reply-comment-header-time-text">{{vm.topic.createdAt | date:'yyyy-MM-dd HH:mm:ss'}}</span>
<div class="reply-comment-header-command pull-right">
<i class="fa fa-quote-left" aria-hidden="true"
title="{{'FORUMS.TITLES.REPLY_QUOTE' | translate}}"
ng-click="vm.quoteAndReply(vm.topic);"></i>
<i class="fa fa-pencil-square-o" aria-hidden="true"
title="{{'FORUMS.TITLES.TOPIC_EDIT' | translate}}"
ng-show="vm.canEdit() || vm.isOwner(vm.topic)"
ng-click="vm.beginEditTopic(vm.topic)"></i>
<i class="fa fa-times" aria-hidden="true"
title="{{'FORUMS.TITLES.TOPIC_DELETE' | translate}}"
ng-show="vm.canEdit() || vm.isOwner(vm.topic)"
ng-click="vm.beginDeleteTopic(vm.topic);"></i>
<i class="fa"
ng-class="vm.topic.isTop ? 'fa-arrow-circle-down text-primary' : 'fa-arrow-circle-up'"
aria-hidden="true"
title="{{'FORUMS.TITLES.TOPIC_TOP_TOPIC' | translate}}: {{vm.topic.isTop}}"
ng-show="vm.canEdit()"
ng-click="vm.beginTopTopic(vm.topic);"></i>
<i class="fa" ng-class="vm.topic.isGlobal ? 'fa-download text-primary' : 'fa-upload'"
aria-hidden="true"
title="{{'FORUMS.TITLES.TOPIC_GLOBAL_TOPIC' | translate}}: {{vm.topic.isGlobal}}"
ng-show="vm.user.isOper;"
ng-click="vm.beginGlobalTopic(vm.topic);"></i>
<span ng-click="vm.beginThumbsUp($event, vm.topic, null);" style="position: relative">
<i id="thumbs_{{vm.topic._id}}" class="fa fa-thumbs-up" aria-hidden="true"
mt-scale-by-param="{scale: 3, duration: '.5s'}"
mt-scale-start="false"
title="{{'FORUMS.TITLES.TOPIC_THUMBS_UP' | translate: ({number: vm.scoreConfig.thumbsUpScore.topic}) }}"
>({{vm.topic._thumbs.length}})</i>
</span>
</div>
<div class="reply-floor">{{'FORUMS.FLOOR_POSTER' | translate}}</div>
</div>
</div>
<div class="reply-comment-body">
<div id="{{vm.topic._id}}" data-provide="markdown" class="reply-comment-body-text"
ng-bind-html="vm.getTopicContent(vm.topic)">
</div>
<div class="text-right margin-top-10" ng-show="vm.topic.updatedAt">
<p class="reply-comment-body-edited-text">[ {{vm.topic.updatedBy.displayName}} {{ 'COMMENT_EDITED_INFO' | translate}} {{vm.topic.updatedAt | date:'yyyy-MM-dd HH:mm:ss'}} ]</p>
</div>
<div class="attach-list" ng-if="vm.topic._attach.length">
<div class="attach-header" translate="FORUMS.ATTACH_LIST_HEADER"></div>
<ol>
<li ng-repeat="af in vm.topic._attach track by $index">
<span><a ng-href="#"
ng-click="vm.DLS.downloadForumAttach(vm.topic._id, null, af._id);">{{af.filename}}</a></span> (
<span>{{'FORUMS.ATTACH_FILE_SIZE' | translate}} {{af.filesize | bytes}}</span>
<span>{{'FORUMS.ATTACH_DOWN_COUNT' | translate}} {{af.downCount}}</span> )
</li>
</ol>
</div>
<div class="thumbs-up-list"
ng-if="vm.topic._thumbs.length && vm.forumsConfig.showThumbsUpUserList">
<div class="thumbs-header" translate="FORUMS.THUMBS_LIST_HEADER"
translate-values="{number: vm.topic._thumbs.length}"></div>
<div class="thumbs-users panel-collapsed" id="thumbs-{{vm.topic._id}}">
<span class="thumbs-item"
ng-repeat="sl in vm.topic._thumbs track by $index">
<span user-info="sl.user" info-name></span>
<!--<span vip-flag="sl.user"></span>-->
<!--<span message-to="sl.user" to-class="message-to-icon"></span>-->
</span>
</div>
</div>
</div>
<div class="reply-comment-signature" ng-if="vm.topic.user.signature && vm.forumsConfig.showUserSignature">
<div ng-bind-html="vm.getUserSignatureMarked(vm.topic.user);"></div>
<span class="signature-tag" translate="FORUMS.SIGNATURE_TAG"></span>
</div>
</div>
</div>
<!-- topic replies -->
<div class="reply-wrapper" ng-repeat="rep in vm.pagedItems">
<span user-info="rep.user" info-class="reply-avatar" info-avatar></span>
<div class="reply-comment">
<div class="reply-comment-header">
<div class="reply-comment-header-text">
<span user-info="rep.user" info-name></span>
<span vip-flag="rep.user"></span>
<!--<span score-level="vm.getUserScoreLevel(vm.topic.user);"></span>-->
<!--<span message-to="vm.topic.user" to-class="message-to-icon"></span>-->
<span class="user-ud-text xs-hide" ng-if="vm.announce.privateTorrentCmsMode">
(<span class="glyphicon glyphicon-arrow-up torrent-up"></span>{{rep.user.uploaded | bytes}}
<span class="glyphicon glyphicon-arrow-down torrent-down"></span>{{rep.user.downloaded | bytes}}
)
</span>
<span class="reply-comment-header-time-text">{{rep.createdAt | date:'yyyy-MM-dd HH:mm:ss'}}</span>
<div class="reply-comment-header-command pull-right">
<i class="fa fa-quote-left" aria-hidden="true"
title="{{'FORUMS.TITLES.REPLY_QUOTE' | translate}}"
ng-click="vm.quoteAndReply(rep);"></i>
<i class="fa fa-pencil-square-o" aria-hidden="true"
title="{{'FORUMS.TITLES.REPLY_EDIT' | translate}}"
ng-show="vm.canEdit() || vm.isOwner(rep)"
ng-click="vm.beginEditReply(rep)"></i>
<i class="fa fa-times" aria-hidden="true"
title="{{'FORUMS.TITLES.REPLY_DELETE' | translate}}"
ng-show="vm.canEdit() || vm.isOwner(rep)"
ng-click="vm.beginDeleteReply(rep);"></i>
<span ng-click="vm.beginThumbsUp($event, vm.topic, rep);">
<i id="thumbs_{{rep._id}}" class="fa fa-thumbs-up" aria-hidden="true"
mt-scale-by-param="{scale: 3, duration: '.5s'}"
mt-scale-start="false"
title="{{'FORUMS.TITLES.TOPIC_THUMBS_UP' | translate: ({number: vm.scoreConfig.thumbsUpScore.topic}) }}"
>({{rep._thumbs.length}})</i>
</span>
</div>
<div class="reply-floor">F{{ (vm.currentPage-1) * vm.itemsPerPage + $index + 1 }}</div>
</div>
</div>
<div class="reply-comment-body">
<div id="{{rep._id}}" data-provide="markdown" class="reply-comment-body-text"
ng-bind-html="vm.getTopicContent(rep)">
</div>
<div class="text-right margin-top-10" ng-show="rep.updatedAt">
<p class="reply-comment-body-edited-text">[ {{rep.updatedBy.displayName}} {{ 'COMMENT_EDITED_INFO' | translate}} {{rep.updatedAt | date:'yyyy-MM-dd HH:mm:ss'}} ]</p>
</div>
<div class="attach-list" ng-if="rep._attach.length">
<div class="attach-header" translate="FORUMS.ATTACH_LIST_HEADER"></div>
<ol>
<li ng-repeat="af in rep._attach track by $index">
<span><a ng-href="#"
ng-click="vm.DLS.downloadForumAttach(vm.topic._id, rep._id, af._id);">{{af.filename}}</a></span> (
<span>{{'FORUMS.ATTACH_FILE_SIZE' | translate}} {{af.filesize | bytes}}</span>
<span>{{'FORUMS.ATTACH_DOWN_COUNT' | translate}} {{af.downCount}}</span> )
</li>
</ol>
</div>
<div class="thumbs-up-list" ng-if="rep._thumbs.length && vm.forumsConfig.showThumbsUpUserList">
<div class="thumbs-header" translate="FORUMS.THUMBS_LIST_HEADER"
translate-values="{number: rep._thumbs.length}"></div>
<div class="thumbs-users panel-collapsed" id="thumbs-{{rep._id}}">
<span class="thumbs-item"
ng-repeat="sl in rep._thumbs track by $index">
<span user-info="sl.user" info-name></span>
<!--<span vip-flag="sl.user"></span>-->
<!--<span message-to="sl.user" to-class="message-to-icon"></span>-->
</span>
</div>
</div>
</div>
<div class="reply-comment-signature" ng-if="rep.user.signature && vm.forumsConfig.showUserSignature">
<div ng-bind-html="vm.getUserSignatureMarked(rep.user);"></div>
<span class="signature-tag" translate="FORUMS.SIGNATURE_TAG"></span>
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="pagination-div-bottom">
<ul uib-pagination boundary-links="true" max-size="8" items-per-page="vm.itemsPerPage" total-items="vm.filterLength"
ng-model="vm.currentPage" ng-change="vm.pageChanged()"
first-text="{{ 'PAGE_TEXT_FIRST' | translate}}" previous-text="{{ 'PAGE_TEXT_PREVIOUS' | translate}}"
next-text="{{ 'PAGE_TEXT_NEXT' | translate}}" last-text="{{ 'PAGE_TEXT_LAST' | translate}}">
</ul>
</div>
<div class="table-responsive table-category" id="post-new-reply-table" scroll-if="vm.scrollToReply" ng-if="!vm.topic.readOnly || vm.canEdit(vm.topic)">
<table class="table table-valign-middle margin-bottom-10">
<thead>
<tr>
<th>
<span>{{'FORUMS.BTN_POST_NEW_REPLY' | translate}}</span>
</th>
</tr>
</thead>
</table>
</div>
<div class="reply-post margin-bottom-30" ng-show="!vm.topic.readOnly || vm.canEdit(vm.topic)">
<div class="row">
<div class="col-md-12">
<form name="vm.replyForm" ng-submit="vm.postReply(vm.replyForm.$valid)" novalidate autocomplete="off">
<div class="form-group" show-errors>
<textarea id="postReplyContent" name="postReplyContent" ng-model="vm.postReplyFields.content"
mt-markdown-editor="postReplyContent" maxlength="{{vm.inputLengthConfig.forumReplyContentLength}}"
upload-dir="/modules/forums/client/attach/temp/"
upload-method="vm.uploadAttach(editor, ufile, progressback, callback, errback);" required></textarea>
<div ng-messages="vm.replyForm.postReplyContent.$error" role="alert">
<p class="help-block error-text" ng-message="required">{{ 'FORUMS.PRC_REQUIRED' | translate}}</p>
</div>
</div>
<div class="margin-top-5 xs-hide" style="display: table;">
<a class="message-extra" href="https://guides.github.com/features/mastering-markdown/" target="_blank"
data-ga-click="Markdown Toolbar, click, help">
<svg aria-hidden="true" height="16" version="1.1"
viewBox="0 0 16 16" width="16">
<path fill-rule="evenodd"
d="M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z"/>
</svg>
{{ 'MARKDOWN_LINK' | translate }}
</a>
</div>
<button type="submit" class="btn btn-success btn-width-100 pull-right">{{'FORUMS.BTN_SUBMIT_REPLY' | translate}}
</button>
</form>
</div>
</div>
</div>
</div>
<div class="up_to_top_div" up-to-top="top_of_reply_list" offset="-60"></div>
</section>