feat(core): add more templates file content with sprintf format support

This commit is contained in:
OldHawk
2018-03-17 11:34:32 +08:00
parent 619f40df97
commit 1e2bcc57b1
23 changed files with 309 additions and 81 deletions

View File

@@ -31,6 +31,7 @@
vm.inviteConfig = MeanTorrentConfig.meanTorrentConfig.invite;
vm.requestsConfig = MeanTorrentConfig.meanTorrentConfig.requests;
vm.hnrConfig = MeanTorrentConfig.meanTorrentConfig.hitAndRun;
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
vm.groupTorrentType = localStorageService.get('maker_last_selected_type') || 'movie';
vm.searchTags = [];
@@ -43,13 +44,20 @@
isOpen: false
};
/**
* getTemplateFileContent
* @param file
*/
vm.getTemplateFileContent = function (file) {
$templateRequest(file, true).then(function (response) {
console.log(response);
vm.templateFileContent = response;
});
};
/**
* getTemplateMarkedContent
* @returns {*}
*/
vm.getTemplateMarkedContent = function () {
var tmp = $filter('fmt')(vm.templateFileContent, {
appConfig: vm.appConfig,
@@ -60,10 +68,14 @@
signConfig: vm.signConfig,
inviteConfig: vm.inviteConfig,
requestsConfig: vm.requestsConfig,
hnrConfig: vm.hnrConfig
hnrConfig: vm.hnrConfig,
tmdbConfig: vm.tmdbConfig,
user: vm.user
});
return marked(tmp, {sanitize: false});
};
/**
* buildPager
*/

View File

