<s> from django import forms <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from ckeditor . widgets import CKEditorWidget <EOL> from zorna . site . models import SiteOptions <EOL> class PageEditTemplateForm ( forms . Form ) : <EOL> body = forms . CharField ( widget = forms . Textarea ( <EOL> attrs = { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT:100> , } ) ) <EOL> class PageEditFileForm ( forms . Form ) : <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> extra = kwargs . pop ( '<STR_LIT>' ) <EOL> request = kwargs . pop ( '<STR_LIT>' ) <EOL> super ( PageEditFileForm , self ) . __init__ ( * args , ** kwargs ) <EOL> ckeditor_config_name = SiteOptions . objects . get_ckeditor_config ( request ) <EOL> for b in extra : <EOL> self . fields [ '<STR_LIT:%s>' % b [ '<STR_LIT>' ] ] = forms . CharField ( <EOL> widget = CKEditorWidget ( config_name = ckeditor_config_name ) , initial = b [ '<STR_LIT:content>' ] ) <EOL> class PageEditFileContextForm ( forms . Form ) : <EOL> title = forms . CharField ( _ ( <EOL> u'<STR_LIT:title>' ) , widget = forms . TextInput ( attrs = { '<STR_LIT:size>' : '<STR_LIT>' } ) ) <EOL> keywords = forms . CharField ( _ ( <EOL> u'<STR_LIT>' ) , widget = forms . TextInput ( attrs = { '<STR_LIT:size>' : '<STR_LIT>' } ) ) <EOL> description = forms . CharField ( _ ( u'<STR_LIT:description>' ) , widget = forms . Textarea ( <EOL> attrs = { '<STR_LIT>' : '<STR_LIT:5>' , '<STR_LIT>' : '<STR_LIT>' } ) , required = False ) <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> extra = kwargs . pop ( '<STR_LIT>' ) <EOL> super ( PageEditFileContextForm , self ) . __init__ ( * args , ** kwargs ) <EOL> for f , c in extra . items ( ) : <EOL> self . fields [ '<STR_LIT:%s>' % f ] = forms . CharField ( initial = c ) </s>
