Archived
feat: implement per-member reading progress tracking for shared books (#30)
Backend (apps/groups):
- ReadingGroup model: named groups linked to EBooks with creator tracking
- GroupMembership model: user-group association with member/admin roles
- MemberProgress model: per-member progress with section tracking,
percentage, time_spent, privacy toggles, and device-position preservation
- ReadingGroupViewSet: CRUD, join/leave, members list, progress endpoints
- GET /api/groups/{id}/members/progress/ — all members' progress
(public: section label only; own: full detail; private: stubbed)
- PATCH /api/groups/{id}/progress/ — update own progress with auto-
percentage calculation from section boundaries
- GET /api/groups/{id}/progress/summary/ — admin dashboard with
averages, started/finished counts, and per-member details
- Permissions: IsGroupMember, IsGroupAdmin
Frontend:
- Groups list page (/groups) with create modal and book selector
- Group detail page (/groups/:id) with progress and admin summary tabs
- Progress bar visualization per member with privacy-aware display
- Admin stat cards (total members, started, finished, avg progress, avg time)
- Navigation link from Library header
Shared:
- ReadingGroupSummary and MemberProgressPublic types
- API endpoint constants for groups routes
Closes #30
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from apps.groups.models import GroupMembership, MemberProgress, ReadingGroup
|
||||
|
||||
|
||||
@admin.register(ReadingGroup)
|
||||
class ReadingGroupAdmin(admin.ModelAdmin):
|
||||
list_display = ["name", "ebook", "created_by", "created_at"]
|
||||
search_fields = ["name", "ebook__title", "created_by__email"]
|
||||
|
||||
|
||||
@admin.register(GroupMembership)
|
||||
class GroupMembershipAdmin(admin.ModelAdmin):
|
||||
list_display = ["group", "user", "role", "joined_at"]
|
||||
list_filter = ["role"]
|
||||
search_fields = ["user__email", "group__name"]
|
||||
|
||||
|
||||
@admin.register(MemberProgress)
|
||||
class MemberProgressAdmin(admin.ModelAdmin):
|
||||
list_display = ["user", "group", "current_section", "percentage", "time_spent_seconds", "is_public", "updated_at"]
|
||||
list_filter = ["is_public"]
|
||||
search_fields = ["user__email", "group__name"]
|
||||
Reference in New Issue
Block a user