2018-04-24 00:16:22 +02:00
|
|
|
from django import forms
|
|
|
|
|
2018-05-22 15:41:11 +02:00
|
|
|
PRIVACY_CHOICES = (('public', 'Public'),
|
2018-04-27 20:12:29 +02:00
|
|
|
('unlisted', 'Unlisted'),
|
|
|
|
('private', 'Private'),
|
|
|
|
('direct', 'Direct'))
|
|
|
|
|
|
|
|
|
2018-04-24 00:16:22 +02:00
|
|
|
class LoginForm(forms.Form):
|
|
|
|
instance = forms.CharField(label="Instance",
|
|
|
|
max_length=256)
|
2018-04-24 20:49:43 +02:00
|
|
|
username = forms.CharField(label="Email",
|
2018-04-24 00:16:22 +02:00
|
|
|
max_length=256)
|
|
|
|
password = forms.CharField(widget=forms.PasswordInput())
|
|
|
|
|
2018-05-14 21:35:10 +02:00
|
|
|
class OAuthLoginForm(forms.Form):
|
|
|
|
instance = forms.CharField(label="Instance",
|
|
|
|
max_length=256)
|
|
|
|
|
2018-04-25 22:45:46 +02:00
|
|
|
class SettingsForm(forms.Form):
|
|
|
|
fullbrutalism = forms.BooleanField(label="Use FULLBRUTALISM mode?",
|
|
|
|
required=False,
|
|
|
|
help_text=
|
|
|
|
"""FULLBRUTALISM mode strips away most of the niceties of modern web design when
|
|
|
|
brutaldon is viewed in a graphical browser. It has no effect in text-only browsers.""")
|
|
|
|
|
2018-04-27 20:12:29 +02:00
|
|
|
|
|
|
|
class PostForm(forms.Form):
|
|
|
|
"""def status_post(self, status, in_reply_to_id=None, media_ids=None,
|
|
|
|
sensitive=False, visibility=None, spoiler_text=None):"""
|
|
|
|
status = forms.CharField(label="Toot", max_length=500, widget=forms.Textarea)
|
2018-05-22 14:57:45 +02:00
|
|
|
visibility = forms.ChoiceField(label="Toot visibility", choices=PRIVACY_CHOICES,
|
|
|
|
required=False)
|
2018-04-30 14:58:10 +02:00
|
|
|
spoiler_text = forms.CharField(label="CW or Subject", max_length=500,
|
|
|
|
required=False)
|
|
|
|
media_file_1 = forms.FileField(label = "Media attachment 1",
|
|
|
|
required=False)
|
|
|
|
media_text_1 = forms.CharField(label="Describe media attachment 1.", max_length=500,
|
|
|
|
required=False)
|
|
|
|
media_file_2 = forms.FileField(label = "Media attachment 2",
|
|
|
|
required=False)
|
|
|
|
media_text_2 = forms.CharField(label="Describe media attachment 2.", max_length=500,
|
|
|
|
required=False)
|
|
|
|
media_file_3 = forms.FileField(label = "Media attachment 3",
|
|
|
|
required=False)
|
|
|
|
media_text_3 = forms.CharField(label="Describe media attachment 3.", max_length=500,
|
|
|
|
required=False)
|
|
|
|
media_file_4 = forms.FileField(label = "Media attachment 4",
|
|
|
|
required=False)
|
|
|
|
media_text_4 = forms.CharField(label="Describe media attachment 4.", max_length=500,
|
|
|
|
required=False)
|
|
|
|
media_sensitive = forms.BooleanField(label="Sensitive media?", required=False)
|
2018-04-27 20:12:29 +02:00
|
|
|
|