2011-04-15 19:28:37 +02:00
|
|
|
from django import forms
|
|
|
|
|
2012-08-08 10:46:36 +02:00
|
|
|
from djeuscan.models import Version, ProblemReport
|
2012-07-09 14:29:42 +02:00
|
|
|
|
2012-04-28 18:16:05 +02:00
|
|
|
|
2011-04-15 19:28:37 +02:00
|
|
|
class WorldForm(forms.Form):
|
2011-04-16 11:44:57 +02:00
|
|
|
world = forms.FileField()
|
|
|
|
|
2012-04-28 18:16:05 +02:00
|
|
|
|
2011-04-16 11:44:57 +02:00
|
|
|
class PackagesForm(forms.Form):
|
|
|
|
packages = forms.CharField(widget=forms.Textarea)
|
2012-07-09 14:29:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ProblemReportForm(forms.ModelForm):
|
|
|
|
version = forms.ModelChoiceField(queryset=Version.objects.all(),
|
|
|
|
empty_label="all", required=False)
|
|
|
|
message = forms.CharField(
|
|
|
|
widget=forms.Textarea(attrs={'cols': 80, 'rows': 15})
|
|
|
|
)
|
|
|
|
|
|
|
|
def __init__(self, package, *args, **kwargs):
|
|
|
|
super(ProblemReportForm, self).__init__(*args, **kwargs)
|
|
|
|
self.fields["version"].queryset = Version.objects.filter(
|
|
|
|
package=package
|
|
|
|
)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = ProblemReport
|
|
|
|
fields = ('version', 'subject', 'message')
|
2012-08-08 10:46:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
class PreferencesForm(forms.Form):
|
|
|
|
first_name = forms.CharField(max_length=30, required=False)
|
|
|
|
last_name = forms.CharField(max_length=30, required=False)
|
|
|
|
email = forms.EmailField()
|
2012-08-08 14:33:37 +02:00
|
|
|
|
2012-08-11 13:31:57 +02:00
|
|
|
feed_upstream_info = forms.BooleanField(required=False,
|
|
|
|
label="Upstream info")
|
|
|
|
feed_portage_info = forms.BooleanField(required=False,
|
|
|
|
label="Portage info")
|
|
|
|
feed_show_adds = forms.BooleanField(required=False,
|
|
|
|
label="Show version bumps")
|
|
|
|
feed_show_removals = forms.BooleanField(required=False,
|
|
|
|
label="Show version removals")
|
|
|
|
feed_ignore_pre = forms.BooleanField(required=False,
|
|
|
|
label="Ignore unstable releases")
|
|
|
|
feed_ignore_pre_if_stable = forms.BooleanField(
|
|
|
|
required=False,
|
|
|
|
label="Ignore unstable releases if current version is stable"
|
|
|
|
)
|
|
|
|
|
|
|
|
email_activated = forms.BooleanField(
|
|
|
|
required=False, label="Receive euscan emails"
|
|
|
|
)
|
|
|
|
email_ignore_pre = forms.BooleanField(
|
|
|
|
required=False, label="Ignore unstable releases"
|
|
|
|
)
|
|
|
|
email_ignore_pre_if_stable = forms.BooleanField(
|
|
|
|
required=False,
|
|
|
|
label="Ignore unstable releases if current version is stable"
|
|
|
|
)
|