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": {
"animatedImage": true,
"image": true,
"video": true
"video": true,
"audio": true
}
}
}

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

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

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

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

Loading…
Cancel
Save