Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions pydis_site/apps/staff/README.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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>")
2 changes: 1 addition & 1 deletion pydis_site/apps/staff/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.urls import path

from .viewsets import LogView
from .views import LogView

app_name = 'staff'
urlpatterns = [
Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions pydis_site/apps/staff/viewsets/__init__.py

This file was deleted.