diff --git a/orchestra/apps/saas/services/seafile.py b/orchestra/apps/saas/services/seafile.py new file mode 100644 index 00000000..951114a5 --- /dev/null +++ b/orchestra/apps/saas/services/seafile.py @@ -0,0 +1,31 @@ +from django import forms +from django.core.exceptions import ValidationError +from django.utils.translation import ugettext_lazy as _ +from rest_framework import serializers + +from .. import settings +from .options import SoftwareService, SoftwareServiceForm + + +# TODO monitor quota since out of sync? + +class SeaFileForm(SoftwareServiceForm): + email = forms.EmailField(label=_("Email"), widget=forms.TextInput(attrs={'size':'40'})) + quota = forms.IntegerField(label=_("Quota"), initial=settings.SAAS_SEAFILE_DEFAULT_QUOTA, + help_text=_("Disk quota in MB.")) + + +class SeaFileDataSerializer(serializers.Serializer): + email = serializers.EmailField(label=_("Email")) + quota = serializers.IntegerField(label=_("Quota"), default=settings.SAAS_SEAFILE_DEFAULT_QUOTA, + help_text=_("Disk quota in MB.")) + + +class SeaFileService(SoftwareService): + name = 'seafile' + verbose_name = "SeaFile" + form = SeaFileForm + serializer = SeaFileDataSerializer + icon = 'orchestra/icons/apps/seafile.png' + site_domain = settings.SAAS_SEAFILE_DOMAIN + change_readonly_fileds = ('email',) diff --git a/orchestra/static/orchestra/icons/apps/seafile.png b/orchestra/static/orchestra/icons/apps/seafile.png new file mode 100644 index 00000000..cbcd3eff Binary files /dev/null and b/orchestra/static/orchestra/icons/apps/seafile.png differ diff --git a/orchestra/static/orchestra/icons/apps/seafile.svg b/orchestra/static/orchestra/icons/apps/seafile.svg new file mode 100644 index 00000000..428b65d8 --- /dev/null +++ b/orchestra/static/orchestra/icons/apps/seafile.svg @@ -0,0 +1,68 @@ + + + + + + + + + + image/svg+xml + + + + + + + + +