From bc848f260daa67756baf380501c7576c5909dfd7 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Fri, 20 Oct 2017 14:24:35 +0800 Subject: [PATCH] feat(about): add function with admin/oper list user can send message to them at here --- .../about/client/config/about.client.menus.js | 6 ++ .../client/config/about.client.routes.js | 8 +++ .../controllers/about.client.controller.js | 17 ++++- modules/about/client/less/about.less | 62 ++++++++++++++++++- .../about/client/views/black.client.view.html | 8 +-- .../client/views/operlist.client.view.html | 30 +++++++++ modules/core/client/app/trans-string-en.js | 6 +- modules/core/client/app/trans-string-zh.js | 6 +- 8 files changed, 132 insertions(+), 11 deletions(-) create mode 100644 modules/about/client/views/operlist.client.view.html diff --git a/modules/about/client/config/about.client.menus.js b/modules/about/client/config/about.client.menus.js index 948e5350..c48fcd2c 100644 --- a/modules/about/client/config/about.client.menus.js +++ b/modules/about/client/config/about.client.menus.js @@ -32,6 +32,12 @@ state: 'about.maker', position: 3 }); + menuService.addSubMenuItem('topbar', 'about', { + title: 'MENU_ABOUT_OPERLIST', + state: 'about.operlist', + position: 4, + divider: true + }); } }()); diff --git a/modules/about/client/config/about.client.routes.js b/modules/about/client/config/about.client.routes.js index 8ac055fa..4e36f6c8 100644 --- a/modules/about/client/config/about.client.routes.js +++ b/modules/about/client/config/about.client.routes.js @@ -35,6 +35,14 @@ roles: ['user', 'oper', 'admin'], pageTitle: 'PAGETITLE.MAKER' } + }) + .state('about.operlist', { + url: '/operlist', + templateUrl: '/modules/about/client/views/operlist.client.view.html', + data: { + roles: ['user', 'oper', 'admin'], + pageTitle: 'PAGETITLE.OPERLIST' + } }); } }()); diff --git a/modules/about/client/controllers/about.client.controller.js b/modules/about/client/controllers/about.client.controller.js index fe864a59..b116d190 100644 --- a/modules/about/client/controllers/about.client.controller.js +++ b/modules/about/client/controllers/about.client.controller.js @@ -5,16 +5,29 @@ .module('about') .controller('AboutController', AboutController); - AboutController.$inject = ['$scope', 'getStorageLangService', 'MeanTorrentConfig']; + AboutController.$inject = ['$scope', 'getStorageLangService', 'MeanTorrentConfig', 'AdminService']; - function AboutController($scope, getStorageLangService, MeanTorrentConfig) { + function AboutController($scope, getStorageLangService, MeanTorrentConfig, AdminService) { var vm = this; vm.lang = getStorageLangService.getLang(); vm.blackListConfig = MeanTorrentConfig.meanTorrentConfig.clientBlackList; + vm.appConfig = MeanTorrentConfig.meanTorrentConfig.app; vm.announce = MeanTorrentConfig.meanTorrentConfig.announce; vm.init = function () { }; + + /** + * getOperList + */ + vm.getOperList = function () { + AdminService.get({ + isOper: true, + isAdmin: true + }, function (data) { + vm.operList = data.rows; + }); + }; } }()); diff --git a/modules/about/client/less/about.less b/modules/about/client/less/about.less index bfb998a5..a773419a 100644 --- a/modules/about/client/less/about.less +++ b/modules/about/client/less/about.less @@ -23,7 +23,9 @@ z-index: 100; } span { - color: #888; + color: #999; + position: relative; + z-index: 100; } &:hover { @@ -32,7 +34,7 @@ transform: scale(1.5); /* csslint ignore:end */ } - h4 { + h4, span { color: #fff; } .black-icon { @@ -49,6 +51,62 @@ } } +.oper-list { + .oper-item { + cursor: pointer; + position: relative; + border: solid 1px darken(@state-danger-text, 15%); + border-radius: 4px; + background-color: lighten(@state-danger-text, 1%); + padding: 10px 0 15px 0; + margin: 20px 0 0 0; + overflow: hidden; + + &.is-admin { + background-color: darken(@state-danger-text, 10%); + } + + .fa { + transition-property: transform, opacity; + transition-duration: .5s; + transition-timing-function: ease; + font-size: 7em; + color: #888; + } + span { + color: #ddd; + position: relative; + z-index: 100; + } + div { + color: #999; + position: relative; + z-index: 100; + } + + &:hover { + .fa { + /* csslint ignore:start */ + transform: scale(1.5); + /* csslint ignore:end */ + } + .h3, .h4, div { + color: #fff; + } + .oper-icon { + opacity: 0.3; + } + } + } + + .oper-icon { + position: absolute; + top: 2px; + right: -40px; + opacity: 0.5; + } +} + .maker-side-overlay { top: 50px !important; @media (min-width: @screen-sm-min) { diff --git a/modules/about/client/views/black.client.view.html b/modules/about/client/views/black.client.view.html index e4178844..507a4e7d 100644 --- a/modules/about/client/views/black.client.view.html +++ b/modules/about/client/views/black.client.view.html @@ -16,11 +16,9 @@
-
-

{{b.name}}

- {{b.type}} - -
+

{{b.name}}

+ {{b.type}} +
diff --git a/modules/about/client/views/operlist.client.view.html b/modules/about/client/views/operlist.client.view.html new file mode 100644 index 00000000..30784828 --- /dev/null +++ b/modules/about/client/views/operlist.client.view.html @@ -0,0 +1,30 @@ +
+
+
+ +

+ {{'ABOUT.OPER_LIST' | translate}} +

+
+ +
+ +
+ +
+
+
+ + + +
ID: {{o.username}}
+
{{o.isAdmin ? 'Administrator' : 'Operator'}}
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index c7abf846..ad452e38 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -36,6 +36,7 @@ MENU_ABOUT_RULES: 'Rules', MENU_ABOUT_BLACKLIST: 'Client Black List', MENU_ABOUT_MAKERGROUP: 'Torrents Maker Group', + MENU_ABOUT_OPERLIST: 'Admin/Oper List', MENU_VIP: 'VIP', MENU_ADMIN: 'Admin', @@ -155,6 +156,7 @@ RULES: 'Rules', BLACK: 'Client Black List', MAKER: 'Torrents Maker Group', + OPERLIST: 'Admin/Oper List', COLLECTIONS: 'Torrents Collections', VIP: 'Vip', FORUM: 'Forum', @@ -470,7 +472,9 @@ FORM_MAKER_DESC: 'Maker Group Description', FORM_MAKER_FOR: 'Create maker group for - {{name}}', MAKER_CREATE_SUCCESSFULLY: 'Create maker group successfully', - MAKER_CREATE_FAILED: 'Create maker group failed' + MAKER_CREATE_FAILED: 'Create maker group failed', + OPER_LIST: 'Admin and Oper List', + OPER_LIST_TOOLTIP: '

Note:

All the users in the list was the Administrator or Operator of {{site}}, If you need any help, please mailto our administrator or send a message to them from below.' }, //collections views diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index ee15fd87..23a2ed3f 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -36,6 +36,7 @@ MENU_ABOUT_RULES: '站内规则', MENU_ABOUT_BLACKLIST: '禁止客户端列表', MENU_ABOUT_MAKERGROUP: '资源压制小组', + MENU_ABOUT_OPERLIST: 'Admin/Oper 列表', MENU_VIP: 'VIP', MENU_ADMIN: '管理中心', @@ -155,6 +156,7 @@ RULES: '规则', BLACK: '禁止客户端列表', MAKER: '资源压制小组', + OPERLIST: 'Admin/Oper 列表', COLLECTIONS: '资源系列', VIP: 'Vip', FORUM: '论坛', @@ -470,7 +472,9 @@ FORM_MAKER_DESC: '资源压制小组简介', FORM_MAKER_FOR: '创建资源压制小组 - {{name}}', MAKER_CREATE_SUCCESSFULLY: '资源压制小组创建成功', - MAKER_CREATE_FAILED: '资源压制小组创建失败' + MAKER_CREATE_FAILED: '资源压制小组创建失败', + OPER_LIST: 'Admin & Oper 列表', + OPER_LIST_TOOLTIP: '

提示:

下面列出的所有用户都是 {{site}} 站点的 Administrator 或 Operator, 如果你需要帮助, 请向我们的 系统管理员 发送邮件或向下面列出的管理员发送站内消息.' }, //collections views