56 lines
1.5 KiB
Python
56 lines
1.5 KiB
Python
from django import forms
|
|
|
|
from .models import Project
|
|
|
|
|
|
class ProjectForm(forms.Form):
|
|
title = forms.CharField(
|
|
max_length=128,
|
|
widget=forms.TextInput(attrs={'placeholder': 'Project title'}),
|
|
)
|
|
summary = forms.CharField(
|
|
max_length=255,
|
|
required=False,
|
|
widget=forms.TextInput(attrs={'placeholder': 'One-line summary shown on cards'}),
|
|
)
|
|
category = forms.ChoiceField(choices=Project.CATEGORY_CHOICES)
|
|
description = forms.CharField(
|
|
required=False,
|
|
widget=forms.Textarea(attrs={
|
|
'rows': 8,
|
|
'placeholder': 'Write the description in Markdown…',
|
|
}),
|
|
)
|
|
caption = forms.CharField(
|
|
max_length=128,
|
|
required=False,
|
|
widget=forms.TextInput(attrs={'placeholder': 'Optional caption for the gallery media'}),
|
|
)
|
|
tags = forms.CharField(
|
|
required=False,
|
|
widget=forms.HiddenInput(),
|
|
label='',
|
|
)
|
|
|
|
|
|
class VersionForm(forms.Form):
|
|
version_name = forms.CharField(
|
|
max_length=64,
|
|
label='Version',
|
|
widget=forms.TextInput(attrs={'placeholder': 'e.g. 1.0.0'}),
|
|
)
|
|
changelog = forms.CharField(
|
|
required=False,
|
|
widget=forms.Textarea(attrs={
|
|
'rows': 4,
|
|
'placeholder': 'What changed in this version? (Markdown)',
|
|
}),
|
|
)
|
|
|
|
|
|
class ContributorForm(forms.Form):
|
|
username = forms.CharField(
|
|
max_length=150,
|
|
widget=forms.TextInput(attrs={'placeholder': 'Start typing a username…', 'autocomplete': 'off'}),
|
|
)
|