added coffee folder (dirty)
This commit is contained in:
parent
541c42b4fa
commit
6d9a5e3d9d
2 changed files with 34 additions and 0 deletions
3
js/wn-coffee/app.coffee
Normal file
3
js/wn-coffee/app.coffee
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Entry level app
|
||||
|
||||
wn.app = {}
|
||||
31
js/wn-coffee/widgets/form/form.coffee
Normal file
31
js/wn-coffee/widgets/form/form.coffee
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
class wn.widgets.Form
|
||||
constructor: (@modeltype) ->
|
||||
@view = wn.app.models['DocType'][modeltype].__view
|
||||
@sections = []
|
||||
|
||||
render: (@parent) ->
|
||||
# wrapper
|
||||
@wrapper = $a @parent 'div' 'form_wrapper'
|
||||
|
||||
# render sections
|
||||
for s in @view.sections
|
||||
@sections.push new wn.widgets.FormSection @wrapper, section
|
||||
|
||||
class wn.widgets.FormSection
|
||||
constructor: (@parent, @section) ->
|
||||
@columns = []
|
||||
@fields = []
|
||||
@render()
|
||||
|
||||
render: ->
|
||||
@wrapper = $a @parent 'div'
|
||||
for f in section.fields
|
||||
@render_field f, section
|
||||
|
||||
render_section: (section) ->
|
||||
# render fields
|
||||
|
||||
|
||||
render_field: (field, section) ->
|
||||
# call the field factory
|
||||
make_field field,
|
||||
Loading…
Add table
Reference in a new issue