2015-03-23 15:36:51 +00:00
|
|
|
from django import forms
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
from rest_framework import serializers
|
|
|
|
|
|
|
|
from .options import SoftwareService, SoftwareServiceForm
|
|
|
|
|
|
|
|
|
|
|
|
class WordPressForm(SoftwareServiceForm):
|
|
|
|
email = forms.EmailField(label=_("Email"), widget=forms.TextInput(attrs={'size':'40'}))
|
2015-04-07 15:14:49 +00:00
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super(WordPressForm, self).__init__(*args, **kwargs)
|
|
|
|
self.fields['name'].label = _("Site name")
|
2015-03-23 15:36:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
class WordPressDataSerializer(serializers.Serializer):
|
|
|
|
email = serializers.EmailField(label=_("Email"))
|
|
|
|
|
|
|
|
|
|
|
|
class WordPressService(SoftwareService):
|
|
|
|
verbose_name = "WordPress"
|
|
|
|
form = WordPressForm
|
|
|
|
serializer = WordPressDataSerializer
|
|
|
|
icon = 'orchestra/icons/apps/WordPress.png'
|
2015-04-07 15:14:49 +00:00
|
|
|
site_base_domain = 'blogs.orchestra.lan'
|
2015-03-23 15:36:51 +00:00
|
|
|
change_readonly_fileds = ('email',)
|