From 1e2bcc57b1e29a2c5d5ed40fa7935365b48b246f Mon Sep 17 00:00:00 2001 From: OldHawk Date: Sat, 17 Mar 2018 11:34:32 +0800 Subject: [PATCH] feat(core): add more templates file content with sprintf format support --- .../controllers/about.client.controller.js | 16 +++++- .../client/templates/user-level-rules-en.md | 2 +- .../systems-config.client.controller.js | 15 ++--- .../controllers/uploads.client.controller.js | 50 +++++++++++++++- .../client/templates/upload-rules-en.md | 8 +-- .../client/templates/upload-rules-zh.md | 8 +-- .../views/uploads-torrents.client.view.html | 9 ++- .../authentication.client.controller.js | 47 ++++++++++++++- .../score/score.client.controller.js | 57 ++++++++++++++++++- .../status/warning.client.controller.js | 45 ++++++++++++++- .../users/client/templates/how-level-en.md | 12 ++-- .../users/client/templates/how-level-zh.md | 12 ++-- .../client/templates/status-hnr-warning-en.md | 4 +- .../client/templates/status-hnr-warning-zh.md | 5 +- .../authentication/signup.client.view.html | 13 +++-- .../views/score/detail.client.view.html | 12 ++-- .../views/status/warning.client.view.html | 5 +- .../controllers/vip.client.controller.js | 46 ++++++++++++++- modules/vip/client/templates/pay-en.md | 6 +- modules/vip/client/templates/pay-zh.md | 6 +- modules/vip/client/templates/vip-en.md | 2 +- .../vip/client/views/donate.client.view.html | 5 +- .../vip/client/views/rules.client.view.html | 5 +- 23 files changed, 309 insertions(+), 81 deletions(-) diff --git a/modules/about/client/controllers/about.client.controller.js b/modules/about/client/controllers/about.client.controller.js index 93941fb7..2cea45c3 100644 --- a/modules/about/client/controllers/about.client.controller.js +++ b/modules/about/client/controllers/about.client.controller.js @@ -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 */ diff --git a/modules/about/client/templates/user-level-rules-en.md b/modules/about/client/templates/user-level-rules-en.md index 8558a54c..2a72e496 100644 --- a/modules/about/client/templates/user-level-rules-en.md +++ b/modules/about/client/templates/user-level-rules-en.md @@ -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, diff --git a/modules/systems/client/controllers/systems-config.client.controller.js b/modules/systems/client/controllers/systems-config.client.controller.js index 2827fb65..2bf2fded 100644 --- a/modules/systems/client/controllers/systems-config.client.controller.js +++ b/modules/systems/client/controllers/systems-config.client.controller.js @@ -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}); }; diff --git a/modules/torrents/client/controllers/uploads.client.controller.js b/modules/torrents/client/controllers/uploads.client.controller.js index e48e59f2..c028e1b8 100644 --- a/modules/torrents/client/controllers/uploads.client.controller.js +++ b/modules/torrents/client/controllers/uploads.client.controller.js @@ -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 diff --git a/modules/torrents/client/templates/upload-rules-en.md b/modules/torrents/client/templates/upload-rules-en.md index 6b841470..644ff464 100644 --- a/modules/torrents/client/templates/upload-rules-en.md +++ b/modules/torrents/client/templates/upload-rules-en.md @@ -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}}). \ No newline at end of file +1. For additional assistance, please contact our administrator: [%(announceConfig.admin)s](mailto:%(announceConfig.admin)s). \ No newline at end of file diff --git a/modules/torrents/client/templates/upload-rules-zh.md b/modules/torrents/client/templates/upload-rules-zh.md index b4cae6b3..faeefeb9 100644 --- a/modules/torrents/client/templates/upload-rules-zh.md +++ b/modules/torrents/client/templates/upload-rules-zh.md @@ -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}}). \ No newline at end of file +1. 如需其它帮助, 请与我们的管理员联系: [%(announceConfig.admin)s](mailto:%(announceConfig.admin)s). \ No newline at end of file diff --git a/modules/torrents/client/views/uploads-torrents.client.view.html b/modules/torrents/client/views/uploads-torrents.client.view.html index 2d59c7ae..3f73a045 100644 --- a/modules/torrents/client/views/uploads-torrents.client.view.html +++ b/modules/torrents/client/views/uploads-torrents.client.view.html @@ -1,11 +1,9 @@
-
+