@@ -8,7 +8,7 @@ The `xx` is the language flag, like `zh`,`en` etc.
`sqrt(score number / %(scoreConfig.levelStep)s)`
```
```javascript
requests: {
scoreForAddRequest: %(requestsConfig.scoreForAddRequest)d,
rewardsFormDefaultValue: %(requestsConfig.rewardsFormDefaultValue)d,

View File

@@ -23,6 +23,7 @@
vm.inviteConfig = MeanTorrentConfig.meanTorrentConfig.invite;
vm.requestsConfig = MeanTorrentConfig.meanTorrentConfig.requests;
vm.hnrConfig = MeanTorrentConfig.meanTorrentConfig.hitAndRun;
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
/**
* cmOption
@@ -210,15 +211,6 @@
});
};
/**
* getTemplateBackConfigFiles
*/
vm.getTemplateBackConfigFiles = function () {
SystemsService.getSystemTemplateBackConfigFiles(function (res) {
vm.templateBackConfigFiles = res;
});
};
/**
* getMarkedConfigContent
* @returns {*}
@@ -233,7 +225,10 @@
signConfig: vm.signConfig,
inviteConfig: vm.inviteConfig,
requestsConfig: vm.requestsConfig,
hnrConfig: vm.hnrConfig
hnrConfig: vm.hnrConfig,
tmdbConfig: vm.tmdbConfig,
user: vm.user
});
return marked(tmp, {sanitize: true});
};

View File

@@ -6,14 +6,28 @@
.controller('TorrentsUploadController', TorrentsUploadController);
TorrentsUploadController.$inject = ['$scope', '$state', '$translate', '$timeout', 'Authentication', 'MeanTorrentConfig', 'Upload', 'Notification',
'TorrentsService', 'getStorageLangService', '$filter', 'DownloadService', 'DebugConsoleService', 'NotifycationService', 'SideOverlay'];
'TorrentsService', 'getStorageLangService', '$filter', 'DownloadService', 'DebugConsoleService', 'NotifycationService', 'SideOverlay',
'$templateRequest', 'marked'];
function TorrentsUploadController($scope, $state, $translate, $timeout, Authentication, MeanTorrentConfig, Upload, Notification,
TorrentsService, getStorageLangService, $filter, DownloadService, mtDebug, NotifycationService, SideOverlay) {
TorrentsService, getStorageLangService, $filter, DownloadService, mtDebug, NotifycationService, SideOverlay,
$templateRequest, marked) {
var vm = this;
vm.announceConfig = MeanTorrentConfig.meanTorrentConfig.announce;
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
vm.imdbConfig = MeanTorrentConfig.meanTorrentConfig.imdbConfig;
vm.appConfig = MeanTorrentConfig.meanTorrentConfig.app;
vm.scoreConfig = MeanTorrentConfig.meanTorrentConfig.score;
vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage;
vm.torrentType = MeanTorrentConfig.meanTorrentConfig.torrentType;
vm.inputLengthConfig = MeanTorrentConfig.meanTorrentConfig.inputLength;
vm.rssConfig = MeanTorrentConfig.meanTorrentConfig.rss;
vm.ircConfig = MeanTorrentConfig.meanTorrentConfig.ircAnnounce;
vm.signConfig = MeanTorrentConfig.meanTorrentConfig.sign;
vm.inviteConfig = MeanTorrentConfig.meanTorrentConfig.invite;
vm.requestsConfig = MeanTorrentConfig.meanTorrentConfig.requests;
vm.hnrConfig = MeanTorrentConfig.meanTorrentConfig.hitAndRun;
vm.resourcesTags = MeanTorrentConfig.meanTorrentConfig.resourcesTags;
vm.torrentType = MeanTorrentConfig.meanTorrentConfig.torrentType;
vm.lang = getStorageLangService.getLang();
@@ -26,6 +40,38 @@
vm.videoNfo = '';
vm.customTorrent = {};
/**
* getTemplateFileContent
* @param file
*/
vm.getTemplateFileContent = function (file) {
$templateRequest(file, true).then(function (response) {
vm.templateFileContent = response;
});
};
/**
* getTemplateMarkedContent
* @returns {*}
*/
vm.getTemplateMarkedContent = function () {
var tmp = $filter('fmt')(vm.templateFileContent, {
appConfig: vm.appConfig,
announceConfig: vm.announceConfig,
scoreConfig: vm.scoreConfig,
rssConfig: vm.rssConfig,
ircConfig: vm.ircConfig,
signConfig: vm.signConfig,
inviteConfig: vm.inviteConfig,
requestsConfig: vm.requestsConfig,
hnrConfig: vm.hnrConfig,
tmdbConfig: vm.tmdbConfig,
user: vm.user
});
return marked(tmp, {sanitize: false});
};
/**
* upload
* @param dataUrl

View File

@@ -1,6 +1,6 @@
1. If this is a private torrents management system, the torrent file announce URL will auto set as: __{{vm.announceConfig.url}}__.
1. In your torrent create tools, your announce url should be __{{vm.announceConfig.url}}/{{vm.user.passkey}}__, Do not share this address with other users to avoid disclosing your passkey, each user has its own passkey.
1. If you selected resource type with `Movie` or `TVSerial`, the torrent TMDB_ID must be `TheMovieDB` resources ID, you can [find the ID from here]({{vm.tmdbConfig.tmdbHome}}), then the resources detail info can be autoload, if everything looks good, hit submit.
1. If this is a private torrents management system, the torrent file announce URL will auto set as: `%(announceConfig.url)s`.
1. In your torrent create tools, your announce url should be `%(announceConfig.url)s/%(user.passkey)s`, Do not share this address with other users to avoid disclosing your passkey, each user has its own passkey.
1. If you selected resource type with `Movie` or `TVSerial`, the torrent TMDB_ID must be `TheMovieDB` resources ID, you can [find the ID from here](%(tmdbConfig.tmdbHome)s), then the resources detail info can be autoload, if everything looks good, hit submit.
1. Select one or more tags that match the resources, which will play a significant role in your search results.
1. After the submission of documents, may be approved by the management, the rules do not meet the seeds will be deleted directly.
1. For additional assistance, please contact our administrator: [{{vm.announceConfig.admin}}](mailto:{{vm.announceConfig.admin}}).
1. For additional assistance, please contact our administrator: [%(announceConfig.admin)s](mailto:%(announceConfig.admin)s).

View File

@@ -1,6 +1,6 @@
1. 如果这是私有种子管理系统, 种子文件的Announce地址会自动设置为: __{{vm.announceConfig.url}}__.
1. 当您创建一个种子文件时, 种子创建工具中的Announce地址则应该为: __{{vm.announceConfig.url}}/{{vm.user.passkey}}__, 请不要把这个地址分享其它用户以避免泄露您的passkey每个用户都有自已的passkey.
1. 如果您选择的资源类型为`电影``电视剧`, 种子文件的 TMDB_ID 必须是 `TheMovieDB` 相对应的资源ID号, 您可以[从这里找到ID号]({{vm.tmdbConfig.tmdbHome}}). 系统会自动载入资源的详细信息, 如无误可直接提交.
1. 如果这是私有种子管理系统, 种子文件的Announce地址会自动设置为: `%(announceConfig.url)s`.
1. 当您创建一个种子文件时, 种子创建工具中的Announce地址则应该为: `%(announceConfig.url)s/%(user.passkey)s`, 请不要把这个地址分享其它用户以避免泄露您的passkey每个用户都有自已的passkey.
1. 如果您选择的资源类型为`电影``电视剧`, 种子文件的 TMDB_ID 必须是 `TheMovieDB` 相对应的资源ID号, 您可以[从这里找到ID号](%(tmdbConfig.tmdbHome)s). 系统会自动载入资源的详细信息, 如无误可直接提交.
1. 请为资源选择匹配的一个或多个标签, 它会在您的搜索结果中发挥重大作用.
1. 种子文件提交后, 可能会由后台管理人员进行审批, 不符合规则的种子会被直接删除.
1. 如需其它帮助, 请与我们的管理员联系: [{{vm.announceConfig.admin}}](mailto:{{vm.announceConfig.admin}}).
1. 如需其它帮助, 请与我们的管理员联系: [%(announceConfig.admin)s](mailto:%(announceConfig.admin)s).

View File

@@ -1,11 +1,9 @@
<section class="container" ng-controller="TorrentsUploadController as vm">
<div class="jumbotron margin-top-10">
<div class="jumbotron margin-top-10" ng-init="vm.getTemplateFileContent('/modules/torrents/client/templates/upload-rules-'+vm.lang+'.md')">
<div class="row">
<div class="col-xs-12">
<h4 translate="UPLOAD_RULES"></h4>
<div marked src="'/modules/torrents/client/templates/upload-rules-'+vm.lang+'.md'" compile="true" style="line-height: 1.6;">
</div>
<span ng-bind-html="vm.getTemplateMarkedContent()" style="line-height: 1.6;"></span>
</div>
</div>
</div>
@@ -103,7 +101,8 @@
<!-- =================================================================
side-overlay search movies
================================================================== -->
<div id="searchFromTMDBSlide" side-overlay="right" side-class="search-from-tmdb-side-overlay" side-opened="vm.onPopupSearchOpen()" side-close-on-esc side-modal>
<div id="searchFromTMDBSlide" side-overlay="right" side-class="search-from-tmdb-side-overlay" side-opened="vm.onPopupSearchOpen()"
side-close-on-esc side-modal>
<div class="search-popup">
<legend class="h4"
translate="SEARCH_FROM_TMDB_TITLE" translate-values="{type: ('MENU_TORRENTS_SUB.'+vm.selectedType.toUpperCase() | translate)}">

View File

@@ -6,15 +6,24 @@
.controller('AuthenticationController', AuthenticationController);
AuthenticationController.$inject = ['$scope', '$state', 'UsersService', '$location', '$window', '$timeout', 'Authentication', 'PasswordValidator', 'NotifycationService',
'MeanTorrentConfig', 'getStorageLangService', '$rootScope', '$stateParams', 'InvitationsService', '$translate'];
'MeanTorrentConfig', 'getStorageLangService', '$rootScope', '$stateParams', 'InvitationsService', '$translate', '$templateRequest', 'marked', '$filter'];
function AuthenticationController($scope, $state, UsersService, $location, $window, $timeout, Authentication, PasswordValidator, NotifycationService, MeanTorrentConfig,
getStorageLangService, $rootScope, $stateParams, InvitationsService, $translate) {
getStorageLangService, $rootScope, $stateParams, InvitationsService, $translate, $templateRequest, marked, $filter) {
var vm = this;
vm.lang = getStorageLangService.getLang();
vm.signConfig = MeanTorrentConfig.meanTorrentConfig.sign;
vm.appConfig = MeanTorrentConfig.meanTorrentConfig.app;
vm.scoreConfig = MeanTorrentConfig.meanTorrentConfig.score;
vm.announce = MeanTorrentConfig.meanTorrentConfig.announce;
vm.rssConfig = MeanTorrentConfig.meanTorrentConfig.rss;
vm.ircConfig = MeanTorrentConfig.meanTorrentConfig.ircAnnounce;
vm.signConfig = MeanTorrentConfig.meanTorrentConfig.sign;
vm.inviteConfig = MeanTorrentConfig.meanTorrentConfig.invite;
vm.requestsConfig = MeanTorrentConfig.meanTorrentConfig.requests;
vm.hnrConfig = MeanTorrentConfig.meanTorrentConfig.hitAndRun;
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
vm.authentication = Authentication;
vm.getPopoverMsg = PasswordValidator.getPopoverMsg;
vm.signup = signup;
@@ -43,6 +52,38 @@
}, 3000);
}
/**
* getTemplateFileContent
* @param file
*/
vm.getTemplateFileContent = function (file) {
$templateRequest(file, true).then(function (response) {
vm.templateFileContent = response;
});
};
/**
* getTemplateMarkedContent
* @returns {*}
*/
vm.getTemplateMarkedContent = function () {
var tmp = $filter('fmt')(vm.templateFileContent, {
appConfig: vm.appConfig,
announceConfig: vm.announce,
scoreConfig: vm.scoreConfig,
rssConfig: vm.rssConfig,
ircConfig: vm.ircConfig,
signConfig: vm.signConfig,
inviteConfig: vm.inviteConfig,
requestsConfig: vm.requestsConfig,
hnrConfig: vm.hnrConfig,
tmdbConfig: vm.tmdbConfig,
user: vm.authentication.user
});
return marked(tmp, {sanitize: false});
};
/**
* verifyToken
*/

View File

@@ -6,13 +6,24 @@
.controller('ScoreController', ScoreController);
ScoreController.$inject = ['$rootScope', '$scope', '$state', '$translate', '$timeout', 'Authentication', '$window', 'ScoreLevelService', 'getStorageLangService',
'MeanTorrentConfig', 'ModalConfirmService', 'NotifycationService', 'InvitationsService'];
'MeanTorrentConfig', 'ModalConfirmService', 'NotifycationService', 'InvitationsService', '$templateRequest', 'marked', '$filter'];
function ScoreController($rootScope, $scope, $state, $translate, $timeout, Authentication, $window, ScoreLevelService, getStorageLangService, MeanTorrentConfig,
ModalConfirmService, NotifycationService, InvitationsService) {
ModalConfirmService, NotifycationService, InvitationsService, $templateRequest, marked, $filter) {
var vm = this;
vm.scoreConfig = MeanTorrentConfig.meanTorrentConfig.score;
vm.inviteConfig = MeanTorrentConfig.meanTorrentConfig.invite;
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
vm.appConfig = MeanTorrentConfig.meanTorrentConfig.app;
vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage;
vm.torrentType = MeanTorrentConfig.meanTorrentConfig.torrentType;
vm.inputLengthConfig = MeanTorrentConfig.meanTorrentConfig.inputLength;
vm.rssConfig = MeanTorrentConfig.meanTorrentConfig.rss;
vm.ircConfig = MeanTorrentConfig.meanTorrentConfig.ircAnnounce;
vm.signConfig = MeanTorrentConfig.meanTorrentConfig.sign;
vm.requestsConfig = MeanTorrentConfig.meanTorrentConfig.requests;
vm.hnrConfig = MeanTorrentConfig.meanTorrentConfig.hitAndRun;
vm.lang = getStorageLangService.getLang();
vm.user = Authentication.user;
@@ -24,6 +35,48 @@
vm.scoreLevelData = vm.user ? ScoreLevelService.getScoreLevelJson(vm.user.score) : undefined;
});
/**
* getTemplateScoreFileContent
* @param file
*/
vm.getTemplateScoreFileContent = function (file) {
$templateRequest(file, true).then(function (response) {
vm.templateScoreFileContent = response;
});
};
/**
* getTemplateLevelFileContent
* @param file
*/
vm.getTemplateLevelFileContent = function (file) {
$templateRequest(file, true).then(function (response) {
vm.templateLevelFileContent = response;
});
};
/**
* getTemplateMarkedContent
* @returns {*}
*/
vm.getTemplateMarkedContent = function (cnt) {
var tmp = $filter('fmt')(cnt, {
appConfig: vm.appConfig,
announceConfig: vm.announceConfig,
scoreConfig: vm.scoreConfig,
rssConfig: vm.rssConfig,
ircConfig: vm.ircConfig,
signConfig: vm.signConfig,
inviteConfig: vm.inviteConfig,
requestsConfig: vm.requestsConfig,
hnrConfig: vm.hnrConfig,
tmdbConfig: vm.tmdbConfig,
user: vm.user
});
return marked(tmp, {sanitize: false});
};
/**
* init
*/

