first phase of the project management dashboard

This commit is contained in:
Joren de Graaf
2026-10-13 15:22:12 +02:00
parent 16ab9a3f8d
commit 3559b367e6
27 changed files with 822 additions and 8 deletions
+38
View File
@@ -0,0 +1,38 @@
from django import forms
from .models import Card, Column, Profile, Project
class ProjectForm(forms.ModelForm):
class Meta:
model = Project
fields = ['name', 'description', 'git_repository_url']
def clean_git_repository_url(self):
value = self.cleaned_data['git_repository_url']
if value and not value.startswith('https://'):
raise forms.ValidationError('Use an HTTPS repository URL.')
return value
class CardForm(forms.ModelForm):
expected_revision = forms.IntegerField(widget=forms.HiddenInput, required=False)
class Meta:
model = Card
fields = ['title', 'description_markdown', 'priority', 'card_type', 'due_date', 'is_blocked', 'blocked_reason']
widgets = {'description_markdown': forms.Textarea(attrs={'rows': 16}), 'due_date': forms.DateInput(attrs={'type': 'date'})}
class ColumnForm(forms.ModelForm):
class Meta:
model = Column
fields = ['name', 'color', 'is_done']
widgets = {'color': forms.TextInput(attrs={'type': 'color'})}
class ProfileForm(forms.ModelForm):
email = forms.EmailField(required=False)
class Meta:
model = Profile
fields = ['display_name', 'avatar_url', 'timezone', 'language', 'theme']