- -
-
+
@@ -103,7 +101,8 @@ -
+
diff --git a/modules/users/client/controllers/authentication.client.controller.js b/modules/users/client/controllers/authentication.client.controller.js index 8e0b851d..7347b413 100644 --- a/modules/users/client/controllers/authentication.client.controller.js +++ b/modules/users/client/controllers/authentication.client.controller.js @@ -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 */ diff --git a/modules/users/client/controllers/score/score.client.controller.js b/modules/users/client/controllers/score/score.client.controller.js index 132b95ca..2f88573a 100644 --- a/modules/users/client/controllers/score/score.client.controller.js +++ b/modules/users/client/controllers/score/score.client.controller.js @@ -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 */ diff --git a/modules/users/client/controllers/status/warning.client.controller.js b/modules/users/client/controllers/status/warning.client.controller.js index c69f2c8f..0f57cda5 100644 --- a/modules/users/client/controllers/status/warning.client.controller.js +++ b/modules/users/client/controllers/status/warning.client.controller.js @@ -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 */ diff --git a/modules/users/client/templates/how-level-en.md b/modules/users/client/templates/how-level-en.md index 5ed6a101..c6639c96 100644 --- a/modules/users/client/templates/how-level-en.md +++ b/modules/users/client/templates/how-level-en.md @@ -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`. diff --git a/modules/users/client/templates/how-level-zh.md b/modules/users/client/templates/how-level-zh.md index 4ff17438..1a03a798 100644 --- a/modules/users/client/templates/how-level-zh.md +++ b/modules/users/client/templates/how-level-zh.md @@ -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`. diff --git a/modules/users/client/templates/status-hnr-warning-en.md b/modules/users/client/templates/status-hnr-warning-en.md index 7ae453c2..00af684a 100644 --- a/modules/users/client/templates/status-hnr-warning-en.md +++ b/modules/users/client/templates/status-hnr-warning-en.md @@ -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. \ No newline at end of file diff --git a/modules/users/client/templates/status-hnr-warning-zh.md b/modules/users/client/templates/status-hnr-warning-zh.md index 1335f21a..6c85af8d 100644 --- a/modules/users/client/templates/status-hnr-warning-zh.md +++ b/modules/users/client/templates/status-hnr-warning-zh.md @@ -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 用户不生效. \ No newline at end of file diff --git a/modules/users/client/views/authentication/signup.client.view.html b/modules/users/client/views/authentication/signup.client.view.html index 5e4e5fa3..f869d8dd 100644 --- a/modules/users/client/views/authentication/signup.client.view.html +++ b/modules/users/client/views/authentication/signup.client.view.html @@ -1,7 +1,7 @@
-
-
-
+
+
@@ -59,7 +59,9 @@ style="color:white; white-space:nowrap;">{{requirementsProgress}}%
- +   or 
@@ -69,7 +71,8 @@
-
+ +
diff --git a/modules/users/client/views/score/detail.client.view.html b/modules/users/client/views/score/detail.client.view.html index ed8481a6..e2e7f8c2 100644 --- a/modules/users/client/views/score/detail.client.view.html +++ b/modules/users/client/views/score/detail.client.view.html @@ -40,19 +40,19 @@
-
+
-
-
+
-
+
-
-
+
diff --git a/modules/users/client/views/status/warning.client.view.html b/modules/users/client/views/status/warning.client.view.html index d4b1858d..43ee2788 100644 --- a/modules/users/client/views/status/warning.client.view.html +++ b/modules/users/client/views/status/warning.client.view.html @@ -7,10 +7,9 @@ -
+
diff --git a/modules/vip/client/controllers/vip.client.controller.js b/modules/vip/client/controllers/vip.client.controller.js index 2f723465..860f81b4 100644 --- a/modules/vip/client/controllers/vip.client.controller.js +++ b/modules/vip/client/controllers/vip.client.controller.js @@ -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 */ diff --git a/modules/vip/client/templates/pay-en.md b/modules/vip/client/templates/pay-en.md index afa03966..52da9157 100644 --- a/modules/vip/client/templates/pay-en.md +++ b/modules/vip/client/templates/pay-en.md @@ -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). diff --git a/modules/vip/client/templates/pay-zh.md b/modules/vip/client/templates/pay-zh.md index 96defbcf..92d96d88 100644 --- a/modules/vip/client/templates/pay-zh.md +++ b/modules/vip/client/templates/pay-zh.md @@ -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). diff --git a/modules/vip/client/templates/vip-en.md b/modules/vip/client/templates/vip-en.md index cfd021ee..3eb04362 100644 --- a/modules/vip/client/templates/vip-en.md +++ b/modules/vip/client/templates/vip-en.md @@ -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. diff --git a/modules/vip/client/views/donate.client.view.html b/modules/vip/client/views/donate.client.view.html index 486a2077..6c5979cc 100644 --- a/modules/vip/client/views/donate.client.view.html +++ b/modules/vip/client/views/donate.client.view.html @@ -13,10 +13,9 @@
-
+
diff --git a/modules/vip/client/views/rules.client.view.html b/modules/vip/client/views/rules.client.view.html index 7b587bd0..889a5e7f 100644 --- a/modules/vip/client/views/rules.client.view.html +++ b/modules/vip/client/views/rules.client.view.html @@ -19,9 +19,8 @@
-
-
-
+
+
\ No newline at end of file