names of staff hidden by default with checkbxo to optionalyl show name

merge-requests/208/head
fatchan 5 years ago
parent ce5f116cb6
commit 75596eaa96
  1. 3
      configs/main.json.example
  2. 8
      models/forms/actionhandler.js
  3. 3
      views/includes/actionfooter.pug
  4. 3
      views/includes/actionfooter_globalmanage.pug
  5. 3
      views/includes/actionfooter_manage.pug

@ -111,7 +111,8 @@
"allowedFileTypes": { "allowedFileTypes": {
"animatedImage": true, "animatedImage": true,
"image": true, "image": true,
"video": true "video": true,
"audio": true
} }
} }
} }

@ -250,16 +250,22 @@ module.exports = async (req, res, next) => {
const modlog = {}; const modlog = {};
const logDate = new Date(); //all events current date const logDate = new Date(); //all events current date
const message = req.body.log_message || null; const message = req.body.log_message || null;
let logUser;
if (res.locals.permLevel < 4) { //if staff
logUser = req.session.user.username;
} else {
logUser = 'Unregistered User';
}
for (let i = 0; i < res.locals.posts.length; i++) { for (let i = 0; i < res.locals.posts.length; i++) {
const post = res.locals.posts[i]; const post = res.locals.posts[i];
if (!modlog[post.board]) { if (!modlog[post.board]) {
//per board actions, all actions combined to one event //per board actions, all actions combined to one event
const logUser = res.locals.permLevel < 4 ? req.session.user.username : 'Unregistered User'
modlog[post.board] = { modlog[post.board] = {
postIds: [], postIds: [],
actions: modlogActions, actions: modlogActions,
date: logDate, date: logDate,
user: logUser, user: logUser,
showUser: req.body.show_name || logUser === 'Unregistered User' ? true : false,
message: message, message: message,
}; };
} }

@ -51,6 +51,9 @@ details.toggle-label
label label
input.post-check(type='checkbox', name='preserve_post' value='1') input.post-check(type='checkbox', name='preserve_post' value='1')
| Show Post In Ban | Show Post In Ban
label
input.post-check(type='checkbox', name='show_name' value='1')
| Show Username In Modlog
label label
input(type='text', name='ban_reason', placeholder='ban reason' autocomplete='off') input(type='text', name='ban_reason', placeholder='ban reason' autocomplete='off')
label label

@ -35,6 +35,9 @@ details.toggle-label
label label
input.post-check(type='checkbox', name='preserve_post' value='1') input.post-check(type='checkbox', name='preserve_post' value='1')
| Show Post In Ban | Show Post In Ban
label
input.post-check(type='checkbox', name='show_name' value='1')
| Show Username In Modlog
label label
input(type='text', name='ban_reason', placeholder='ban reason' autocomplete='off') input(type='text', name='ban_reason', placeholder='ban reason' autocomplete='off')
label label

@ -46,6 +46,9 @@ details.toggle-label
label label
input.post-check(type='checkbox', name='preserve_post' value='1') input.post-check(type='checkbox', name='preserve_post' value='1')
| Show Post In Ban | Show Post In Ban
label
input.post-check(type='checkbox', name='show_name' value='1')
| Show Username In Modlog
label label
input(type='text', name='ban_reason', placeholder='ban reason' autocomplete='off') input(type='text', name='ban_reason', placeholder='ban reason' autocomplete='off')
label label

Loading…
Cancel
Save