Public Lab Research note

Spam Management Dashboard (Documentation)

by keshav_sethi0004 | August 18, 2020 20:17 18 Aug 20:17 | #24349 | #24349

Spam Management Dashboard

Spam Management is one of the most crucial features of an organization. It keeps the user feed reliable, interesting, and informative. Public Lab actively works on spam filtration and has a great team of moderators to take care of that. For their ease of spam moderation, a new spam moderation dashboard is introduced.

This is the formal documentation of the Spam Management Dashboard (/spam2).

Table of contents

  • Introduction of Spam2
  • Menu
  • Bulk Moderation
  • Features of moderation table, Pagination and page preview
  • Wiki and revision filter
  • Flag
  • Queue
  • User Moderation
  • Comment Moderation
  • Insights
  • Digest
  • Responsive Design
  • Codebase
  • Remarks

Introduction of Spam2

Spam Management Dashboard is available on Only Moderators and admins have access to it. The previous version of the spam management dashboard is available at

/spam2 will redirect moderators to the bulk moderation page as shown below.image description

All the spammed and unmoderated Nodes are present along with filters and bulk moderation features.


All the navigation links related to spam2 are present in this menu and the current page will be highlighted with blue color. At the top of this menu, the role of the user is also present (Admin or Moderator). Contents of Menu are Insights | Moderation, Wiki, Queue, Revision, Comment, Flag, and User moderation.

image description

Bulk Moderation

There are in general five Bulk moderation buttons which are as follows:

  • Spam
  • Publish
  • Delete
  • Ban
  • Unban

  • Spam will mark nodes as spam(status: 0 ), ban its user(status:0) and unflag that node(flag:0 ).
  • Publish will mark nodes as publish(status:1) and unban its user(status: 1) and unflag that node(flag:0 ).
  • Delete will delete selected node permanently
  • Ban will ban the users of selected nodes
  • Unban will unban the users of selected nodes
  • Unflag will unflag selected nodes (Flag section)

All the bulk moderation buttons are disabled until nodes are selected. If one or more than one node is selected then all the buttons will get activated.

The select button will select all the nodes and remove all the selections if pressed again.

Bulk moderation nav is fully responsive and has a horizontal scroll in mobile and tablet screen sizes.


This is the main moderation page which has all the nodes and wiki which has status of 0 or 4 which means they are either spammed or unmoderated. Spammed are marked with red badge and unmoderated with blue badge for easier identification.

Columns of moderation table:

  • Title column contains the title of the node with its type and creation date. Title is also linked to the node.
  • Author column has the name of the author and the number of nodes that belong to that user. It is linked to the user profile.
  • Status has the status of node i.e spammed or unmoderated
  • Updated at is the time at which node is updated
  • Action column as all the action like publish, unban, ban, delete and spam post. According to the status of the node, these buttons will be active or inactive.

There is also a pagination select button where moderators can change items per page. By default the number of nodes per page is 30.

image description

Moderator can select the number of pages

image description

Moderator can move to the desired page

At the top and bottom of the table, page stats are also present shows the number of pages and total nodes.

Moderator can also filter nodes based on the following criteria:

  • New activity: Sort nodes by their update time.
  • Recent: Sort nodes by their creation time.
  • Spammed: Filter by 0 status and its count is also displayed in the badge.
  • Unmoderated Filter by 4 status.

"Selected" nav item will show the count of selected nodes.

Here Info dropdown button will provide basic moderation information. This section also shows some stats related to unmoderated and flag nodes. This will help moderators to keep track of remaining tasks.

Page preview

On clicking the node's title, the modal will appear which has all the body of node, 4 tags, and creation date. This can be closed by clicking anywhere on the screen.

Wiki and Revisions

Wiki page has all the published(status: 1) wikis and revision has all the spammed(status: 0) revisions.

All the main features mentioned above are present and wiki and revision.


This page contains all the nodes which are flagged by normal users. The moderation table contains columns mentioned in the moderation section. Count of flags is shown in the status column.

Filters available in the flag are following:

  • Flagged filter has all the nodes.
  • Spammed filter has nodes with 0 status.
  • Unmoderated filter has nodes with 4 status.
  • Page filter has only wikis
  • Notes filter doesn't show wikis

Flagged nodes can be unflagged by unflag action as shown below.

How can users flag a node?

Users can click on the flag icon present in the dashboard after that alert will come will stating that node is flagged.

Users can also flag a node in tools popup as shown below


This section of spam2 has all the nodes with tags that the moderator is following. Moderators can divide tasks with this section and moderate effectively.

