summaryrefslogtreecommitdiffstats
path: root/takahe
diff options
context:
space:
mode:
Diffstat (limited to 'takahe')
-rw-r--r--takahe/settings/base.py2
-rw-r--r--takahe/urls.py14
2 files changed, 12 insertions, 4 deletions
diff --git a/takahe/settings/base.py b/takahe/settings/base.py
index 4808d97..e45133d 100644
--- a/takahe/settings/base.py
+++ b/takahe/settings/base.py
@@ -12,6 +12,7 @@ INSTALLED_APPS = [
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
+ "django_htmx",
"core",
"activities",
"users",
@@ -26,6 +27,7 @@ MIDDLEWARE = [
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
+ "django_htmx.middleware.HtmxMiddleware",
"users.middleware.IdentityMiddleware",
]
diff --git a/takahe/urls.py b/takahe/urls.py
index bebd63a..a87ec87 100644
--- a/takahe/urls.py
+++ b/takahe/urls.py
@@ -1,7 +1,7 @@
from django.contrib import admin
from django.urls import path
-from activities.views import timelines
+from activities.views import posts, timelines
from core import views as core
from stator import views as stator
from users.views import activitypub, auth, identity
@@ -12,14 +12,20 @@ urlpatterns = [
path("notifications/", timelines.Notifications.as_view()),
path("local/", timelines.Local.as_view()),
path("federated/", timelines.Federated.as_view()),
- # Authentication
- path("auth/login/", auth.Login.as_view()),
- path("auth/logout/", auth.Logout.as_view()),
# Identity views
path("@<handle>/", identity.ViewIdentity.as_view()),
path("@<handle>/actor/", activitypub.Actor.as_view()),
path("@<handle>/actor/inbox/", activitypub.Inbox.as_view()),
path("@<handle>/action/", identity.ActionIdentity.as_view()),
+ # Posts
+ path("@<handle>/posts/<int:post_id>/", posts.Post.as_view()),
+ path("@<handle>/posts/<int:post_id>/like/", posts.Like.as_view()),
+ path("@<handle>/posts/<int:post_id>/unlike/", posts.Like.as_view(undo=True)),
+ path("@<handle>/posts/<int:post_id>/boost/", posts.Boost.as_view()),
+ path("@<handle>/posts/<int:post_id>/unboost/", posts.Boost.as_view(undo=True)),
+ # Authentication
+ path("auth/login/", auth.Login.as_view()),
+ path("auth/logout/", auth.Logout.as_view()),
# Identity selection
path("@<handle>/activate/", identity.ActivateIdentity.as_view()),
path("identity/select/", identity.SelectIdentity.as_view()),