From a3762dc8398f83e0112b7833a6259d2c041617db Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 29 Mar 2020 17:49:20 +0200 Subject: Show bookmark and lazy chat submission forms if and only if logged in. With the recent session cookie fix, this now works as it should and can therefore be enabled. Change-Id: I96cfdcd99952e7f91ae468de80d6445a024c74b5 --- .../java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java | 6 ++---- src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatResource.java | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java b/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java index df1fd55..485a96e 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java @@ -108,9 +108,8 @@ public class BookmarkResource { .data("posts", q.posts) .data("feedUri", "/bookmarks/feed") .data("pageTitle", "Bookmarks") - .data("showBookmarkForm", false) + .data("showBookmarkForm", !identity.isAnonymous()) .data("showLazychatForm", false) - .data("authenticated", !identity.isAnonymous()) .data("hasPreviousPage", q.prevCursor != null) .data("hasNextPage", q.nextCursor != null) .data("previousCursor", q.prevCursor) @@ -136,9 +135,8 @@ public class BookmarkResource { .data("posts", q.posts) .data("feedUri", String.format("/bookmarks/~%s/feed", ownerName)) .data("pageTitle", "Bookmarks") - .data("showBookmarkForm", false) + .data("showBookmarkForm", !identity.isAnonymous()) .data("showLazychatForm", false) - .data("authenticated", !identity.isAnonymous()) .data("hasPreviousPage", q.prevCursor != null) .data("hasNextPage", q.nextCursor != null) .data("previousCursor", q.prevCursor) diff --git a/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatResource.java b/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatResource.java index 173fb10..a74692b 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatResource.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatResource.java @@ -76,7 +76,7 @@ public class LazychatResource { .data("posts", q.posts) .data("pageTitle", "Lazy Chat") .data("showBookmarkForm", false) - .data("showLazychatForm", true) + .data("showLazychatForm", !identity.isAnonymous()) .data("hasPreviousPage", q.prevCursor != null) .data("hasNextPage", q.nextCursor != null) .data("previousCursor", q.prevCursor) @@ -102,7 +102,7 @@ public class LazychatResource { .data("posts", q.posts) .data("pageTitle", "Lazy Chat") .data("showBookmarkForm", false) - .data("showLazychatForm", true) + .data("showLazychatForm", !identity.isAnonymous()) .data("hasPreviousPage", q.prevCursor != null) .data("hasNextPage", q.nextCursor != null) .data("previousCursor", q.prevCursor) -- cgit v1.2.3