[%# Template for the App Body section of TentMaker home page. Expects this top level key: block - an array element from app_blocks array given to tenter.tt Expects this to be in view.data statements - hash describing statements built by Bigtop::Parser::get_keyword_docs sequence, table, controller, or literals. expanded_divs - hash keyed by AST ident storing true if its div is open %]
[% IF block.type == 'sequence' %] [% type_label = 'Sequence' %]
[% type_label %] ( [%- INCLUDE delete_link.ttc name = "app_body_delete::$block.ident" %] )
Name:
[% ELSIF block.type == 'schema' %] [% type_label = 'Schema' %]
[% type_label %] ( [%- INCLUDE delete_link.ttc name = "app_body_delete::$block.ident" %] )
Name:
[% ELSIF block.type == 'table' %] [% type_label = 'Table' %]
[% type_label %] ( edit or hide | [%- INCLUDE delete_link.ttc name = "app_body_delete::$block.ident" %] )
Name:
[% WRAPPER show_or_hide.ttc clickable_id = "table_heading_$block.ident" element_under_control = "hideable_$block.ident" label = 'Close Edit' heading_level = 'none' expanded = view.data.expanded_divs.${block.ident} || 0 %] [% INCLUDE table_block %] [% END %]
[% ELSIF block.type == 'controller' %] [% IF block.controller_type == 'base_controller' %] [% type_label = 'Base Controller' %]
[% type_label %] ( edit or hide | [%- INCLUDE delete_link.ttc name = "app_body_delete::$block.ident" %] ) [% WRAPPER show_or_hide.ttc clickable_id = "controller_heading_$block.ident" element_under_control = "hideable_$block.ident" label = 'Close Edit' heading_level = 'none' %] [% INCLUDE controller_block %] [% END %]
[% ELSE %] [% type_label = 'Controller' %]
[% type_label %] ( edit or hide | [%- INCLUDE delete_link.ttc name = "app_body_delete::$block.ident" %] )
Name:
[% type_label %] Type:
[% WRAPPER show_or_hide.ttc clickable_id = "controller_heading_$block.ident" element_under_control = "hideable_$block.ident" label = 'Close Edit' heading_level = 'none' expanded = view.data.expanded_divs.${block.ident} || 0 %] [% INCLUDE controller_block %] [% END %]
[% END %][%# controller sub type base_controller or not %] [% ELSIF block.type == 'literal' %] [% type_label = 'Literal' %]
[% type_label %] ( edit or hide | [%- INCLUDE delete_link.ttc name = "app_body_delete::$block.ident" %] )
[% type_label %] Type:
String:
[% ELSIF block.type == 'join_table' %] [% type_label = 'Join Table' %]
[% type_label %] ( edit or hide | [%- INCLUDE delete_link.ttc name = "app_body_delete::$block.ident" %] )
Name:
[% WRAPPER show_or_hide.ttc clickable_id = "join_table_heading_$block.ident" element_under_control = "hideable_$block.ident" label = 'Close Edit' heading_level = 'none' expanded = view.data.expanded_divs.${block.ident} || 0 %] [% INCLUDE join_table_block %] [% END %]
[% ELSIF block.type == 'config' %] [% type_label = 'Config Block' %]
[% type_label %] ( edit or hide [% UNLESS block.name == 'base' %] | [%- INCLUDE delete_link.ttc name = "app_body_delete::$block.ident" %] [% END %] )
Name: [% IF block.name == 'base' %] base [% ELSE %] [% END %]
[% WRAPPER show_or_hide.ttc clickable_id = "config_heading_$block.ident" element_under_control = "hideable_$block.ident" label = 'Close Edit' heading_level = 'none' expanded = view.data.expanded_divs.${block.ident} || 0 %] [% INCLUDE config_block %] [% END %]
[% ELSE %][%# must be new %] I don't know what to do:
      [% USE dumper %][% dumper.dump( block ) %]
      
[% END %]
[% BLOCK table_block %] [% INCLUDE table_statement_table statements = block.body.statements %]
[% INCLUDE quick_edit.ttc fields = block.body.fields table_ident = block.ident %]
Create Field(s)
Name(s): Hint: separate names with spaces to add many fields at once.

Edit Field:
[% FOREACH item IN block.body.fields %] [% IF item.type == 'field' %] [% END %] [% END %]

Data Statements ( edit or hide ) [% WRAPPER show_or_hide.ttc element_under_control = "hideable_data_$block.ident" label = 'Close Edit' heading_level = 'none' %] [% INCLUDE data_div.ttc %] [% END %]
[% END %][%# end table_block %] [% BLOCK table_statement_table %] [% FOREACH table_statement IN view.data.statements.table.statements %] [% keyword = table_statement.keyword %] [% NEXT IF keyword == 'data' %] [% END %]
Keyword Value(s) Description
[% keyword %] [% values = statements.$keyword.get_unquoted_args single_value = values.0 %] [% INCLUDE input_boxes.ttc statement = table_statement keyword_prefix = "$block.ident::" name_prefix = "$block.ident::" id_prefix = "$block.ident::" method_group = 'table_statement' key = keyword %] [% table_statement.descr %]
[% END %][%# end of table_statement_table %] [% BLOCK controller_block %] [% INCLUDE controller_statement_table statements = block.body.statements %]
Create Method
Name: Method Type:

Create Config Block
Name:

[% FOREACH controller_block IN block.body.blocks %] [% IF controller_block.type == 'config' %] [% INCLUDE controller_config_block.ttc config_block = controller_block %] [% ELSE %][%# must be a method %] [% INCLUDE method_block.ttc item = controller_block %] [% END %]
[% END %] [% END %][%# end of controller_block %] [% BLOCK controller_statement_table %] [% ctype = block.controller_type %] [% FOREACH controller_statement IN view.data.statements.controller.statements %] [% keyword = controller_statement.keyword %] [% NEXT UNLESS controller_statement.controller_types.all OR controller_statement.controller_types.$ctype %] [% END %]
Keyword Value(s) Description
[% keyword %] [% values = statements.$keyword.get_unquoted_args single_value = values.0 %] [% INCLUDE input_boxes.ttc statement = controller_statement keyword_prefix = "$block.ident::" name_prefix = "$block.ident::" id_prefix = "$block.ident::" method_group = 'controller_statement' key = keyword %] [% controller_statement.descr %]
[% END %][%# end of controller_statement_table %] [% BLOCK join_table_block %] [% INCLUDE join_table_statement_table statements = block.body.statements %]
[% END %][%# end join_table_block %] [% BLOCK join_table_statement_table %] [% FOREACH jt_statement IN view.data.statements.join_table.statements %] [% keyword = jt_statement.keyword %] [% NEXT IF keyword == 'data' %] [% END %]
Keyword Value(s) Description
[% keyword %] [% values = statements.$keyword.get_unquoted_args single_value = values.0 %] [% INCLUDE input_boxes.ttc statement = jt_statement keyword_prefix = "$block.ident::" name_prefix = "$block.ident::" method_group = 'join_table_statement' key = keyword %] [% jt_statement.descr %]
[% END %][%# end of join_table_statement_table %] [% BLOCK config_block %]
[% FOREACH statement IN block.statements %] [% END %][%# end of existing config statement rows %] [%# add one row for the new statement button and keyword text input %]
Keyword Value Skip Accessor? Delete Buttons
[% statement.keyword %]
[% END %][%# end of config_block %]