Commit 0af871c7d6de2c1aa907def23a4fb563fc851cc4

Authored by totoro
1 parent 8ba22273

add colspan and rowspan attributes for editor and form table lines

hayamiki_lib @ 6a8c2f09f96
1 -Subproject commit b0635c56b0ff5113b85301a06aee7b71ce76bc22 1 +Subproject commit 6a8c2f09f96f7ac5e840c0ef4935a5641e83fc18
src/generation/edit_view_table_form.anubis
@@ -76,8 +76,29 @@ public define String @@ -76,8 +76,29 @@ public define String
76 failure then edit_entries(t, type_name, indent, so_far) 76 failure then edit_entries(t, type_name, indent, so_far)
77 success(result) then edit_entries(t, type_name, indent, [result . so_far]) 77 success(result) then edit_entries(t, type_name, indent, [result . so_far])
78 } 78 }
79 - }.  
80 - 79 + }
  80 +.
  81 +
  82 +define String
  83 + make_line_attribute
  84 + (
  85 + HK_Editor_Table_Line_Attribute attr
  86 + )=
  87 + if attr is
  88 + {
  89 + colspan(n) then "colspan("+n+")",
  90 + rowspan(n) then "rowspan("+n+")"
  91 + }
  92 +.
  93 +
  94 +define String
  95 + make_line_attributes
  96 + (
  97 + List(HK_Editor_Table_Line_Attribute) line_attrs
  98 + )=
  99 + join(", ", map((HK_Editor_Table_Line_Attribute attr) |-> make_line_attribute(attr), line_attrs))
  100 +.
  101 +
81 define String 102 define String
82 make_lines 103 make_lines
83 ( 104 (
@@ -89,7 +110,7 @@ define String @@ -89,7 +110,7 @@ define String
89 if is_empty(lines) then 110 if is_empty(lines) then
90 "" 111 ""
91 else 112 else
92 - "\n"+indent+ join(",\n"+indent, map((HK_Editor_Table_Line line) |-> "hk_form_table_line(["+ make_cells(line.cells, columns, table_name, indent+" ") +"\n"+indent+"])", lines)) 113 + "\n"+indent+ join(",\n"+indent, map((HK_Editor_Table_Line line) |-> "hk_form_table_line(["+make_line_attributes(line.line_attr)+"],\n"+indent+" ["+ make_cells(line.cells, columns, table_name, indent+" ") +"\n"+indent+"])", lines))
93 . 114 .
94 115
95 116
src/model.3.0.0.anubis
@@ -579,10 +579,10 @@ public define HK_Table role_table = @@ -579,10 +579,10 @@ public define HK_Table role_table =
579 [ edit_view_list_form("default", ["role_name", "description", "comments"]), 579 [ edit_view_list_form("default", ["role_name", "description", "comments"]),
580 form_table("table", 580 form_table("table",
581 table([ 581 table([
582 - line([label("role_name"), column("role_name")]),  
583 - line([empty, column("description")]),  
584 - line([label("comments"), column("comments")]),  
585 - line([label("date_created"),column("date_created"),label("last_modified"),column("last_modified")]) 582 + line([],[label("role_name"), column("role_name")]),
  583 + line([],[empty, column("description")]),
  584 + line([],[label("comments"), column("comments")]),
  585 + line([colspan(2)], [label("date_created"),column("date_created"),label("last_modified"),column("last_modified")])
586 ]) 586 ])
587 ) 587 )
588 ] 588 ]