mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-16 12:22:26 +01:00
326 lines
24 KiB
HTML
326 lines
24 KiB
HTML
<div ng-controller="RequestsViewController as vm" ng-init="vm.init();">
|
|
<div class="pagetop">
|
|
<div class="container">
|
|
<div class="padding-top-30 padding-bottom-30 text-center">
|
|
<div class="btn-group requests-group">
|
|
<a class="btn btn-default btn-min-width-180"
|
|
ui-sref="requests.list">
|
|
{{'REQUESTS.NAV_LIST' | translate}}
|
|
</a>
|
|
<a class="btn btn-default btn-min-width-180"
|
|
ui-sref="requests.add">
|
|
{{'REQUESTS.NAV_ADD' | translate}}
|
|
</a>
|
|
<div class="clearfix visible-xxs-block "></div>
|
|
<a class="btn btn-default btn-min-width-180"
|
|
ui-sref="requests.my">
|
|
{{'REQUESTS.NAV_MY' | translate}}
|
|
</a>
|
|
<a class="btn btn-default btn-min-width-180"
|
|
ui-sref="requests.res">
|
|
{{'REQUESTS.NAV_RES' | translate}}
|
|
</a>
|
|
</div>
|
|
<i class="fa fa-question-circle request-help" aria-hidden="true"
|
|
title="{{ 'REQUESTS.DESC_HELP_TITLE' | translate}}"
|
|
ng-click="vm.onShowHelpClicked();">
|
|
</i>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-10 col-md-offset-1">
|
|
<div class="requests-desc" ng-class="{'panel-collapsed': vm.show_desc_help=='no', 'requests-desc-hide': vm.show_desc_help=='no'}">
|
|
<span ng-bind-html="vm.getRequestsDesc();"></span>
|
|
<i class="fa fa-times" aria-hidden="true"
|
|
title="{{ 'REQUESTS.CLOSE_HELP_TITLE' | translate}}"
|
|
ng-click="vm.onCloseHelpClicked();">
|
|
</i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="up_to_top_div" up-to-top="top_of_requests" offset="-3000"></div>
|
|
|
|
<div class="container">
|
|
<div class="margin-bottom-10 margin-top-10">
|
|
<div class="row" id="top_of_requests">
|
|
<div class="col-sm-12">
|
|
<div class="request-wrapper">
|
|
<span user-info="vm.request.user" info-class="request-avatar" info-avatar></span>
|
|
<div class="request-list" ng-if="vm.request">
|
|
<div class="table-responsive request-item">
|
|
<table class="table table-hover table-bordered tb-v-middle top-border">
|
|
<thead>
|
|
<tr>
|
|
<th>{{ 'REQUESTS.FIELD_TITLE' | translate}}</th>
|
|
<th class="text-center">{{ 'REQUESTS.FIELD_TYPE' | translate}}</th>
|
|
<th class="text-center">{{ 'REQUESTS.FIELD_LIFE' | translate}}</th>
|
|
<th class="text-center">{{ 'REQUESTS.FIELD_REWARDS' | translate}}</th>
|
|
<th class="text-center">{{ 'REQUESTS.FIELD_RESPONSES' | translate}}</th>
|
|
<th class="text-center">{{ 'REQUESTS.FIELD_COMMENTS' | translate}}</th>
|
|
<th class="text-center">{{ 'REQUESTS.FIELD_USER' | translate}}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-6 td-v-middle td-text-overflow">
|
|
<h4>
|
|
<div class="text-long">
|
|
<a ui-sref="#">
|
|
<span editable-line readonly="!vm.isCurrentUserOwner() && !vm.user.isOper"
|
|
ng-model="vm.request.title"
|
|
callback="onRequestTitleEdited"></span>
|
|
</a>
|
|
</div>
|
|
</h4>
|
|
</td>
|
|
<td class="col-md-1 td-v-middle text-center min-width-80">{{'MENU_TORRENTS_SUB.'+vm.request.type.toUpperCase() | translate}}</td>
|
|
<td class="col-md-1 td-v-middle text-center min-width-80">
|
|
{{vm.request.createdAt | life }}
|
|
<div>
|
|
<span class="badge badge_danger"
|
|
ng-if="vm.isExpired(vm.request) && !vm.request.accept">Expired</span>
|
|
<span class="badge badge_success" ng-if="vm.request.accept">Finished</span>
|
|
</div>
|
|
</td>
|
|
<td class="col-md-1 td-v-middle text-center min-width-80">{{vm.request.rewards}}</td>
|
|
<td class="col-md-1 td-v-middle text-center min-width-60">
|
|
<a href="#" ng-click="vm.scrollToElement('#top_of_responses');">{{vm.request.torrents.length}}</a>
|
|
</td>
|
|
<td class="col-md-1 td-v-middle text-center min-width-60">
|
|
<a href="#" ng-click="vm.scrollToElement('#top_of_comments');">{{vm.request.comments.length}}</a>
|
|
</td>
|
|
<td class="col-md-1 td-v-middle text-center min-width-80">
|
|
<span user-info="vm.request.user" info-name></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="7">
|
|
<div class="item-marked-desc" id="{{vm.request._id}}" data-provide="markdown"
|
|
ng-bind-html="vm.getRequestDescContent(vm.request)">
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="7">
|
|
<div class="form-inline">
|
|
<fieldset ng-disabled="vm.request.accept || vm.isExpired(vm.request);">
|
|
<a ui-sref="torrents.uploads({reqId: vm.request._id})"
|
|
ng-if="!vm.isCurrentUserOwner()"
|
|
class="btn btn-success btn-min-width-100">
|
|
{{ 'DO_UPLOAD' | translate}}
|
|
</a>
|
|
<button class="btn btn-default btn-min-width-100"
|
|
ng-if="vm.isCurrentUserOwner() || vm.user.isOper"
|
|
ng-click="vm.beginEditMakerDesc(vm.request)">
|
|
{{ 'REQUESTS.BTN_EDIT_DESC' | translate}}
|
|
</button>
|
|
</fieldset>
|
|
<button class="btn btn-default btn-min-width-100"
|
|
ng-disabled="vm.request.accept"
|
|
ng-if="vm.isCurrentUserOwner() || vm.user.isOper"
|
|
ng-click="vm.removeRequest();">
|
|
{{ 'BTN_REMOVE' | translate}}
|
|
</button>
|
|
<btn class="btn btn-default btn-min-width-100"
|
|
ng-click="vm.scrollToElement('#top_of_new_comment');">
|
|
{{ 'REQUESTS.BTN_COMMENT' | translate}}
|
|
</btn>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row" id="top_of_responses">
|
|
<div class="col-sm-12">
|
|
<div class="response-wrapper">
|
|
<div class="response-list">
|
|
<div class="jumbotron text-center margin-left-80" ng-if="vm.request.torrents.length<=0">
|
|
<i class="fa fa-users fa-2x text-muted" aria-hidden="true"></i>
|
|
<h3 class="text-muted">{{'REQUESTS.NO_RESPONSES' | translate}}</h3>
|
|
</div>
|
|
|
|
<div class="margin-left-80" ng-if="vm.request.torrents.length>0">
|
|
<div class="response-title">{{ 'REQUESTS.RESPONSE_TITLE' | translate}}</div>
|
|
<div class="table-responsive">
|
|
<table class="table table-hover tb-v-middle top-border">
|
|
<thead>
|
|
<tr>
|
|
<th class="td-width-0"></th>
|
|
<th>{{ 'TABLE_FIELDS.INFO' | translate}}</th>
|
|
<th>{{ 'TABLE_FIELDS.VOTES' | translate}}</th>
|
|
<th class="text-center">{{ 'TABLE_FIELDS.LIFETIME' | translate}}</th>
|
|
<th class="text-center">{{ 'TABLE_FIELDS.SIZE' | translate}}</th>
|
|
<th>
|
|
<abbr title="{{ 'TABLE_FIELDS.ABBR_SEEDS_LEECHERS_FINISHED' | translate}}" class="initialism">
|
|
{{ 'TABLE_FIELDS.SEEDS_LEECHERS_FINISHED' | translate}}
|
|
</abbr>
|
|
</th>
|
|
<th class="text-center">{{ 'TABLE_FIELDS.PUBLISHER' | translate}}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody torrent-list-item parent="vm" item="item" list="vm.request.torrents" ng-repeat="item in vm.request.torrents"></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="margin-left-80" id="top_of_comments" ng-if="vm.request.comments">
|
|
<div class="panel panel-default panel-comment">
|
|
<div class="panel-heading text-center"><strong>{{ 'USER_COMMENT_LIST' | translate}}</strong> <span
|
|
class="badge badge_info">{{vm.request.comments.length}}</span></div>
|
|
<div class="panel-body">
|
|
<ul uib-pagination boundary-links="true" max-size="8" items-per-page="vm.commentItemsPerPage"
|
|
total-items="vm.commentFilterLength"
|
|
ng-model="vm.commentCurrentPage" ng-change="vm.commentPageChanged(true)"
|
|
ng-if="vm.request.comments.length > 0"
|
|
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 id="comment-list-div">
|
|
<div class="comment-list" id="{{item._id}}" scroll-if="item._id==vm.scrollToId" offset-top="-60"
|
|
ng-repeat="item in vm.commentPagedItems">
|
|
<div class="timeline-comment-wrapper">
|
|
<a class="timeline-comment-avatar" ng-click="vm.replyComment(item);">
|
|
<img title="{{item.user.displayName}}" ng-src="{{item.user.profileImageURL}}">
|
|
</a>
|
|
|
|
<div class="timeline-comment">
|
|
<div class="timeline-comment-header">
|
|
<div class="timeline-comment-header-text">
|
|
<span user-info="item.user" info-name></span>
|
|
<span vip-flag="item.user"></span>
|
|
<!--<span message-to="item.user" to-class="message-to-icon"></span>-->
|
|
<span class="user-ud-text">
|
|
(<span class="glyphicon glyphicon-arrow-up torrent-up"></span>{{item.user.uploaded | bytes}}
|
|
<span class="glyphicon glyphicon-arrow-down torrent-down"></span>{{item.user.downloaded | bytes}}
|
|
)
|
|
</span>
|
|
</div>
|
|
<span class="timeline-comment-header-time-text">{{item.createdat | date:'yyyy-MM-dd HH:mm:ss'}}</span>
|
|
</div>
|
|
<div class="timeline-comment-body">
|
|
<div class="timeline-comment-body-text" ng-bind-html="vm.getCommentMarked(item);"></div>
|
|
<div class="row text-right" ng-if="item.editedat">
|
|
<p class="timeline-comment-body-edited-text">[ {{item.editedby}} {{ 'COMMENT_EDITED_INFO' | translate}} {{item.editedat | date:'yyyy-MM-dd HH:mm:ss'}} ]</p>
|
|
</div>
|
|
<div class="row" ng-if="item._replies.length>0">
|
|
<div class="col-sm-10 col-sm-offset-2 timeline-comment-sub-list">
|
|
<div class="timeline-comment-sub-item" ng-repeat="sitem in item._replies">
|
|
<a class="timeline-comment-sub-avatar" ng-click="vm.replySubComment(item, sitem);">
|
|
<img title="{{sitem.user.displayName}}" ng-src="{{sitem.user.profileImageURL}}">
|
|
</a>
|
|
|
|
<div class="timeline-comment-sub-body">
|
|
<span ng-bind-html="vm.getReplyMarked(sitem);"></span>
|
|
|
|
<p class="reply-by">
|
|
<span style="font-size: 12px;"> -
|
|
<a ng-click="vm.markLinkClick($event, item);"
|
|
ng-href="#">@{{sitem.user.displayName}}</a>
|
|
</span>
|
|
<span style="font-size: 12px; color: #999999;">{{sitem.createdat | date: 'yyyy-MM-dd HH:mm:ss'}}</span>
|
|
|
|
<span class="glyphicon glyphicon-edit edit-button"
|
|
title="{{ 'COMMENT_EDIT_ICON_TITLE' | translate}}"
|
|
ng-if="sitem.user._id.toString()==vm.user._id || vm.user.roles[0] == 'admin'"
|
|
ng-click="vm.editSubComment(item,sitem);">
|
|
</span>
|
|
|
|
<span class="glyphicon glyphicon-remove-circle delete-button"
|
|
title="{{ 'COMMENT_DELETE_ICON_TITLE' | translate}}"
|
|
ng-if="sitem.user._id.toString()==vm.user._id || vm.user.roles[0] == 'admin'"
|
|
ng-click="vm.deleteSubComment(item,sitem);">
|
|
</span>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="timeline-comment-footer">
|
|
<div class="timeline-comment-footer-button text-right">
|
|
<button class="btn btn-default btn-xs"
|
|
ng-if="item.user._id.toString()==vm.user._id || vm.user.roles[0] == 'admin'"
|
|
translate="COMMENT_REPLY_EDIT" ng-click="vm.editComment(item);"></button>
|
|
<button class="btn btn-default btn-xs"
|
|
ng-if="item.user._id.toString()==vm.user._id || vm.user.roles[0] == 'admin'"
|
|
translate="COMMENT_REPLY_DELETE" ng-click="vm.deleteComment(item);"></button>
|
|
<button class="btn btn-default btn-xs"
|
|
ng-if="vm.user"
|
|
translate="COMMENT_REPLY_BUTTON" ng-click="vm.replyComment(item);"></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<ul uib-pagination boundary-links="true" max-size="8" items-per-page="vm.commentItemsPerPage"
|
|
total-items="vm.commentFilterLength"
|
|
ng-model="vm.commentCurrentPage" ng-change="vm.commentPageChanged(true)"
|
|
ng-if="vm.request.comments.length > 0"
|
|
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 class="padding-top-20"></div>
|
|
|
|
<div class="comment-new" id="top_of_new_comment" ng-if="vm.user">
|
|
<div class="timeline-comment-wrapper">
|
|
<a href="#" class="timeline-comment-avatar">
|
|
<img title="{{vm.user.displayName}}" ng-src="{{vm.user.profileImageURL}}">
|
|
</a>
|
|
|
|
<div class="timeline-comment timeline-new-comment">
|
|
<div class="timeline-comment-header">
|
|
<div class="timeline-comment-header-text">{{ vm.comment.action == 'edit' ? 'EDIT_COMMENT' : (vm.comment.action == 'reply' ? 'REPLY_COMMENT' : 'POST_NEW_COMMENT') | translate}}</div>
|
|
</div>
|
|
<div class="timeline-comment-body">
|
|
<textarea id="commentContent" name="commentContent" ng-model="vm.comment.content"
|
|
mt-markdown-editor="commentContent"
|
|
maxlength="{{vm.inputLengthConfig.requestCommentLength}}"></textarea>
|
|
|
|
<div class="row margin-top-10">
|
|
<div class="col-sm-6" style="display: table;">
|
|
<a class="tabnav-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>
|
|
<div class="col-sm-6 text-right">
|
|
<button class="btn btn-warning btn-min-width-80" translate="SUBMIT_CANCEL"
|
|
ng-click="vm.submitInit();"></button>
|
|
<button class="btn btn-success"
|
|
translate="{{vm.comment.action == 'reply' ? 'SUBMIT_REPLY' : 'SUBMIT_COMMENT'}}"
|
|
ng-click="vm.submitComment();"
|
|
ng-disabled="!vm.comment.content"></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|