1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-06-30 08:53:49 +00:00
seahub/share/forms.py

24 lines
707 B
Python
Raw Normal View History

2012-02-11 03:12:54 +00:00
from django import forms
2012-11-06 03:12:49 +00:00
from django.utils.translation import ugettext_lazy as _
2012-02-11 03:12:54 +00:00
2012-06-12 02:13:14 +00:00
class RepoShareForm(forms.Form):
2012-02-11 03:12:54 +00:00
"""
2012-06-12 02:13:14 +00:00
Form for sharing repo to user or group.
2012-02-11 03:12:54 +00:00
"""
2012-06-12 02:13:14 +00:00
email_or_group = forms.CharField(max_length=512)
2012-02-11 03:12:54 +00:00
repo_id = forms.CharField(max_length=36)
permission = forms.ChoiceField(choices=(('rw', 'read-write'), ('r', 'read-only')))
2012-11-06 03:12:49 +00:00
class FileLinkShareForm(forms.Form):
"""
Form for sharing file shared link to emails.
"""
email = forms.CharField(max_length=512, error_messages={
'required': _("Email is required"),
'max_length': _("Email is not longer than 512 characters"),
})
file_shared_link = forms.CharField()