All the tags which the moderator is following are mentioned above the moderation table. Count of followers who are moderators or admin is shown in badge with tag.

Moderators can add/remove tags from + icon.

Moderators can also filter nodes with tag by clicking on the tag as shown below. The selected tag is highlighted with blue color and nodes are filtered with respect to the tag.

Filtered nodes as per tags

User Moderation

This page has all the active users with 1 status including moderators and admins. The moderation table has features to ban and unban users as shown.

Columns of user moderation table are:

  • Username has all the user names. If a user is banned then the icon is red and if the user is moderator or admin then the icon is blue.
  • The Posts section has all the stats of that user which includes nodes count and flagged count.
  • Created at column time when the user had joined the public lab.
  • Email column has email id of the users
  • Action column has features to ban and unban users.

Filters in user moderation is shown below

  • Active user filter has all the users
  • Banned filter has all the users who are banned.
  • Moderator filter has all the moderators
  • Admin filter has all the Admins

*count of all the filters are also shown

Bulk ban and bulk unban features are also present in user moderation.

Comment Moderation

The comment section of spam2 has all the comments which are scammed or unmoderated or flagged.

Action buttons are disabled according to the status of the comment.

Columns of comment moderation page are shown below:

  • The node column has the title of the node along with its type and creation date.
  • The content column has a content of that comment
  • Author column has a user name of the author of comment and flag count of that comment
  • Created date has a creation time of comment
  • Action column has all the moderation features like spam, publish, ban, unban and unflag comment.

Filters in comment moderation are shown below:

  • New activity has all the comments which are flagged or spammed or unmoderated
  • Spammed filter has all the spammed comments
  • Unmoderated filter has all the unmoderated comments
  • Flagged filter has all the flagged comments

Comment bulk moderation

  • Spam: It marks comments as spam and ban users.
  • Publish: It marks comments as published and unban users.
  • Delete: it deletes selected comments
  • Select: select and unselect comments

Stats of unmoderated and flagged comments are also shown.

How can users flag a node?

Any user can mark a comment as a flag with flag buttonimage description


image description

This section has all the statistics for moderators for the past one month. It has count of unmoderated nodes, unmoderated comments, spammed nodes, spammed comments, flagged nodes, flagged comments, published comments, and published comments.

* These are stats are for past one month

The moderation graph depicts all line graphs of flagged, spammed, and unmoderated nodes. Flagged nodes are represented by a yellow color, spammed with red color, and unmoderated with blue color.

This is a bar graph of tags wrt count of followers which are moderators and admins. On the right-hand side, all tags are shown sorted as per their follower count which are moderators and admin.


Digest for moderators is created on a daily/weekly basis. Moderators can enable digest in the notifications settings page.

Moderators can approve and mark nodes as spam directly from mail and change frequency from notification settings.

Responsive Design

image description


Code specifically to spam2


  • app/controllers/spam2_controller.rb
  • app/controllers/batch_controller.rb


  • app/views/spam2/_comments.html.erb
  • app/views/spam2/_flags.html.erb
  • app/views/spam2/_insights.html.erb
  • app/views/spam2/_nodes.html.erb
  • app/views/spam2/_queue.html.erb
  • app/views/spam2/_revisions.html.erb
  • app/views/spam2/_spam.html.erb
  • app/views/spam2/_users.html.erb


  • app/jobs/digest_spam_job.rb


  • app/mailers/admin_mailer.rb


  • test/functional/spam2_controller_test.rb
  • test/functional/batch_controller_test.rb
  • test/system/spam2_test.rb

*There are many changes at different places as well but most of them are here.


Everything in this world has a scope of improvement and this project is no different. There are many changes and new feature requirements which arrive from time to time after testing it with real data.

So, I request everyone to please suggest changes and feature addition if needed. I am eagerly waiting for your review and suggestions.

I will surely try to improve it.

At last, I want to thank all members of Public Lab for their continuous support and suggestions

Thanks a lot!


WOW Keshav this is pretty stunning documentation! Thanks so much for sharing it! Perhaps we should link to it from the spam dashboard itself!!!

Thanks ❤️ , sure I will do that!

yes, great idea! This documentation of features is very useful, please link to this from the dashboard. Separately, what is the link to see the insights? I cannot find them.

Is this a question? Click here to post it to the Questions page.

Hey Liz, you can try this out once is merged. Thanks ❤️ 🎉

Reply to this comment...

This is great documentation, so happy to already see it linked from /spam2 -- thanks again @keshav_sethi0004 !

I'm really appreciating the keyword search within spam2 that you built, @keshav_sethi0004! Thank you again!!!!!

Reply to this comment...

Login to comment.