mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-28 15:59:45 +02:00
feat(forums): show forum attr of vipOnly/operOnly/readOnly
This commit is contained in:
@@ -17,7 +17,10 @@
|
||||
<tbody>
|
||||
<tr ng-repeat="f in vm.forums | filter: { category: cat.value }">
|
||||
<td>
|
||||
<h4>{{f.name}} <span class="badge badge_mt" ng-show="f.readOnly">R</span>
|
||||
<h4>{{f.name}}
|
||||
<span class="badge badge_mt" ng-show="f.readOnly">R</span>
|
||||
<span class="badge badge_mt" ng-show="f.vipOnly">V</span>
|
||||
<span class="badge badge_mt" ng-show="f.operOnly">O</span>
|
||||
<small>[<a href="#" ng-click="vm.popupEditForum($event, f);">{{'FORUMS.LINK_EDIT' | translate}}</a>]</small>
|
||||
<small ng-if="!f.operOnly">[<a href="#"
|
||||
uib-popover-template="vm.addModeratorPopover.templateUrl"
|
||||
|
||||
@@ -32,8 +32,20 @@ var mtDebug = require(path.resolve('./config/lib/debug'));
|
||||
* @param res
|
||||
*/
|
||||
exports.list = function (req, res) {
|
||||
var condition = {};
|
||||
|
||||
if (!req.user.isOper) {
|
||||
condition.operOnly = false;
|
||||
}
|
||||
if (!req.user.isOper && !req.user.isVip) {
|
||||
condition.vipOnly = false;
|
||||
}
|
||||
|
||||
console.log('------------------------condition------------------------');
|
||||
console.log(condition);
|
||||
|
||||
var findForumsList = function (callback) {
|
||||
Forum.find()
|
||||
Forum.find(condition)
|
||||
.sort('category order -createdat')
|
||||
.populate({
|
||||
path: 'lastTopic',
|
||||
@@ -54,6 +66,7 @@ exports.list = function (req, res) {
|
||||
|
||||
var forumsTopicsCount = function (callback) {
|
||||
Topic.aggregate({
|
||||
// $match: condition,
|
||||
$project: {
|
||||
'forum': '$forum',
|
||||
'year': {
|
||||
|
||||
Reference in New Issue
Block a user