View File

@@ -7,21 +7,62 @@
WarningController.$inject = ['$rootScope', '$state', '$translate', '$timeout', 'Authentication', 'Notification', 'PeersService', 'CompleteService',
'MeanTorrentConfig', '$window', '$filter', 'DownloadService', 'NotifycationService', 'ModalConfirmService', 'getStorageLangService', 'DebugConsoleService',
'TorrentGetInfoServices', 'ResourcesTagsServices'];
'TorrentGetInfoServices', 'ResourcesTagsServices', '$templateRequest', 'marked'];
function WarningController($rootScope, $state, $translate, $timeout, Authentication, Notification, PeersService, CompleteService, MeanTorrentConfig,
$window, $filter, DownloadService, NotifycationService, ModalConfirmService, getStorageLangService, mtDebug,
TorrentGetInfoServices, ResourcesTagsServices) {
TorrentGetInfoServices, ResourcesTagsServices, $templateRequest, marked) {
var vm = this;
vm.DLS = DownloadService;
vm.TGI = TorrentGetInfoServices;
vm.user = Authentication.user;
vm.RTS = ResourcesTagsServices;
vm.appConfig = MeanTorrentConfig.meanTorrentConfig.app;
vm.scoreConfig = MeanTorrentConfig.meanTorrentConfig.score;
vm.announce = MeanTorrentConfig.meanTorrentConfig.announce;
vm.rssConfig = MeanTorrentConfig.meanTorrentConfig.rss;
vm.ircConfig = MeanTorrentConfig.meanTorrentConfig.ircAnnounce;
vm.signConfig = MeanTorrentConfig.meanTorrentConfig.sign;
vm.inviteConfig = MeanTorrentConfig.meanTorrentConfig.invite;
vm.requestsConfig = MeanTorrentConfig.meanTorrentConfig.requests;
vm.hnrConfig = MeanTorrentConfig.meanTorrentConfig.hitAndRun;
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
vm.lang = getStorageLangService.getLang();
vm.searchTags = [];
/**
* getTemplateFileContent
* @param file
*/
vm.getTemplateFileContent = function (file) {
$templateRequest(file, true).then(function (response) {
vm.templateFileContent = response;
});
};
/**
* getTemplateMarkedContent
* @returns {*}
*/
vm.getTemplateMarkedContent = function () {
var tmp = $filter('fmt')(vm.templateFileContent, {
appConfig: vm.appConfig,
announceConfig: vm.announce,
scoreConfig: vm.scoreConfig,
rssConfig: vm.rssConfig,
ircConfig: vm.ircConfig,
signConfig: vm.signConfig,
inviteConfig: vm.inviteConfig,
requestsConfig: vm.requestsConfig,
hnrConfig: vm.hnrConfig,
tmdbConfig: vm.tmdbConfig,
user: vm.user
});
return marked(tmp, {sanitize: false});
};
/**
* getWarningTorrent
*/

View File

@@ -1,6 +1,6 @@
1. User score level calculation formula is: `sqrt(score number / 500)`.
1. Level`1` score is: `500`.
1. Level`2` score is: `2000`.
1. Level`3` score is: `4500`.
1. Level`4` score is: `8000`.
1. Level`x` score is: `x * x * 500`.
1. User score level calculation formula is: `sqrt(score number / %(scoreConfig.levelStep)s)`.
1. Level`1` score is: `1 * 1 * %(scoreConfig.levelStep)s`.
1. Level`2` score is: `2 * 2 * %(scoreConfig.levelStep)s`.
1. Level`3` score is: `3 * 3 * %(scoreConfig.levelStep)s`.
1. Level`4` score is: `4 * 4 * %(scoreConfig.levelStep)s`.
1. Level`x` score is: `x * x * %(scoreConfig.levelStep)s`.

View File

@@ -1,6 +1,6 @@
1. 用户积分级别数学计算公式为: `sqrt(score number / 500)`.
1. 级别`1` 需要积分累计: `500`.
1. 级别`2` 需要积分累计: `200`.
1. 级别`3` 需要积分累计: `4500`.
1. 级别`4` 需要积分累计: `8000`.
1. 级别`x` 需要积分累计: `x * x * 500`.
1. 用户积分级别数学计算公式为: `sqrt(score number / %(scoreConfig.levelStep)s)`.
1. 级别`1` 需要积分累计: `1 * 1 * %(scoreConfig.levelStep)s`.
1. 级别`2` 需要积分累计: `2 * 2 * %(scoreConfig.levelStep)s`.
1. 级别`3` 需要积分累计: `3 * 3 * %(scoreConfig.levelStep)s`.
1. 级别`4` 需要积分累计: `4 * 4 * %(scoreConfig.levelStep)s`.
1. 级别`x` 需要积分累计: `x * x * %(scoreConfig.levelStep)s`.

View File

@@ -1,4 +1,4 @@
#### Note:
1. If the HnR warning numbers is more than __{{vm.hnrConfig.forbiddenDownloadMinWarningNumber}}__, you can not to download any torrents.
1. You can remove a warning with __{{vm.hnrConfig.scoreToRemoveWarning}}__ scores.
1. If the HnR warning numbers is more than `%(hnrConfig.forbiddenDownloadMinWarningNumber)s`, you can not to download any torrents.
1. You can remove a warning with `%(hnrConfig.scoreToRemoveWarning)s` scores.
1. If you have no enough scores, you can [donate a vip](/vip), The HnR warning is immune to VIP user.

View File

@@ -1,4 +1,5 @@
#### 特别说明:
1. 如果您的 HnR 警告数超过 __{{vm.hnrConfig.forbiddenDownloadMinWarningNumber}}__ 个, 您将不能再下载任何种子文件.
1. 您可以使用 __{{vm.hnrConfig.scoreToRemoveWarning}}__ 积分来消除一个 HnR 警告.
1. 如果您的 HnR 警告数超过 `%(hnrConfig.forbiddenDownloadMinWarningNumber)d` 个, 您将不能再下载任何种子文件.
1. 您可以使用 `%(hnrConfig.scoreToRemoveWarning)d` 积分来消除一个 HnR 警告.
1. 如果您的积分不足, 你还可以 [捐赠一个VIP](/vip), HnR 警告对 VIP 用户不生效.

View File

@@ -1,7 +1,7 @@
<div ng-init="vm.verifyToken();">
<div class="margin-top-50 padding-top-20" ng-if="!vm.signConfig.openSignup && !vm.validToken">
<div class="col-sm-10 col-sm-offset-1" marked src="'/modules/users/client/templates/sign-up-closed-message-'+vm.lang+'.md'" compile="true">
</div>
<div class="margin-top-50 padding-top-20" ng-if="!vm.signConfig.openSignup && !vm.validToken"
ng-init="vm.getTemplateFileContent('/modules/users/client/templates/sign-up-closed-message-'+vm.lang+'.md')">
<span ng-bind-html="vm.getTemplateMarkedContent()"></span>
</div>
<div ng-if="vm.signConfig.openSignup || vm.validToken">
<div ng-if="!vm.waitToActive && !vm.isSendingMail">
@@ -59,7 +59,9 @@
style="color:white; white-space:nowrap;">{{requirementsProgress}}%</span></uib-progressbar>
</div>
<div class="text-center form-group">
<button type="submit" class="btn btn-success btn-width-100" ng-disabled="vm.isSendingMail">{{ 'SIGN.BTN_SIGN_UP' | translate}}</button>
<button type="submit" class="btn btn-success btn-width-100"
ng-disabled="vm.isSendingMail">{{ 'SIGN.BTN_SIGN_UP' | translate}}
</button>
&nbsp; or&nbsp;
<a ui-sref="authentication.signin" class="show-signup">{{ 'SIGN.BTN_SIGN_IN' | translate}}</a>
</div>
@@ -69,7 +71,8 @@
</div>
<div ng-if="vm.isSendingMail">
<div class="col-sm-10 col-sm-offset-1 margin-top-100 padding-top-20 text-center">
<i class="fa fa-spinner fa-pulse fa-2x text-primary"></i> <div class="active-notice margin-top-20" translate="SIGN.SENDING_MAIL"></div>
<i class="fa fa-spinner fa-pulse fa-2x text-primary"></i>
<div class="active-notice margin-top-20" translate="SIGN.SENDING_MAIL"></div>
</div>
</div>
<div ng-if="vm.waitToActive">

View File

@@ -40,19 +40,19 @@
</div>
</div>
<div class="row margin-top-30 padding-top-30">
<div class="row margin-top-30 padding-top-30"
ng-init="vm.getTemplateScoreFileContent('/modules/users/client/templates/how-level-'+vm.lang+'.md')">
<div class="col-sm-8 col-sm-offset-2">
<legend class="small-legend" translate="SCORE.HOW_TO_GET_LEVEL"></legend>
<div marked src="'/modules/users/client/templates/how-level-'+vm.lang+'.md'" compile="true">
</div>
<span ng-bind-html="vm.getTemplateMarkedContent(vm.templateScoreFileContent)"></span>
</div>
</div>
<div class="row margin-top-30 margin-bottom-30">
<div class="row margin-top-30 margin-bottom-30"
ng-init="vm.getTemplateLevelFileContent('/modules/users/client/templates/how-score-'+vm.lang+'.md')">
<div class="col-sm-8 col-sm-offset-2">
<legend class="small-legend" translate="SCORE.HOW_TO_GET_SCORE"></legend>
<div marked src="'/modules/users/client/templates/how-score-'+vm.lang+'.md'" compile="true">
</div>
<span ng-bind-html="vm.getTemplateMarkedContent(vm.templateLevelFileContent)"></span>
</div>
</div>
</div>

View File

@@ -7,10 +7,9 @@
</h4>
</span>
<div class="margin-top-10">
<div class="margin-top-10" ng-init="vm.getTemplateFileContent('/modules/users/client/templates/status-hnr-warning-'+vm.lang+'.md')">
<div class="alert alert-warning" role="alert" style="padding: 10px 50px;">
<div marked src="'/modules/users/client/templates/status-hnr-warning-'+vm.lang+'.md'" compile="true">
</div>
<span ng-bind-html="vm.getTemplateMarkedContent()"></span>
</div>
</div>

View File

@@ -7,11 +7,11 @@
VipController.$inject = ['$scope', '$state', '$translate', 'Authentication', 'getStorageLangService', 'MeanTorrentConfig', 'TorrentsService',
'DebugConsoleService', '$timeout', 'uibButtonConfig', 'TorrentGetInfoServices', 'DownloadService', 'ResourcesTagsServices', '$window',
'localStorageService', 'marked'];
'localStorageService', 'marked', '$templateRequest', '$filter'];
function VipController($scope, $state, $translate, Authentication, getStorageLangService, MeanTorrentConfig, TorrentsService,
mtDebug, $timeout, uibButtonConfig, TorrentGetInfoServices, DownloadService, ResourcesTagsServices, $window,
localStorageService, marked) {
localStorageService, marked, $templateRequest, $filter) {
var vm = this;
vm.DLS = DownloadService;
vm.TGI = TorrentGetInfoServices;
@@ -21,11 +21,19 @@
vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage;
vm.announceConfig = MeanTorrentConfig.meanTorrentConfig.announce;
vm.appConfig = MeanTorrentConfig.meanTorrentConfig.app;
vm.scoreConfig = MeanTorrentConfig.meanTorrentConfig.score;
vm.rssConfig = MeanTorrentConfig.meanTorrentConfig.rss;
vm.ircConfig = MeanTorrentConfig.meanTorrentConfig.ircAnnounce;
vm.signConfig = MeanTorrentConfig.meanTorrentConfig.sign;
vm.inviteConfig = MeanTorrentConfig.meanTorrentConfig.invite;
vm.requestsConfig = MeanTorrentConfig.meanTorrentConfig.requests;
vm.hnrConfig = MeanTorrentConfig.meanTorrentConfig.hitAndRun;
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
vm.torrentType = MeanTorrentConfig.meanTorrentConfig.torrentType;
vm.resourcesTags = MeanTorrentConfig.meanTorrentConfig.resourcesTags;
vm.vipTorrentType = localStorageService.get('vip_last_selected_type') || 'movie';
vm.appConfig = MeanTorrentConfig.meanTorrentConfig.app;
vm.searchTags = [];
vm.searchKey = '';
vm.releaseYear = undefined;
@@ -34,6 +42,38 @@
uibButtonConfig.activeClass = 'btn-success';
/**
* getTemplateFileContent
* @param file
*/
vm.getTemplateFileContent = function (file) {
$templateRequest(file, true).then(function (response) {
vm.templateFileContent = response;
});
};
/**
* getTemplateMarkedContent
* @returns {*}
*/
vm.getTemplateMarkedContent = function () {
var tmp = $filter('fmt')(vm.templateFileContent, {
appConfig: vm.appConfig,
announceConfig: vm.announceConfig,
scoreConfig: vm.scoreConfig,
rssConfig: vm.rssConfig,
ircConfig: vm.ircConfig,
signConfig: vm.signConfig,
inviteConfig: vm.inviteConfig,
requestsConfig: vm.requestsConfig,
hnrConfig: vm.hnrConfig,
tmdbConfig: vm.tmdbConfig,
user: vm.user
});
return marked(tmp, {sanitize: false});
};
/**
* buildPager
*/

View File

@@ -1,6 +1,6 @@
#### Note:
1. Before donations, please carefully read the [membership user license agreement](/vip/rules) of {{vm.appConfig.name}},
1. Before donations, please carefully read the [membership user license agreement](/vip/rules) of %(appConfig.name)s,
and clear the rights and obligations of members, if you continure donations, said you agree to these terms.
1. Choose a payment method from below to finish payment, then [send mail to the administrator](mailto:{{vm.announceConfig.admin}}) and comment in your account user ID,
1. Choose a payment method from below to finish payment, then [send mail to the administrator](mailto:%(announceConfig.admin)s) and comment in your account user ID,
We will manually change your vip status.
1. If you need any other help, please [mail to us](mailto:{{vm.announceConfig.admin}}).
1. If you need any other help, please [mail to us](mailto:%(announceConfig.admin)s).

View File

@@ -1,4 +1,4 @@
#### 注意:
1. 在捐赠前, 请认真阅读{{vm.appConfig.name}}的[会员用户许可协议](/vip/rules)以明确会员用户的权利与义务, 如继续进行捐赠操作, 则表示您已完全同意这些条款.
1. 请从下面选择一种支付方式进行支付,支付完成后请[给管理员发送邮件](mailto:{{vm.announceConfig.admin}})并注明站内的登陆ID, 我们将手动设置您的vip状态数据.
1. 如需其它帮助, 请[给我们发邮件](mailto:{{vm.announceConfig.admin}}).
1. 在捐赠前, 请认真阅读 %(appConfig.name)s 的[会员用户许可协议](/vip/rules)以明确会员用户的权利与义务, 如继续进行捐赠操作, 则表示您已完全同意这些条款.
1. 请从下面选择一种支付方式进行支付,支付完成后请[给管理员发送邮件](mailto:%(announceConfig.admin)s)并注明站内的登陆ID, 我们将手动设置您的vip状态数据.
1. 如需其它帮助, 请[给我们发邮件](mailto:%(announceConfig.admin)s).

View File

@@ -1,4 +1,4 @@
## This is the `VIP RULES` of {{vm.appConfig.name}}
## This is the `VIP RULES` of %(appConfig.name)s
The rules content is read from vip.md file, it is support `markdown` style.

View File

@@ -13,10 +13,9 @@
</div>
<div class="container">
<div class="margin-top-30 margin-bottom-50">
<div class="margin-top-30 margin-bottom-50" ng-init="vm.getTemplateFileContent('/modules/vip/client/templates/pay-'+vm.lang+'.md')">
<div class="alert alert-warning" role="alert" style="padding: 10px 50px;">
<div marked src="'/modules/vip/client/templates/pay-'+vm.lang+'.md'" compile="true">
</div>
<span ng-bind-html="vm.getTemplateMarkedContent()"></span>
</div>
</div>

View File

@@ -19,9 +19,8 @@
</div>
<div class="container">
<div class="col-sm-10">
<div marked src="'/modules/vip/client/templates/vip-'+vm.lang+'.md'" compile="true">
</div>
<div class="col-sm-10" ng-init="vm.getTemplateFileContent('/modules/vip/client/templates/vip-'+vm.lang+'.md')">
<span ng-bind-html="vm.getTemplateMarkedContent()"></span>
</div>
</div>
</div>