diff --git a/controllers/flag.js b/controllers/flag.js index c220b13d3..243cd182e 100644 --- a/controllers/flag.js +++ b/controllers/flag.js @@ -26,6 +26,7 @@ var flagLib = require('../libs/flag'); var statusCodePage = require('../libs/templateHelpers').statusCodePage; //--- Configuration inclusions +var userRoles = require('../models/userRoles.json'); //--- @@ -184,6 +185,7 @@ exports.getFlaggedListForContent = function (aModelName, aOptions, aCallback) { contentList[aContentKey].flaggedList.push({ name: aUser.name, + rank: userRoles[aUser.role], reason: aFlagList[aFlagKey].reason, since: aFlagList[aFlagKey].created }); diff --git a/controllers/index.js b/controllers/index.js index 6e0707194..9398d26b0 100644 --- a/controllers/index.js +++ b/controllers/index.js @@ -100,7 +100,7 @@ exports.home = function (aReq, aRes) { async.parallel([ function (aCallback) { - if (!!!options.isFlagged || !options.isAdmin) { // NOTE: Watchpoint + if (!!!options.isFlagged || !options.isMod) { // NOTE: Watchpoint aCallback(); return; } diff --git a/controllers/script.js b/controllers/script.js index 31f109200..9f530226c 100644 --- a/controllers/script.js +++ b/controllers/script.js @@ -340,7 +340,7 @@ exports.view = function (aReq, aRes, aNext) { async.parallel([ function (aCallback) { - if (!options.isAdmin) { // NOTE: Watchpoint + if (!options.isMod) { // NOTE: Watchpoint aCallback(); return; } diff --git a/controllers/user.js b/controllers/user.js index c499262e8..1aa1aa6e2 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -398,7 +398,7 @@ exports.userListPage = function (aReq, aRes, aNext) { async.parallel([ function (aCallback) { - if (!!!options.isFlagged || !options.isAdmin) { // NOTE: Watchpoint + if (!!!options.isFlagged || !options.isMod) { // NOTE: Watchpoint aCallback(); return; } @@ -471,7 +471,7 @@ exports.view = function (aReq, aRes, aNext) { async.parallel([ function (aCallback) { - if (!options.isAdmin) { // NOTE: Watchpoint + if (!options.isMod) { // NOTE: Watchpoint aCallback(); return; } @@ -703,7 +703,7 @@ exports.userScriptListPage = function (aReq, aRes, aNext) { async.parallel([ function (aCallback) { - if (!!!options.isFlagged || !options.isAdmin) { // NOTE: Watchpoint + if (!!!options.isFlagged || !options.isMod) { // NOTE: Watchpoint aCallback(); return; } diff --git a/views/includes/scriptAdminToolsPanel.html b/views/includes/scriptAdminToolsPanel.html index 8446819ef..dfaff8f65 100644 --- a/views/includes/scriptAdminToolsPanel.html +++ b/views/includes/scriptAdminToolsPanel.html @@ -7,23 +7,6 @@
- {{#hasFlagged}} -
-
- -
-
    - {{#script.flaggedList}} -
  • - {{#name}}{{name}}{{/name}} - {{#reason}}{{reason}}{{/reason}}{{^reason}}…{{/reason}} -
  • - {{/script.flaggedList}} -
-
-
-
- {{/hasFlagged}}
diff --git a/views/includes/scriptList.html b/views/includes/scriptList.html index 943572df7..44a966e27 100644 --- a/views/includes/scriptList.html +++ b/views/includes/scriptList.html @@ -11,51 +11,100 @@ - {{#scriptList}} - - - {{#showSourceNotices}}{{/showSourceNotices}} - {{#showSourceNoticesCritical}}{{/showSourceNoticesCritical}} - {{#_issueCount}}{{_issueCount}}{{/_issueCount}} - - {{name}} - {{#meta.UserScript.version}} - {{value}} - {{/meta.UserScript.version}} - by {{author.name}} - {{#_description}}

{{_description}}{{#hasLongDescription}}…{{/hasLongDescription}}

{{/_description}} - - {{^librariesOnly}} - -

{{#isLib}}–{{/isLib}}{{^isLib}}{{installs}}{{/isLib}}

- - {{/librariesOnly}} - -

{{rating}}

-
-
-
-
- - - - - {{#hasFlagged}} - -
    - {{#flaggedList}} -
  • - {{#name}}{{name}}{{/name}} - {{#reason}}{{reason}}{{/reason}}{{^reason}}…{{/reason}} -
  • - {{/flaggedList}} -
- - {{/hasFlagged}} - - {{/scriptList}} + {{#isAdmin}} + {{#scriptList}} + + + {{#showSourceNotices}}{{/showSourceNotices}} + {{#showSourceNoticesCritical}}{{/showSourceNoticesCritical}} + {{#_issueCount}}{{_issueCount}}{{/_issueCount}} + + {{name}} + {{#meta.UserScript.version}} + {{value}} + {{/meta.UserScript.version}} + by {{author.name}} + {{#_description}}

{{_description}}{{#hasLongDescription}}…{{/hasLongDescription}}

{{/_description}} + + {{^librariesOnly}} + +

{{#isLib}}–{{/isLib}}{{^isLib}}{{installs}}{{/isLib}}

+ + {{/librariesOnly}} + +

{{rating}}

+
+
+
+
+ + + + + {{#hasFlagged}} + +
    + {{#flaggedList}} +
  • + {{#name}}{{name}}{{/name}} + {{#reason}}{{reason}}{{/reason}}{{^reason}}…{{/reason}} +
  • + {{/flaggedList}} +
+ + {{/hasFlagged}} + + {{/scriptList}} + {{/isAdmin}} + {{^isAdmin}} + {{#scriptList}} + + + {{#showSourceNotices}}{{/showSourceNotices}} + {{#showSourceNoticesCritical}}{{/showSourceNoticesCritical}} + {{#_issueCount}}{{_issueCount}}{{/_issueCount}} + + {{name}} + {{#meta.UserScript.version}} + {{value}} + {{/meta.UserScript.version}} + by {{author.name}} + {{#_description}}

{{_description}}{{#hasLongDescription}}…{{/hasLongDescription}}

{{/_description}} + + {{^librariesOnly}} + +

{{#isLib}}–{{/isLib}}{{^isLib}}{{installs}}{{/isLib}}

+ + {{/librariesOnly}} + +

{{rating}}

+
+
+
+
+ + + + + {{#hasFlagged}} + +
    + {{#flaggedList}} +
  • + {{#name}}{{rank}}{{/name}} + {{#reason}}{{reason}}{{/reason}}{{^reason}}…{{/reason}} +
  • + {{/flaggedList}} +
+ + {{/hasFlagged}} + + {{/scriptList}} + {{/isAdmin}} {{^scriptList}} diff --git a/views/includes/scriptModToolsPanel.html b/views/includes/scriptModToolsPanel.html index fe872f6cf..325c59199 100644 --- a/views/includes/scriptModToolsPanel.html +++ b/views/includes/scriptModToolsPanel.html @@ -1,5 +1,5 @@ {{#modTools}} -
+
@@ -10,6 +10,44 @@ {{#script}} {{> includes/flagModelSnippet.html }} {{/script}} + {{#isAdmin}} + {{#hasFlagged}} +
+
+ +
+
    + {{#script.flaggedList}} +
  • + {{#name}}{{name}}{{/name}} + {{#reason}}{{reason}}{{/reason}}{{^reason}}…{{/reason}} +
  • + {{/script.flaggedList}} +
+
+
+
+ {{/hasFlagged}} + {{/isAdmin}} + {{^isAdmin}} + {{#hasFlagged}} +
+
+ +
+
    + {{#script.flaggedList}} +
  • + {{#name}}{{rank}}{{/name}} + {{#reason}}{{reason}}{{/reason}}{{^reason}}…{{/reason}} +
  • + {{/script.flaggedList}} +
+
+
+
+ {{/hasFlagged}} + {{/isAdmin}} {{#canRemove}}
- {{#hasFlagged}} -
-
- -
-
    - {{#user.flaggedList}} -
  • - {{#name}}{{name}}{{/name}} - {{#reason}}{{reason}}{{/reason}}{{^reason}}…{{/reason}} -
  • - {{/user.flaggedList}} -
-
-
-
- {{/hasFlagged}}
diff --git a/views/includes/userList.html b/views/includes/userList.html index ffea34d53..d4642df0c 100644 --- a/views/includes/userList.html +++ b/views/includes/userList.html @@ -1,7 +1,7 @@ - + {{#hasFlagged}} @@ -10,35 +10,68 @@ - {{#userList}} - - - - - {{#hasFlagged}} - - {{/hasFlagged}} - - {{/userList}} + {{#isAdmin}} + {{#userList}} + + + + + {{#hasFlagged}} + + {{/hasFlagged}} + + {{/userList}} + {{/isAdmin}} + {{^isAdmin}} + {{#userList}} + + + + + {{#hasFlagged}} + + {{/hasFlagged}} + + {{/userList}} + {{/isAdmin}} {{^userList}}
NameName Since Rank