mirror of
https://gitlab.com/brutaldon/brutaldon.git
synced 2025-01-03 14:56:25 -05:00
Add javascript granular settings to forms, templates, settings view
This commit is contained in:
parent
0f844c5919
commit
60748e5c4b
@ -24,7 +24,8 @@ class OAuthLoginForm(forms.Form):
|
||||
class PreferencesForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Preference
|
||||
fields = ['theme', 'filter_replies', 'filter_boosts', 'timezone']
|
||||
fields = ['theme', 'filter_replies', 'filter_boosts', 'timezone',
|
||||
'no_javascript', 'notifications', 'click_to_load']
|
||||
|
||||
class PostForm(forms.Form):
|
||||
"""def status_post(self, status, in_reply_to_id=None, media_ids=None,
|
||||
|
@ -39,6 +39,28 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label checkbox" for="no_javascript">
|
||||
{% render_field form.no_javascript class+="checkbox" %}
|
||||
{{ form.no_javascript.label }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label checkbox" for="notifications">
|
||||
{% render_field form.notifications class+="checkbox" %}
|
||||
{{ form.notifications.label }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label checkbox" for="click_to_load">
|
||||
{% render_field form.click_to_load class+="checkbox" %}
|
||||
{{ form.click_to_load.label }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<input type="submit" name="submit"
|
||||
value="Save" class="button is-primary" >
|
||||
|
@ -397,6 +397,9 @@ def settings(request):
|
||||
account.preferences.filter_replies = form.cleaned_data['filter_replies']
|
||||
account.preferences.filter_boosts = form.cleaned_data['filter_boosts']
|
||||
account.preferences.timezone = form.cleaned_data['timezone']
|
||||
account.preferences.no_javascript = form.cleaned_data['no_javascript']
|
||||
account.preferences.notifications = form.cleaned_data['notifications']
|
||||
account.preferences.click_to_load = form.cleaned_data['click_to_load']
|
||||
request.session['timezone'] = account.preferences.timezone
|
||||
account.preferences.save()
|
||||
account.save()
|
||||
|
Loading…
Reference in New Issue
Block a user