Skip to content

feat(moderation): implement semantic activity logs UI and scalable architecture - #2

Open
mnietona wants to merge 3 commits into
feat/moderation-dashboardfrom
feat/moderation-logs-ui
Open

feat(moderation): implement semantic activity logs UI and scalable architecture#2
mnietona wants to merge 3 commits into
feat/moderation-dashboardfrom
feat/moderation-logs-ui

Conversation

@mnietona

@mnietona mnietona commented Apr 4, 2026

Copy link
Copy Markdown
Owner

Description

This PR builds upon the Moderation Dashboard to introduce a clean and scalable Activity Logs system.

Instead of dealing with raw database field names and complex if/else logic in the HTML, I refactored the ModerationLog model using Object-Oriented Programming (OOP) principles. The model now acts as a "translator" that formats its own data, making future additions trivial.

Key implementations:

  1. Scalable OOP Architecture: Added @property methods (action_text, action_color, target_text) to ModerationLog. If we add new actions in the future (e.g., hiding a document, archiving a course), we just need to update the model. The UI will adapt automatically without touching any HTML.
  2. Semantic Tracking: Refactored views.py to stop logging raw, noisy database fields. We now log explicit semantic actions (action_accepter, action_rejeter) for cleaner auditing, and exclude old technical noise from queries.
  3. Scrollable Dashboard UI: Added a sticky-header, scrollable activity table to the main moderation dashboard so moderators can see recent actions at a glance.
  4. Django Admin Cleanup: Removed the now-redundant RepresentativeRequest from the Django admin and applied the semantic properties to the ModerationLog admin view for a perfectly clean backend.

📸 Screenshots

1. Scrollable UI on the Dashboard
CleanShot 2026-04-04 at 11 54 29

2. Cleaned up Django Admin Interface
CleanShot 2026-04-04 at 11 54 47

⚠️ Note for review

This PR is stacked on top of the feat/moderation-dashboard branch. It should be reviewed and merged after the initial moderation hub PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant