Browse Source

added coffee folder (dirty)

version-14
Rushabh Mehta 14 years ago
parent
commit
6d9a5e3d9d
2 changed files with 34 additions and 0 deletions
  1. +3
    -0
      js/wn-coffee/app.coffee
  2. +31
    -0
      js/wn-coffee/widgets/form/form.coffee

+ 3
- 0
js/wn-coffee/app.coffee View File

@@ -0,0 +1,3 @@
# Entry level app

wn.app = {}

+ 31
- 0
js/wn-coffee/widgets/form/form.coffee View 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…
Cancel
Save