Пример #1
0
 def input(self, context, slot, data, name, value):
     maxlength = data.typedValue.getAttribute('maxlength')
     size = data.typedValue.getAttribute('size', maxlength or 20)
     if maxlength:            
         return slot[input(id=keyToXMLID(context.key), type="file", name=name,
                           _class='freeform-input-file', size=size, maxlength=maxlength)]            
     else:
         return slot[input(id=keyToXMLID(context.key), type="file", name=name,
                           _class='freeform-input-file', size=size)]
Пример #2
0
 def input(self, context, slot, data, name, value):
     maxlength = data.typedValue.getAttribute('maxlength')
     size = data.typedValue.getAttribute('size', maxlength or 20)
     if maxlength:            
         return [
             input(id=keyToXMLID(context.key), name=name, type="password", _class="freeform-input-password", size=size, maxlength=maxlength),
             " Again ",
             input(name="%s____2" % name, type="password", _class="freeform-input-password", size=size, maxlength=maxlength),
             ]
     else:
         return [
             input(id=keyToXMLID(context.key), name=name, type="password", _class="freeform-input-password",size=size),
             " Again ",
             input(name="%s____2" % name, type="password", _class="freeform-input-password",size=size),
             ]
Пример #3
0
 def input(self, context, slot, data, name, value):
     if data.typedValue.getAttribute('hidden'):
         T="hidden"
     else:
         T="text"
     maxlength = data.typedValue.getAttribute('maxlength')
     size = data.typedValue.getAttribute('size', maxlength or 20)
     if maxlength:            
         size = min(size, maxlength)
         return slot[
             input(id=keyToXMLID(context.key), type=T, name=name, value=value,
                   _class='freeform-input-%s' % T, size=size, maxlength=maxlength)]
     else:
         return slot[
             input(id=keyToXMLID(context.key), type=T, name=name, value=value,
                   _class='freeform-input-%s' % T,size=size)]