From 20e63023bb0d3c7e4cb36b91b73e79f51889cc90 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Tue, 15 Nov 2022 18:30:30 -0700 Subject: Get outbound likes/boosts and their undos working --- takahe/settings/base.py | 2 ++ takahe/urls.py | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'takahe') 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("@/", identity.ViewIdentity.as_view()), path("@/actor/", activitypub.Actor.as_view()), path("@/actor/inbox/", activitypub.Inbox.as_view()), path("@/action/", identity.ActionIdentity.as_view()), + # Posts + path("@/posts//", posts.Post.as_view()), + path("@/posts//like/", posts.Like.as_view()), + path("@/posts//unlike/", posts.Like.as_view(undo=True)), + path("@/posts//boost/", posts.Boost.as_view()), + path("@/posts//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("@/activate/", identity.ActivateIdentity.as_view()), path("identity/select/", identity.SelectIdentity.as_view()), -- cgit v1.2.3