User-Owned Forums #47

Open
noah wants to merge 0 commits from user-forums into main
Owner

Implements #18

To Do:

  • Data Model:
    • ForumMembership to subscribe users to their favorite forums and carry a moderator status if applicable.
  • Forum Admin Page:
    • Regular users can access it and create/manage their owned forums.
    • Search forums by fragment, title or description
    • Admin option: show only official forums
    • Ability to delete a forum
    • Sorting options:
      • Updated
      • Created
      • Name
      • Fragment
    • Note: this page was already ready for this: non-admins already were filtered to owned forums and had restricted options available (no privileged, photo, etc. forums)
  • Create & Edit Forum Page:
    • Admin option to re-assign owner username of a forum.
    • Note: all other requirements for #18 were already handled.
  • My List Page:
    • The list is part of the home/Categories page.
  • Forum Landing Page:
    • "Explore" tab added to tab bar
    • "My List" appears as the first category on Categories page, if user follows any forums.
    • Proper pagination: the home/Categories tab sets a per_page size of 100 for official forums and My List forums. So if the user follows more than 100 forums only the first 100 will show currently.
  • New "Explore" Tab:
    • Search & Sort forums
    • Filter on All, Official, Community, or My List forums
    • Paginated
    • Sort options:
      • Name (a-z, z-a)
      • Recent post created
      • Recent reply in threads
  • "Newest" Tab:
    • "Which forums" filter: All, Official, Community, My List
    • Store the user's last "Which forums" option as their default when coming back to the page (similar to the Site Gallery "Whose photos" default)
  • Subscribe Buttons
    • On Forum home pages which show threads
    • On thread pages within the forum
    • Quick-subscribe buttons on the Categories & Explore tab forum listings
    • If you are a Moderator: extra confirmation screen to unsubscribe/button in fewer places.
  • Moderation
    • Forum Owner is able to delete posts/comments on their forum.
    • Forum Owner is able to appoint other moderators (ForumMembership with moderator flag)
      • A notification is sent when you are added as a forum moderator
      • Forum Owner can remove moderators, which revokes their notification too
      • Moderators can remove themselves (by unfollowing the forum), which revokes their notification too
    • Forum moderators can Pin posts, Lock replies on their threads.
  • Manage Moderators Page
    • Link on the Forum Admin page and the Forum's board index page.
    • Ability to list, add and remove moderators for your forum
  • Notifications
    • When you have been appointed as moderator on a forum.
  • Spit & Polish
    • Gate users' ability to create forums, e.g.:
      • 10 comments on the forum needed before creating your first forum (to show familiarity with the system and commitment)
      • 50 comments on the forum before you can create your second user forum (and so on)
      • To reduce risk of a new user signing up, creating forums, deleting their account and leaving their forums orphaned.
    • Petition for ownership of a forum
      • If a user deletes their account and disowns their forums, other users can petition to be transferred ownership.
      • This will just look like a "Contact/Report" category for a user to write a message and state their case.

