Naprawienie przycisków.
[redakcja.git] / apps / api / forms.py
index 7c6f2c2..d55e629 100644 (file)
@@ -7,15 +7,23 @@ __doc__ = "Micro-forms for the API."
 
 from django import forms
 
-class DocumentEntryRequest(forms.Form):
-    revision = forms.RegexField(regex='latest|[0-9a-f]{40}')
+
+class MergeRequestForm(forms.Form):
+    # should the target document revision be updated or shared
+    type = forms.ChoiceField(choices=(('update', 'Update'), ('share', 'Share')) )
+
+    # which revision to update/share
+    target_revision = forms.RegexField('[0-9a-f]{40}')
+
+    # any additional comments that user wants to add to the change
+    message = forms.CharField(required=False)
 
 class DocumentUploadForm(forms.Form):
     ocr_file = forms.FileField(label='Source OCR file', required=False)
     ocr_data = forms.CharField(widget=forms.HiddenInput(), required=False)
     
     bookname = forms.RegexField(regex=r'[0-9\.\w_-]+',  \
-        label='Publication name', help_text='Example: slowacki-beniowski')
+        label='Publication name', help_text='Example: słowacki__beniowski__pieśń_1')
     
     generate_dc = forms.BooleanField(required=False, \
         initial=True, label=u"Generate DublinCore template")