diff --git a/brutaldon/forms.py b/brutaldon/forms.py index 3951c5d..618171f 100644 --- a/brutaldon/forms.py +++ b/brutaldon/forms.py @@ -25,7 +25,7 @@ class PreferencesForm(forms.ModelForm): class Meta: model = Preference fields = ['theme', 'filter_replies', 'filter_boosts', 'timezone', - 'no_javascript', 'notifications', 'click_to_load', 'lightbox'] + 'no_javascript', 'notifications', 'click_to_load', 'lightbox', 'poll_frequency'] class PostForm(forms.Form): """def status_post(self, status, in_reply_to_id=None, media_ids=None, diff --git a/brutaldon/migrations/0017_preference_poll_frequency.py b/brutaldon/migrations/0017_preference_poll_frequency.py new file mode 100644 index 0000000..dac1672 --- /dev/null +++ b/brutaldon/migrations/0017_preference_poll_frequency.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1.2 on 2018-10-18 19:52 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('brutaldon', '0016_auto_20181009_1805'), + ] + + operations = [ + migrations.AddField( + model_name='preference', + name='poll_frequency', + field=models.IntegerField(default=300, help_text='Number of seconds to wait between checking notifications. Default: 300'), + ), + ] diff --git a/brutaldon/models.py b/brutaldon/models.py index bdce33f..9e4e562 100644 --- a/brutaldon/models.py +++ b/brutaldon/models.py @@ -38,6 +38,8 @@ class Preference(models.Model): help_text="""Click to load more toots in the same page, rather than using pagination.""") lightbox = models.BooleanField(default=False, help_text="""Use a JavaScript lightbox to display media.""") + poll_frequency = models.IntegerField(default=300, + help_text="""Number of seconds to wait between checking notifications. Default: 300""") class Account(models.Model): username = models.EmailField(unique=True) diff --git a/brutaldon/static/css/brutaldon-dark.css b/brutaldon/static/css/brutaldon-dark.css index c72598b..48c97ff 100644 --- a/brutaldon/static/css/brutaldon-dark.css +++ b/brutaldon/static/css/brutaldon-dark.css @@ -208,3 +208,8 @@ emoji-link max-width: 30em; display: inline-block; } + +input#id_poll_frequency +{ + max-width: 10em; +} diff --git a/brutaldon/static/css/brutaldon.css b/brutaldon/static/css/brutaldon.css index 5ee102a..466c35d 100644 --- a/brutaldon/static/css/brutaldon.css +++ b/brutaldon/static/css/brutaldon.css @@ -179,3 +179,7 @@ emoji-link max-width: 30em; display: inline-block; } +input#id_poll_frequency +{ + max-width: 10em; +} diff --git a/brutaldon/templates/base.html b/brutaldon/templates/base.html index dabde7f..de6777f 100644 --- a/brutaldon/templates/base.html +++ b/brutaldon/templates/base.html @@ -82,7 +82,7 @@ {% if preferences.notifications and not preferences.theme.is_brutalist %} +
+ +
+ {% render_field form.poll_frequency class+="input" %} +
+

+ {{ form.poll_frequency.help_text }} +

+