Implements #18 To Do: * Data Model: * [x] ForumMembership to subscribe users to their favorite forums and carry a moderator status if applicable. * Forum Admin Page: * [x] Regular users can access it and create/manage their owned forums. * [x] Search forums by fragment, title or description * [x] Admin option: show only official forums * [ ] Ability to delete a forum * Sorting options: * [x] Updated * [x] Created * [x] Name * [ ] Fragment * Note: this page was already ready for this: non-admins already were filtered to owned forums and had restricted options available (no privileged, photo, etc. forums) * Create & Edit Forum Page: * [ ] Admin option to re-assign owner username of a forum. * Note: all other requirements for #18 were already handled. * ~~My List Page:~~ * The list is part of the home/Categories page. * Forum Landing Page: * [x] "Explore" tab added to tab bar * [x] "My List" appears as the first category on Categories page, if user follows any forums. * [ ] Proper pagination: the home/Categories tab sets a per_page size of 100 for official forums and My List forums. So if the user follows more than 100 forums only the first 100 will show currently. * **New** "Explore" Tab: * [x] Search & Sort forums * [x] Filter on All, Official, Community, or My List forums * [x] Paginated * Sort options: * [x] Name (a-z, z-a) * [x] Recent post created * [x] Recent reply in threads * "Newest" Tab: * [x] "Which forums" filter: All, Official, Community, My List * [x] Store the user's last "Which forums" option as their default when coming back to the page (similar to the Site Gallery "Whose photos" default) * Subscribe Buttons * [x] On Forum home pages which show threads * [x] On thread pages within the forum * [ ] Quick-subscribe buttons on the Categories & Explore tab forum listings * [ ] If you are a Moderator: extra confirmation screen to unsubscribe/button in fewer places. * Moderation * [x] Forum Owner is able to delete posts/comments on their forum. * [x] Forum Owner is able to appoint other moderators (ForumMembership with moderator flag) * [x] A notification is sent when you are added as a forum moderator * [x] Forum Owner can remove moderators, which revokes their notification too * [x] Moderators can remove themselves (by unfollowing the forum), which revokes their notification too * [x] Forum moderators can Pin posts, Lock replies on their threads. * Manage Moderators Page * [x] Link on the Forum Admin page and the Forum's board index page. * [x] Ability to list, add and remove moderators for your forum * Notifications * [x] When you have been appointed as moderator on a forum. * Spit & Polish * [x] Gate users' ability to create forums, e.g.: * 10 comments on the forum needed before creating your first forum (to show familiarity with the system and commitment) * 50 comments on the forum before you can create your second user forum (and so on) * To reduce risk of a new user signing up, creating forums, deleting their account and leaving their forums orphaned. * [x] Petition for ownership of a forum * If a user deletes their account and disowns their forums, other users can petition to be transferred ownership. * This will just look like a "Contact/Report" category for a user to write a message and state their case. ---
noah added 2 commits 2024-08-21 04:27:29 +00:00
Allow regular (non-admin) users access to the Manage Forums page so they can
create and manage their own forums.

Things that were already working:

* The admin forum page was already anticipating regular LoginRequired credential
* Users only see their owned forums, while admins can see and manage ALL forums

Improvements made to the Forum Admin page:

* Change the title color from admin-red to user-blue.
* Add ability to search (filter) and sort the forums.

Other changes:

* Turn the Forum tab bar into a reusable component.
* Add "Browse" tab to the forums to view them all.
  * Text search
  * Show all, official, community, or "My List" forums.
* Add a Follow/Unfollow button into the header bar of forums to add it to
  "My List"
* On the Categories page, a special "My List" category appears at the top
  if the user follows categories, with their follows in alphabetical order.
* On the Categories & Browse pages: forums you follow will have a green
  bookmark icon by their name.

Permissions:

* The forum owner is able to Delete comments by others, but not Edit.

Notes:

* Currently a max limit of 100 follow forums (no pagination yet).
noah added 1 commit 2024-08-22 04:53:48 +00:00
* The "Newest" tab of the forum is updated with new filter options.
  * Which forums: All, Official, Community, My List
  * Show: By threads, All posts
  * The option for "Which forums" is saved in the user's preferences and set as
    their default on future visits, similar to the Site Gallery "Whose photos"
    option.
  * So users can subscribe to their favorite forums and always get their latest
    posts easily while filtering out the rest.
* Forum Moderators
  * Add the ability to add and remove moderators for your forum.
  * Users are notified when they are added as a moderator.
  * Moderators can opt themselves out by unfollowing the forum.
* ForumMembership: add unique constraint on user_id,forum_id.
noah added 1 commit 2024-08-22 05:26:16 +00:00
* Private forums: CanBeSeenBy moderators, approved followers, its owner and
  admin users.
  * Note: the endpoint to subscribe to the forum won't allow users to follow
    the private forum, so approved followers can not be created at this time,
    except by adding them as moderators.
* Admins: when creating a forum they can choose "no category" to create it as
  an unofficial community forum.
* Code cleanup
  * More feature flag checking
noah added 1 commit 2024-08-22 06:06:14 +00:00
* Add a "Report" link to the footer of forums.
* Allow some non-admin users to view a private forum and its threads.
  * Moderators and approved followers can see it
  * Note: the endpoint to follow a forum won't let a user invite themselves
    to a private forum. Currently there is no way to approve a user except
    by also adding them as a moderator.
  * Explore and Newest tabs can show these private forums if viewable.
