diff options
author | 2023-04-20 18:57:47 -0700 | |
---|---|---|
committer | 2023-04-20 18:57:47 -0700 | |
commit | 49130f733d621f0c11265d791eea01b13e2160c4 (patch) | |
tree | 8f6880710fad3a7300076a3104f8dacb05248807 | |
parent | Merge pull request #946 from python-discord/dependabot/pip/sentry-sdk-1.20.0 (diff) | |
parent | Merge branch 'main' into staff-app-readme (diff) |
Merge pull request #941 from python-discord/staff-app-readme
-rw-r--r-- | pydis_site/apps/staff/README.md | 19 | ||||
-rw-r--r-- | pydis_site/apps/staff/templatetags/deletedmessage_filters.py | 2 | ||||
-rw-r--r-- | pydis_site/apps/staff/urls.py | 2 | ||||
-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__.py | 3 |
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..6707bf26 --- /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, is only 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"] |