aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/staff
diff options
context:
space:
mode:
Diffstat (limited to 'pydis_site/apps/staff')
-rw-r--r--pydis_site/apps/staff/README.md19
-rw-r--r--pydis_site/apps/staff/templatetags/deletedmessage_filters.py2
-rw-r--r--pydis_site/apps/staff/urls.py2
-rw-r--r--pydis_site/apps/staff/views.py (renamed from pydis_site/apps/staff/viewsets/logs.py)0
-rw-r--r--pydis_site/apps/staff/viewsets/__init__.py3
5 files changed, 21 insertions, 5 deletions
diff --git a/pydis_site/apps/staff/README.md b/pydis_site/apps/staff/README.md
new file mode 100644
index 00000000..db263e5e
--- /dev/null
+++ b/pydis_site/apps/staff/README.md
@@ -0,0 +1,19 @@
+# The "staff" app
+
+This Django application hosts any staff-internal tooling, which, at time of
+writing, only is an endpoint to view logs uploaded by the Python bot.
+
+This app mainly interacts with a single model from the `api` app, and has no
+models on its own. The following files and directories are of interest:
+
+- [`templatetags`](./templatetags) contains custom template tags that help with
+ formatting the HTML templates of this app (these can be found in the template
+ root direcetory).
+
+- [`tests`](./tests) contains standard Django unit tests that validate both the
+ template tags and functionality of the log viewer itself.
+
+- [`urls.py`](./urls.py) contains the regular Django URL routing logic.
+
+- [`views.py`](./views.py) contains standard Django views. In our case, the
+ main work happens in the template, so this is relatively straightforward.
diff --git a/pydis_site/apps/staff/templatetags/deletedmessage_filters.py b/pydis_site/apps/staff/templatetags/deletedmessage_filters.py
index 5026068e..9d8f1819 100644
--- a/pydis_site/apps/staff/templatetags/deletedmessage_filters.py
+++ b/pydis_site/apps/staff/templatetags/deletedmessage_filters.py
@@ -28,5 +28,5 @@ def footer_datetime(timestamp: str) -> datetime:
@register.filter
def visible_newlines(text: str) -> str:
- """Takes an embed timestamp and returns a timezone-aware datetime object."""
+ """Visualizes newlines in text by replacing them with a grey-ish `↵`."""
return text.replace("\n", " <span class='has-text-grey'>↵</span><br>")
diff --git a/pydis_site/apps/staff/urls.py b/pydis_site/apps/staff/urls.py
index ca8d1a0f..0565592b 100644
--- a/pydis_site/apps/staff/urls.py
+++ b/pydis_site/apps/staff/urls.py
@@ -1,6 +1,6 @@
from django.urls import path
-from .viewsets import LogView
+from .views import LogView
app_name = 'staff'
urlpatterns = [
diff --git a/pydis_site/apps/staff/viewsets/logs.py b/pydis_site/apps/staff/views.py
index 22dede95..22dede95 100644
--- a/pydis_site/apps/staff/viewsets/logs.py
+++ b/pydis_site/apps/staff/views.py
diff --git a/pydis_site/apps/staff/viewsets/__init__.py b/pydis_site/apps/staff/viewsets/__init__.py
deleted file mode 100644
index 6b10eb83..00000000
--- a/pydis_site/apps/staff/viewsets/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from .logs import LogView
-
-__all__ = ["LogView"]