noah added 1 commit 2024-08-23 04:57:37 +00:00
Add minimum quotas for users to earn the ability to create custom forums.

The entry requirements that could earn the first forum include:
1. Having a Certified account status for at least 45 days.
2. Having written 10 posts or replies in the forums.

Additional quota is granted in increasing difficulty based on the count of
forum posts created.

Other changes:

* Admin view of Manage Forums can filter for official/community.
* "Certified Since" now shown on profile pages.
* Update FAQ page for Forums feature.
noah added 1 commit 2024-08-24 04:21:51 +00:00
* Forums are disowned on user account deletion (their owner_id=0)
* A forum without an owner shows a notice at the bottom with a link to petition
  to adopt the forum. It goes to the Contact form with a special subject.
  * Note: there is no easy way to re-assign ownership yet other than a direct
    database query.
* Code cleanup
  * Alphabetize the DB.AutoMigrate tables.
  * Delete more things on user deletion: forum_memberships, admin_group_users
  * Vacuum worker to clean up orphaned polls after the threads are removed
noah added 1 commit 2024-08-24 05:23:20 +00:00
noah added 1 commit 2024-08-24 05:25:17 +00:00
* The bottoms of threads have moderator buttons now, to easily Pin or
  Unpin the thread (for Owners + Admins) or to Lock/Unlock the thread
  (all moderators).
noah force-pushed user-forums from a830bcf36f to 81ab9d29b0 2024-08-24 05:55:57 +00:00 Compare
noah force-pushed user-forums from 81ab9d29b0 to 81719218e2 2024-08-24 05:56:56 +00:00 Compare
noah added 1 commit 2024-08-24 06:09:41 +00:00
noah added 1 commit 2024-08-24 06:34:19 +00:00
noah added 1 commit 2024-08-25 02:09:13 +00:00
* Don't show the loading indicator when intercepted href="#" links have
  been clicked (e.g. like buttons, settings tabs)
noah added 1 commit 2024-08-26 03:05:33 +00:00
noah added 1 commit 2024-08-26 03:43:29 +00:00
noah added 1 commit 2024-08-27 03:48:55 +00:00
* The Explore tab can now sort forums by their:
  * Most recently updated thread
  * Topics, Posts or Users (counts)
* Show owner information in forum cards
* Passive pagination support for the "My List" on forum home page.
  * Only visible when there are >20 favorited Forums.
noah added 1 commit 2024-08-27 04:37:08 +00:00
* Show follower counts on forums
* Sort by popularity (follow count)
noah added 1 commit 2024-08-27 04:39:13 +00:00
noah added 1 commit 2024-08-29 01:42:58 +00:00
Make some adjustments to blocking behavior regarding the forums:

* Pre-existing bug: on a forum's home page (threads list), if a thread was
  created by a blocked user, the thread still appeared with the user's name and
  picture visible. Now: their picture and name will be "[unavailable]" but the
  thread title/message and link to the thread will remain. Note: in the thread
  view itself, posts by the blocked user will be missing as normal.
* Make some tweaks to allow forum moderators (and owners of user-owned forums)
  able to see messages from blocked users on their forum:
  * In threads: a blocked user's picture and name are "[unavailable]" but the
    content of their message is still shown, and can be deleted by moderators.

Misc fixes:

* Private photos: when viewing your granted/grantee lists, hide users whose
  accounts are inactive or who are blocked.
* CertifiedSince: in case a user was manually certified but their cert photo
  status is not correct, return their user CreatedAt time instead.
noah added 1 commit 2024-08-31 01:47:17 +00:00
This branch is already included in the target branch. There is nothing to merge.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin user-forums:user-forums
git checkout user-forums

Merge

Merge the changes and update on Gitea.
git checkout main
git merge --no-ff user-forums
git checkout main
git merge --ff-only user-forums
git checkout user-forums
git rebase main
git checkout main
git merge --no-ff user-forums
git checkout main
git merge --squash user-forums
git checkout main
git merge --ff-only user-forums
git checkout main
git merge user-forums
git push origin main
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: nonshy/website#47
No description provided.