diff --git a/archivist/apps/user/forms.py b/archivist/apps/user/forms.py index fd748d5..0f67957 100644 --- a/archivist/apps/user/forms.py +++ b/archivist/apps/user/forms.py @@ -5,7 +5,7 @@ from .models import UserProfile class UserProfileForm(forms.ModelForm): class Meta: model = UserProfile - fields = ['show_mature', "items_per_page"] + fields = ['show_mature', "items_per_page", "post_seen_delay"] class UserForm(forms.ModelForm): class Meta: diff --git a/archivist/apps/user/models.py b/archivist/apps/user/models.py index 46b4566..5b9154b 100644 --- a/archivist/apps/user/models.py +++ b/archivist/apps/user/models.py @@ -19,9 +19,17 @@ class UserProfile(models.Model): (72, "72"), ] + POST_SEEN_DELAY = [ + (15, "15"), + (30, "30"), + (60, "60"), + (90, "90"), + ] + user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True, unique=True) show_mature = models.CharField(max_length=2, choices=MATURE, default=MATURE[0][0]) items_per_page = models.IntegerField(choices=ITEMS_PER_PAGE, default=ITEMS_PER_PAGE[0][0]) + post_seen_delay = models.IntegerField(choices=POST_SEEN_DELAY, default=POST_SEEN_DELAY[1][1], help_text="Delay in seconds before marking a post as seen") class Meta: verbose_name = _("User Profile")