def formstyle_foundation(form, fields, *args, **kwargs):
 def render_row(row_id, label, widget, comment, hidden=False):
  if hasattr(widget, 'element'):
   submit = widget.element('input', _type='submit')
   if submit:
    submit.add_class('small primary button')
  _class = ('form-row row hide' if hidden else 'form-row row')
  hints = DIV(render_tooltip(label, comment), _class='inline-tooltip')
  controls = DIV(label, DIV(widget, hints, _class='controls'), _class='small-12 columns')
  return DIV(controls, _class=_class, _id=row_id)
 if args:
  row_id = form
  label = fields
  (widget, comment) = args
  hidden = kwargs.get('hidden', False)
  return render_row(row_id, label, widget, comment, hidden)
 else:
  parent = TAG['']()
  for (row_id, label, widget, comment) in fields:
   parent.append(render_row(row_id, label, widget, comment))
  return parent

def formstyle_foundation ( form , fields , * args , ** kwargs ) : def render_row ( row_id , label , widget , comment , hidden = False ) : if hasattr ( widget , 'element' ) : submit = widget . element ( 'input' , _type = 'submit' ) if submit : submit . add_class ( 'small primary button' ) _class = ( 'form-row row hide' if hidden else 'form-row row' ) hints = DIV ( render_tooltip ( label , comment ) , _class = 'inline-tooltip' ) controls = DIV ( label , DIV ( widget , hints , _class = 'controls' ) , _class = 'small-12 columns' ) return DIV ( controls , _class = _class , _id = row_id ) if args : row_id = form label = fields ( widget , comment ) = args hidden = kwargs . get ( 'hidden' , False ) return render_row ( row_id , label , widget , comment , hidden ) else : parent = TAG [ '' ] ( ) for ( row_id , label , widget , comment ) in fields : parent . append ( render_row ( row_id , label , widget , comment ) ) return parent
formstyle for foundation 5 themes: URL - labels above the inputs .