Commit 1d49576d8028cf74a4c1bac480164b9146ac39bf
1 parent
d0268921
[~] change to be compatible with the new xlib 1.19.1 (future xlib 2)
Showing
4 changed files
with
174 additions
and
188 deletions
Show diff stats
view/view_apps_renderer.anubis
| ... | ... | @@ -17,7 +17,7 @@ read xlib/web/jQuery/ui-addon/datetimepicker.anubis |
| 17 | 17 | read xlib/web/widgets/button.anubis |
| 18 | 18 | |
| 19 | 19 | |
| 20 | -define List(HTML_Row(HTML_Off_Form)) | |
| 20 | +define List(HTML) | |
| 21 | 21 | generate_apps |
| 22 | 22 | ( |
| 23 | 23 | SQLite3DataBase db, |
| ... | ... | @@ -26,33 +26,28 @@ define List(HTML_Row(HTML_Off_Form)) |
| 26 | 26 | (String) -> String _T, |
| 27 | 27 | )= |
| 28 | 28 | map_append((HK_App app) |-> since app is hk_app(app_name, icon, help, tables), |
| 29 | - [ (HTML_Row(HTML_Off_Form))row([core_attrs([class("hk_app_title")])],cell([columns(6)],text(app_name)))]+ //APP name line | |
| 29 | + [ tr(class("hk_app_title"), td(colspan(6), text(app_name)))]+ //APP name line | |
| 30 | 30 | //here map for each table |
| 31 | 31 | map((HK_Table table) |-> since table is hk_table(_table_name, short_name, model, display), |
| 32 | 32 | //construct the real name of the table (app + table_name) |
| 33 | 33 | with table_name = if length(app_name) > 0 then app_name +"_"+_table_name else _table_name, |
| 34 | - (HTML_Row(HTML_Off_Form))row([core_attrs([class("hk_table_line")])], | |
| 35 | - [ cell(text(_table_name)), | |
| 36 | - cell( | |
| 37 | - sequence([ | |
| 38 | - partial(img_button(icn16_add, [event(onclick, jq_dialog_open(dialog_id(dialog_uid), "'table_name="+table_name+"'"))], "", [])), | |
| 39 | - actioner(link([core_attrs([event(onclick, jq_dialog_open(dialog_id(dialog_uid), "'table_name="+table_name+"'"))])],_T("ADD")), no_action, []) | |
| 40 | - ]) | |
| 41 | - ), | |
| 42 | - cell( | |
| 43 | - sequence([ | |
| 44 | - partial(img_button(icn16_view_list, hkc_list_view, [("table_name",table_name)])), | |
| 34 | + tr(class("hk_table_line"), | |
| 35 | + [ td(text(_table_name)), | |
| 36 | + td([ | |
| 37 | + img_button(icn16_add, [event(onclick, jq_dialog_open(dialog_id(dialog_uid), "'table_name="+table_name+"'"))], "", []), | |
| 38 | + actioner(link([event(onclick, jq_dialog_open(dialog_id(dialog_uid), "'table_name="+table_name+"'"))],_T("ADD")), no_action, []) | |
| 39 | + ]), | |
| 40 | + td([ | |
| 41 | + img_button(icn16_view_list, hkc_list_view, [("table_name",table_name)]), | |
| 45 | 42 | actioner(link(_T("LIST")), hkc_list_view, [("table_name",table_name)]) |
| 46 | - ]) | |
| 47 | - ), | |
| 48 | - cell( | |
| 49 | - sequence([ | |
| 50 | - partial(img_button("icons/16x16/table_import.png", hkc_import_dropzone, [("table_name",table_name)])), | |
| 43 | + ]), | |
| 44 | + td([ | |
| 45 | + img_button("icons/16x16/table_import.png", hkc_import_dropzone, [("table_name",table_name)]), | |
| 51 | 46 | actioner(link(_T("CSV_IMPORT")), hkc_import_dropzone, [("table_name",table_name)]) |
| 52 | - ]) | |
| 53 | - ), | |
| 54 | - cell(text(_T("RECORDS_COUNT")+" ")), | |
| 55 | - cell([right], text(get_count(db, table_name))) | |
| 47 | + ]), | |
| 48 | + td(text(_T("RECORDS_COUNT")+" ")), | |
| 49 | + //TODO replace old align right to more moderm way | |
| 50 | + td([/*right*/], text(get_count(db, table_name))) | |
| 56 | 51 | ]) |
| 57 | 52 | ,tables) |
| 58 | 53 | |
| ... | ... | @@ -60,9 +55,7 @@ define List(HTML_Row(HTML_Off_Form)) |
| 60 | 55 | ) |
| 61 | 56 | . |
| 62 | 57 | |
| 63 | - | |
| 64 | - | |
| 65 | -public define Maybe(HTML_Partial_Content) | |
| 58 | +public define Maybe(HTML) | |
| 66 | 59 | show_apps_content |
| 67 | 60 | ( |
| 68 | 61 | SQLite3DataBase db, |
| ... | ... | @@ -72,11 +65,11 @@ public define Maybe(HTML_Partial_Content) |
| 72 | 65 | String web_site_directory |
| 73 | 66 | ) = |
| 74 | 67 | with dialog_uid = "_"+generate_random_string(15)+"_cxm_dlg", |
| 75 | - success(partial_content([css(css_file("hayamiki/css/hayamiki.css")),]+ | |
| 68 | + success(head_tags([css(css_file("hayamiki/css/hayamiki.css")),]+ | |
| 76 | 69 | jq_dialog_init + jq_datetimepicker_init(lang), |
| 77 | - sequence([ | |
| 78 | - partial(jq_dialog_create(dialog_id(dialog_uid), ajax(controller_action("hk_c", "ajax_edit_table&dialog_id="+dialog_uid)))), /*&table_name="+rows.table_name*/ | |
| 70 | + [ | |
| 71 | + jq_dialog_create(dialog_id(dialog_uid), ajax(controller_action("hk_c", "ajax_edit_table&dialog_id="+dialog_uid))), /*&table_name="+rows.table_name*/ | |
| 79 | 72 | table([class("hk_table_apps")], generate_apps(db, hk_db.apps, dialog_uid, _T)) |
| 80 | - ]) | |
| 73 | + ] | |
| 81 | 74 | )) |
| 82 | 75 | . | ... | ... |
view/view_editor_renderer.anubis
| ... | ... | @@ -12,7 +12,7 @@ read hayamiki_lib/view/view_table_manager_types.anubis |
| 12 | 12 | read hayamiki_lib/view/view_table_manager.anubis |
| 13 | 13 | read hayamiki_lib/types/hayamiki.anubis |
| 14 | 14 | |
| 15 | - public define Maybe(HTML_Partial_Content) | |
| 15 | + public define Maybe(HTML) | |
| 16 | 16 | view_editor_content |
| 17 | 17 | ( |
| 18 | 18 | SQLite3DataBase db, | ... | ... |
view/view_rows_import.anubis
| ... | ... | @@ -51,14 +51,14 @@ public define List((List(CoreAttrs), WebArgValue, String)) |
| 51 | 51 | ([],wav("update"), _T("UPDATE")), |
| 52 | 52 | ]. |
| 53 | 53 | |
| 54 | -public define HTML_Partial_Content | |
| 54 | +public define HTML | |
| 55 | 55 | import_zone |
| 56 | 56 | ( |
| 57 | 57 | String table_name, |
| 58 | 58 | (String) -> String _T |
| 59 | 59 | )= |
| 60 | 60 | html_wave_box(_T("CONTROL_PANEL"), |
| 61 | - partial_content( | |
| 61 | + head_tags( | |
| 62 | 62 | [ js(js_file("xlib/js/dropzone.js")), |
| 63 | 63 | js_inline(jquery_ready("Dropzone.options.myAwesomeDropzone = { |
| 64 | 64 | maxFiles: 1, |
| ... | ... | @@ -70,34 +70,34 @@ public define HTML_Partial_Content |
| 70 | 70 | |
| 71 | 71 | sequence([ |
| 72 | 72 | text([], _T("CSV_IMPORT_FOR")+" "+table_name), |
| 73 | - form("my-awesome-dropzone",[class("dropzone")], hkc_import_file, | |
| 73 | + form("my-awesome-dropzone", [class("dropzone")], hkc_import_file, | |
| 74 | 74 | [("format","csv"), ("table_name",table_name)], |
| 75 | 75 | empty), |
| 76 | - partial(jquery_button(jquery_img_button(icn16_cross, _T("CANCEL"), "", jQuery_actioner(same, jqlink(hkc_cancel)), left))), | |
| 77 | - partial(jquery_button(jquery_img_button(icn16_check, _T("IMPORT"), "", jQuery_actioner(same, jqlink(hkc_import_choose_col, [("format","csv"), ("table_name",table_name)])), left))) | |
| 76 | + jquery_button(jquery_img_button(icn16_cross, _T("CANCEL"), "", jQuery_actioner(same, jqlink(hkc_cancel)), left)), | |
| 77 | + jquery_button(jquery_img_button(icn16_check, _T("IMPORT"), "", jQuery_actioner(same, jqlink(hkc_import_choose_col, [("format","csv"), ("table_name",table_name)])), left)) | |
| 78 | 78 | ]) |
| 79 | 79 | ) |
| 80 | 80 | ) |
| 81 | 81 | . |
| 82 | 82 | |
| 83 | -define List(HTML_Row(HTML_In_Form)) | |
| 83 | +define List(HTML) | |
| 84 | 84 | source_lines |
| 85 | 85 | ( |
| 86 | - List(String) cols, | |
| 87 | - List(HTML_Row(HTML_In_Form)) so_far, | |
| 88 | - Int index, | |
| 89 | - (String) -> String _T | |
| 86 | + List(String) cols, | |
| 87 | + List(HTML) so_far, | |
| 88 | + Int index, | |
| 89 | + (String) -> String _T | |
| 90 | 90 | )= |
| 91 | 91 | if cols is |
| 92 | 92 | { |
| 93 | 93 | [] then reverse(so_far), |
| 94 | 94 | [ h . t ] then |
| 95 | - source_lines( t, [ row([cell([style("display:none")], literal("")), | |
| 96 | - cell([core_attrs([id("col_"+index), class("dnd-src")])], text(_T("COLUMN")+ " "+index+" ("+h+")"))]) . so_far], index+1, _T) | |
| 95 | + source_lines( t, [ tr([td([style("display:none")], literal("")), | |
| 96 | + td([id("col_"+index), class("dnd-src")], text(_T("COLUMN")+ " "+index+" ("+h+")"))]) . so_far], index+1, _T) | |
| 97 | 97 | } |
| 98 | 98 | . |
| 99 | 99 | |
| 100 | -public define HTML_In_Form | |
| 100 | +public define HTML | |
| 101 | 101 | source_file_column_table |
| 102 | 102 | ( |
| 103 | 103 | Word8 separator, |
| ... | ... | @@ -123,24 +123,24 @@ public define HTML_In_Form |
| 123 | 123 | |
| 124 | 124 | if col_data is (line, cols) then |
| 125 | 125 | sequence([ |
| 126 | - hidden(html_Id("hk_source_col"), wan("hk_source_col"), wav(to_String(length(cols)))), | |
| 127 | - table([core_attrs([class("changelist small"), id("table-src")])], | |
| 128 | - header_row([ header_cell([style("display:none")], literal("")), | |
| 129 | - header_cell(literal("CSV_FILE_FIELDS"))]), | |
| 130 | - source_lines(cols, [], 0, _T) | |
| 126 | + hidden("hk_source_col", to_String(length(cols)), "hk_source_col"), | |
| 127 | + table([class("changelist small"), id("table-src")], [ | |
| 128 | + thead([ th(style("display:none")), | |
| 129 | + th(_T("CSV_FILE_FIELDS"))]) . | |
| 130 | + source_lines(cols, [], 0, _T)] | |
| 131 | 131 | ) |
| 132 | 132 | ]) |
| 133 | 133 | } |
| 134 | 134 | }. |
| 135 | 135 | . |
| 136 | 136 | |
| 137 | -define List(HTML_Row(HTML_In_Form)) | |
| 137 | +define List(HTML) | |
| 138 | 138 | target_lines |
| 139 | 139 | ( |
| 140 | - List((String,String)) cols, | |
| 141 | - List(HTML_Row(HTML_In_Form)) so_far, | |
| 142 | - Int index, | |
| 143 | - (String) -> String _T | |
| 140 | + List((String,String)) cols, | |
| 141 | + List(HTML) so_far, | |
| 142 | + Int index, | |
| 143 | + (String) -> String _T | |
| 144 | 144 | )= |
| 145 | 145 | //if tb is tool_box(lang, _, _T, _, db, user, _, _) then |
| 146 | 146 | if cols is |
| ... | ... | @@ -148,19 +148,16 @@ define List(HTML_Row(HTML_In_Form)) |
| 148 | 148 | [] then reverse(so_far), |
| 149 | 149 | [ h . t ] then |
| 150 | 150 | since h is (hidden_name, text_field), |
| 151 | - target_lines( t,[ row([ | |
| 152 | - cell([style("display:none")], empty), | |
| 153 | - cell([class("dnd-text ")], text(_T(text_field))), | |
| 154 | - cell([class("dnd-dst")], sequence([ | |
| 155 | - text(_T("IGNORED_COLUMN")), | |
| 156 | - hidden(html_Id("hk_"+hidden_name+"_input"), wan(""), wav(hidden_name)) | |
| 157 | - ])), | |
| 158 | - cell(image([class("dnd-dst-btn")],"/icons/16x16/delete_cross.png","")) | |
| 151 | + target_lines( t,[ tr([ | |
| 152 | + td(style("display:none")), | |
| 153 | + td(class("dnd-text "), text(_T(text_field))), | |
| 154 | + td(class("dnd-dst"), [ text(_T("IGNORED_COLUMN")), hidden([id("hk_"+hidden_name+"_input"), value(hidden_name)]) ]), | |
| 155 | + td(img(class("dnd-dst-btn"),"/icons/16x16/delete_cross.png")) | |
| 159 | 156 | ]) |
| 160 | 157 | . so_far], index+1, _T) |
| 161 | 158 | }. |
| 162 | 159 | |
| 163 | -define HTML_In_Form | |
| 160 | +define HTML | |
| 164 | 161 | target_column_table |
| 165 | 162 | ( |
| 166 | 163 | List((String,String)) choices, |
| ... | ... | @@ -168,16 +165,17 @@ define HTML_In_Form |
| 168 | 165 | )= |
| 169 | 166 | //since tb is tool_box(lang, _, _T, _, db, user, _, _), |
| 170 | 167 | |
| 171 | - table([core_attrs([class("changelist small"), id("table-dst")])], | |
| 172 | - header_row([ header_cell([style("display:none")], empty), | |
| 173 | - header_cell(text(_T("TABLE_FIELDS"))), | |
| 174 | - header_cell(text(_T("IMPORTED_FIELDS"))), | |
| 175 | - header_cell(literal(" "))]), | |
| 176 | - target_lines(choices, [], 0, _T) | |
| 168 | + table([class("changelist small"), id("table-dst")], [ | |
| 169 | + thead([ th([style("display:none")], empty), | |
| 170 | + th(_T("TABLE_FIELDS")), | |
| 171 | + th(_T("IMPORTED_FIELDS")), | |
| 172 | + th(literal(" "))]) | |
| 173 | + . | |
| 174 | + target_lines(choices, [], 0, _T)] | |
| 177 | 175 | ) |
| 178 | 176 | . |
| 179 | 177 | |
| 180 | -public define HTML_Partial_Content | |
| 178 | +public define HTML | |
| 181 | 179 | import_choose_col |
| 182 | 180 | ( |
| 183 | 181 | String target_table_name, |
| ... | ... | @@ -187,40 +185,38 @@ public define HTML_Partial_Content |
| 187 | 185 | WEB_Action_Name cancel_action, // |
| 188 | 186 | (String) -> String _T // translator from dictionary |
| 189 | 187 | )= |
| 190 | - partial_content([css(css_file("xlib/css/dnd.css")), | |
| 188 | + head_tags([css(css_file("xlib/css/dnd.css")), | |
| 191 | 189 | css(css_file("xlib/css/changelists.css")), |
| 192 | 190 | js(js_file("xlib/js/dnd.js")), |
| 193 | 191 | js(js_file("hayamiki/js/data_import.js")) |
| 194 | 192 | ], |
| 195 | 193 | sequence([ |
| 196 | - form("import_csv_form",[], hkc_import_execute, [("table_name", target_table_name), ("file",uploaded_file)], sequence([ | |
| 197 | - table([class("changelist small")], | |
| 198 | - header_row([ header_cell(literal(" ")), | |
| 199 | - header_cell(text(_T("INFORMATION_OF_SOURCE_FILE"))), | |
| 200 | - header_cell(literal(" ")), | |
| 201 | - ]), | |
| 202 | - [row([], [cell(image(icn16_mime_csv)), cell(text(_T("FILE_FORMAT"))), cell(text(_T("CSV_FILE")))]), | |
| 203 | - row([], [cell(image(icn16_mime_unknown)), cell(text(_T("SOURCE_FILE_TO_IMPORT"))), cell(text(uploaded_file))]), | |
| 204 | - row([], [cell(empty), cell(text(_T("DELIMITER"))), cell(selector_c([], no_label, html_Id("import_delimiter"), wan("csv_sep"), 1, csv_delimiter_combo(_T), init(separator)),)]), | |
| 205 | - row([], [cell(empty), cell(text(_T("FILE_ENCODING"))), cell(text("choose encoding"))]), | |
| 206 | - row([], [cell(empty), cell(text(_T("REMOVE_CSV_HEADER"))), cell(check_box([], no_label, html_Id(""), wan("hk_remove_csv_header"), true))]), | |
| 207 | - row([], [cell(empty), cell(text(_T("IMPORT_TYPE"))), cell(selector_c([], no_label, html_Id("import_type"), wan("import_type"), 1, csv_import_type_combo(_T), init(separator)),)]), | |
| 194 | + form("import_csv_form",[], hkc_import_execute, [("table_name", target_table_name), ("file",uploaded_file)], | |
| 195 | + sequence([ | |
| 196 | + table(class("changelist small"), | |
| 197 | + [thead([ th(literal(" ")), th(text(_T("INFORMATION_OF_SOURCE_FILE"))), th(literal(" ")) ]), | |
| 198 | + tr( [td(image(icn16_mime_csv)), td(_T("FILE_FORMAT")), td(_T("CSV_FILE"))]), | |
| 199 | + tr( [td(image(icn16_mime_unknown)), td(_T("SOURCE_FILE_TO_IMPORT")), td(uploaded_file)]), | |
| 200 | +// tr( [td(empty), td(_T("DELIMITER")), td(selector_c([], no_label, html_Id("import_delimiter"), wan("csv_sep"), 1, csv_delimiter_combo(_T), init(separator)),)]), | |
| 201 | + tr( [td(empty), td(_T("FILE_ENCODING")), td(text("choose encoding"))]), | |
| 202 | +// tr( [td(empty), td(_T("REMOVE_CSV_HEADER")), td(check_box([], no_label, html_Id(""), wan("hk_remove_csv_header"), true))]), | |
| 203 | +// tr( [td(empty), td(_T("IMPORT_TYPE")), td(selector_c([], no_label, html_Id("import_type"), wan("import_type"), 1, csv_import_type_combo(_T), init(separator)),)]), | |
| 208 | 204 | ]), |
| 209 | 205 | br, |
| 210 | - div([id("dragLists")], [ | |
| 206 | + div(id("dragLists"), [ | |
| 211 | 207 | //SOURCE column |
| 212 | - div([style("float: left; margin: 5px;")], div([class("dndContainer ")], | |
| 208 | + div([style("float: left; margin: 5px;")], div(class("dndContainer "), | |
| 213 | 209 | source_file_column_table(if explode(separator) is { [] then ';', [h . _] then h }, uploaded_file, _T))), |
| 214 | 210 | //TARGET column |
| 215 | - div([style("float: left; margin: 5px;")], div([class("dndContainer ")], | |
| 211 | + div([style("float: left; margin: 5px;")], div(class("dndContainer "), | |
| 216 | 212 | target_column_table(target_columns_choices, _T))), |
| 217 | 213 | |
| 218 | - div_empty([class("clear")]) | |
| 214 | + div(class("clear")) | |
| 219 | 215 | ]), |
| 220 | 216 | ])), //end of sequence in form |
| 221 | 217 | // )]) |
| 222 | - partial(jquery_button(jquery_img_button(icn16_cross, _T("CANCEL"), "", jQuery_actioner(same, jqlink(cancel_action)), left))), | |
| 223 | - partial(img_submit_button(_T("IMPORT"), "import_csv_form")) | |
| 218 | + jquery_button(jquery_img_button(icn16_cross, _T("CANCEL"), "", jQuery_actioner(same, jqlink(cancel_action)), left)), | |
| 219 | + img_submit_button(_T("IMPORT"), "import_csv_form") | |
| 224 | 220 | ]) //end of sequence |
| 225 | 221 | ) |
| 226 | 222 | . | ... | ... |
view/view_table_renderer.anubis
| ... | ... | @@ -204,7 +204,7 @@ else |
| 204 | 204 | });" |
| 205 | 205 | . |
| 206 | 206 | |
| 207 | -define HTML_In_Form | |
| 207 | +define HTML | |
| 208 | 208 | /* create a selector for choosing the view name. |
| 209 | 209 | * The selector create an immediate action. This means when the entry is selected, the action is fired. |
| 210 | 210 | * If only one view exists, the selector is not created |
| ... | ... | @@ -220,10 +220,10 @@ define HTML_In_Form |
| 220 | 220 | filter_len = length(filters), |
| 221 | 221 | |
| 222 | 222 | if filter_len = 0 then |
| 223 | - hidden(wan("filter_name"), wav("no_filter")) | |
| 223 | + hidden("filter_name", "no_filter") | |
| 224 | 224 | else if filter_len = 1 then |
| 225 | 225 | with filter_name = if filters is { [] then "", [h . _] then h.filter_name }, |
| 226 | - hidden(wan("filter_name"), wav(filter_name)) | |
| 226 | + hidden("filter_name", filter_name) | |
| 227 | 227 | else |
| 228 | 228 | actioner(same, same, |
| 229 | 229 | immediate_selector([id("select_view")], |
| ... | ... | @@ -237,7 +237,7 @@ define HTML_In_Form |
| 237 | 237 | [], []) |
| 238 | 238 | . |
| 239 | 239 | |
| 240 | -define HTML_Off_Form | |
| 240 | +define HTML | |
| 241 | 241 | /* create a selector for choosing the view name. |
| 242 | 242 | * The selector create an immediate action. This means when the entry is selected, the action is fired. |
| 243 | 243 | * If only one view exists, the selector is not created |
| ... | ... | @@ -250,9 +250,9 @@ define HTML_Off_Form |
| 250 | 250 | String current_filter |
| 251 | 251 | )= |
| 252 | 252 | with all_view_name = vtm_v.get_all_view_name(unique), |
| 253 | - form( "table_view_filter_selector", [], "", [], | |
| 254 | - sequence([ | |
| 255 | - hidden(wan("table_name"), wav(vtm_v.table_name)), | |
| 253 | + form( id("table_view_filter_selector"), | |
| 254 | + [ | |
| 255 | + hidden("table_name", vtm_v.table_name), | |
| 256 | 256 | (if length(all_view_name) = 1 then |
| 257 | 257 | empty |
| 258 | 258 | else |
| ... | ... | @@ -268,36 +268,36 @@ define HTML_Off_Form |
| 268 | 268 | [], [] |
| 269 | 269 | )), //!actionner |
| 270 | 270 | table_filter_selector(_T, all_view_name, current_view, current_filter) |
| 271 | - ]) | |
| 271 | + ] | |
| 272 | 272 | )//!form |
| 273 | 273 | . |
| 274 | 274 | |
| 275 | 275 | |
| 276 | 276 | // View table part |
| 277 | -define HTML_Row(HTML_Off_Form) make_line | |
| 277 | +define HTML make_line | |
| 278 | 278 | ( |
| 279 | 279 | String uid, |
| 280 | 280 | String table_name, |
| 281 | 281 | String _action_name, //default is "edit_table", but can be surcharged for own use |
| 282 | 282 | List(VT_view_entry) entries, |
| 283 | - List(HTML_Cell(HTML_Off_Form)) so_far | |
| 283 | + List(HTML) so_far | |
| 284 | 284 | )= |
| 285 | 285 | if entries is |
| 286 | 286 | { |
| 287 | - [] then row( [], reverse(so_far)), | |
| 287 | + [] then tr(reverse(so_far)), | |
| 288 | 288 | [h . t] then |
| 289 | 289 | with cell = if h is |
| 290 | 290 | { |
| 291 | - text(string) then cell((HTML_Off_Form)text(not_null_String(string))), | |
| 292 | -// link(id, string) then cell((HTML_Off_Form)actioner(same,same, link(string), action_name, [("table_name", table_name),("id",id)])), | |
| 293 | - link(id, string) then cell((HTML_Off_Form)literal(jq_dialog_open(string, dialog_id(uid+_action_name+"_dlg_ajax"), "'id="+id+"'"))), | |
| 294 | - link_id_action(id, name, action) then cell((HTML_Off_Form)actioner(same,same, link(name), action, [("id",id)])), | |
| 295 | - icon(icon_path) then cell((HTML_Off_Form)img(icon_path)) | |
| 291 | + text(string) then td(text(not_null_String(string))), | |
| 292 | +// link(id, string) then cell((HTML)actioner(same,same, link(string), action_name, [("table_name", table_name),("id",id)])), | |
| 293 | + link(id, string) then td(literal(jq_dialog_open(string, dialog_id(uid+_action_name+"_dlg_ajax"), "'id="+id+"'"))), | |
| 294 | + link_id_action(id, name, action) then td(actioner(same,same, link(name), action, [("id",id)])), | |
| 295 | + icon(icon_path) then td(img(icon_path)) | |
| 296 | 296 | }, |
| 297 | 297 | make_line(uid, table_name, _action_name, t, [cell . so_far]) |
| 298 | 298 | }. |
| 299 | 299 | |
| 300 | -define List(HTML_Row(HTML_Off_Form)) | |
| 300 | +define List(HTML) | |
| 301 | 301 | make_lines |
| 302 | 302 | ( |
| 303 | 303 | (String) -> String _T, //translator |
| ... | ... | @@ -305,7 +305,7 @@ define List(HTML_Row(HTML_Off_Form)) |
| 305 | 305 | String table_name, |
| 306 | 306 | String action_name, |
| 307 | 307 | List(VT_view_row) entries, |
| 308 | - List(HTML_Row(HTML_Off_Form)) so_far | |
| 308 | + List(HTML) so_far | |
| 309 | 309 | )= |
| 310 | 310 | if entries is |
| 311 | 311 | { |
| ... | ... | @@ -313,41 +313,39 @@ define List(HTML_Row(HTML_Off_Form)) |
| 313 | 313 | [h . t] then |
| 314 | 314 | //compute each line |
| 315 | 315 | //prepare here the first cell for actioner |
| 316 | - with actions_cell = (HTML_Cell(HTML_Off_Form)) | |
| 317 | - cell([], | |
| 318 | - sequence([ | |
| 319 | - partial(img_button_confirm(icn16_cross, _T("CONFIRMATION_REQUEST"), _T("CONFIRM_LINE_DELETION") , _T("OK"), _T("CANCEL"), jQuery_actioner(same, jqlink(controller_action("hk_c", "delete_row" + format_extra_operands([("table_name", table_name),("id",to_String(h.db_id))])))))), | |
| 320 | - partial(img_button(icn16_edit, [event(onclick, jq_dialog_open(dialog_id(uid+action_name+"_dlg_ajax"), "'id="+to_String(h.db_id)+"'"))], "", [])), | |
| 321 | - ]) | |
| 322 | - ), | |
| 316 | + with actions_cell = //(HTML_Cell(HTML)) | |
| 317 | + td([ | |
| 318 | + img_button_confirm(icn16_cross, _T("CONFIRMATION_REQUEST"), _T("CONFIRM_LINE_DELETION") , _T("OK"), _T("CANCEL"), jQuery_actioner(same, jqlink(controller_action("hk_c", "delete_row" + format_extra_operands([("table_name", table_name),("id",to_String(h.db_id))]))))), | |
| 319 | + img_button(icn16_edit, [event(onclick, jq_dialog_open(dialog_id(uid+action_name+"_dlg_ajax"), "'id="+to_String(h.db_id)+"'"))], "", []), | |
| 320 | + ]), | |
| 323 | 321 | make_lines(_T, uid, table_name, action_name, t, [make_line(uid, table_name, action_name, h.list, [actions_cell]). so_far] ) |
| 324 | 322 | }. |
| 325 | 323 | |
| 326 | 324 | // View table part |
| 327 | -define HTML_Header_Row(HTML_Off_Form) | |
| 325 | +define HTML | |
| 328 | 326 | make_header |
| 329 | 327 | ( |
| 330 | - (String) -> String _T, //translator | |
| 331 | - List(VT_view_entry) entries, | |
| 332 | - List(HTML_Header_Cell(HTML_Off_Form)) so_far | |
| 328 | + (String) -> String _T, //translator | |
| 329 | + List(VT_view_entry) entries, | |
| 330 | + List(HTML) so_far | |
| 333 | 331 | )= |
| 334 | 332 | if entries is |
| 335 | 333 | { |
| 336 | - [] then header_row( [], reverse(so_far)), | |
| 334 | + [] then thead(reverse(so_far)), | |
| 337 | 335 | [h . t] then |
| 338 | 336 | with cell = if h is |
| 339 | 337 | { |
| 340 | - text(string) then header_cell((HTML_Off_Form)text(_T(string))), | |
| 341 | - link(id, string) then header_cell((HTML_Off_Form)actioner(same, same, link(string), hkc_edit_table,[])), //TODO | |
| 342 | - link_id_action(id, text, action) then header_cell((HTML_Off_Form)actioner(same,same, link(text), action,[("id",id)])), //TODO | |
| 343 | - icon(icon_path) then header_cell((HTML_Off_Form)img(icon_path)) | |
| 338 | + text(string) then th(text(_T(string))), | |
| 339 | + link(id, string) then th((HTML)actioner(same, same, link(string), hkc_edit_table,[])), //TODO | |
| 340 | + link_id_action(id, text, action) then th((HTML)actioner(same,same, link(text), action,[("id",id)])), //TODO | |
| 341 | + icon(icon_path) then th(img(icon_path)) | |
| 344 | 342 | }, |
| 345 | 343 | make_header(_T, t, [cell . so_far]) |
| 346 | 344 | }. |
| 347 | 345 | |
| 348 | 346 | |
| 349 | 347 | |
| 350 | -public define HTML_Partial_Content | |
| 348 | +public define HTML | |
| 351 | 349 | view_table_form |
| 352 | 350 | ( |
| 353 | 351 | (String) -> String _T, |
| ... | ... | @@ -355,8 +353,8 @@ public define HTML_Partial_Content |
| 355 | 353 | String action_name, |
| 356 | 354 | VT_view rows |
| 357 | 355 | )= |
| 358 | - with action_header_cell = header_cell((HTML_Off_Form)text(_T("ACTION"))), | |
| 359 | - partial_content( | |
| 356 | + with action_header_cell = th(text(_T("ACTION"))), | |
| 357 | + | |
| 360 | 358 | div( [/*class("tableau")*/], |
| 361 | 359 | sequence( |
| 362 | 360 | [ |
| ... | ... | @@ -368,7 +366,7 @@ public define HTML_Partial_Content |
| 368 | 366 | //) |
| 369 | 367 | ] |
| 370 | 368 | ) |
| 371 | - )) | |
| 369 | + ) | |
| 372 | 370 | . |
| 373 | 371 | |
| 374 | 372 | define String |
| ... | ... | @@ -448,7 +446,7 @@ define String |
| 448 | 446 | // jq_dialog_open(dialog_id(uid+"edit_table_dlg_ajax"), "'id='+rowid")+ |
| 449 | 447 | . |
| 450 | 448 | |
| 451 | -public define HTML_Partial_Content | |
| 449 | +public define HTML | |
| 452 | 450 | jqGrid_table |
| 453 | 451 | ( |
| 454 | 452 | SQLite3DataBase db, |
| ... | ... | @@ -519,20 +517,18 @@ url:'?aws_c=hk_c&aws_a=grid_view&table_name="+rows.table_name+"&view_name="+rows |
| 519 | 517 | return ret; |
| 520 | 518 | }")), |
| 521 | 519 | logDebug("jqGrid_table: partial_content"); |
| 522 | - partial_content(jqgrid_init(lang) + [js_init, | |
| 520 | + head_tags(jqgrid_init(lang) + [js_init, | |
| 523 | 521 | css(css_file("hayamiki/css/hayamiki.css")), |
| 524 | 522 | js(js_file("select2/js/select2.full.js")), |
| 525 | 523 | css(css_file("select2/css/select2.css"))], |
| 526 | - div([], | |
| 527 | - sequence([ | |
| 528 | - table([core_attrs([id(uid+"_grid")])],[]), | |
| 524 | + div( | |
| 525 | + table(id(uid+"_grid"),[]) | |
| 529 | 526 | //DR 20170528 div_empty([id(uid+"_pager")]) |
| 530 | - ]) | |
| 531 | 527 | ) |
| 532 | 528 | ) |
| 533 | 529 | . |
| 534 | 530 | |
| 535 | -public define HTML_Partial_Content | |
| 531 | +public define HTML | |
| 536 | 532 | view_table_page |
| 537 | 533 | ( |
| 538 | 534 | SQLite3DataBase db, |
| ... | ... | @@ -560,26 +556,26 @@ public define HTML_Partial_Content |
| 560 | 556 | with jqgrid_table = jqGrid_table(db, uid, current_view, filter_name, _T, lang, f_clause, table_referer), |
| 561 | 557 | logDebug(show_duration_string("jqGrid_table : current_view '"+view_name+"' filter_name '"+filter_name+"'", start_time)); |
| 562 | 558 | with result = |
| 563 | - partial_content([ js(js_file("hayamiki/js/jscolor.min.js")) | |
| 559 | + head_tags([ js(js_file("hayamiki/js/jscolor.min.js")) | |
| 564 | 560 | ]+jq_dialog_init + jq_datetimepicker_init(lang), |
| 565 | 561 | [html_wave_box_wide(_T(to_upper(current_view.table_name)), |
| 566 | - sequence([ | |
| 562 | + [ | |
| 567 | 563 | //create the dialog |
| 568 | - partial(jq_dialog_create(dialog_id(uid+action_name+"_dlg_ajax"), ajax(controller_action("hk_c", "ajax_edit_table&dialog_id="+uid+action_name+"_dlg_ajax&table_name="+current_view.table_name+filter_clause+referer_arg)))), | |
| 569 | - div([class("inline")], sequence([ | |
| 564 | + jq_dialog_create(dialog_id(uid+action_name+"_dlg_ajax"), ajax(controller_action("hk_c", "ajax_edit_table&dialog_id="+uid+action_name+"_dlg_ajax&table_name="+current_view.table_name+filter_clause+referer_arg))), | |
| 565 | + div(class("inline"), [ | |
| 570 | 566 | // (+) icon for adding new entry |
| 571 | - partial(img_button(icn16_add, [class("icon_in_text"), event(onclick, jq_dialog_open(dialog_id(uid+action_name+"_dlg_ajax")))], "", [])), | |
| 567 | + img_button(icn16_add, [class("icon_in_text"), event(onclick, jq_dialog_open(dialog_id(uid+action_name+"_dlg_ajax")))], "", []), | |
| 572 | 568 | // view selector if there is more than one view name |
| 573 | 569 | table_view_filter_selector(_T, vtm_v, view_name, filter_name), |
| 574 | - ])), | |
| 570 | + ]), | |
| 575 | 571 | //grid with data |
| 576 | - partial(jqgrid_table) | |
| 572 | + jqgrid_table | |
| 577 | 573 | //partial(jquery_datatable(uid+"table_view", view_table_form(_T, uid, action_name, rows), true, false, jq_dt_pt_full_numbers, false, scrollY(500), true, true, true, lang, no_extra, web_site_directory)) |
| 578 | - ]))]), | |
| 574 | + ])]), | |
| 579 | 575 | logDebug(show_duration_string("view_table_page: current_view '"+view_name+"' filter_name '"+filter_name+"'", start_time)); |
| 580 | 576 | result. |
| 581 | 577 | |
| 582 | -public define HTML_Partial_Content | |
| 578 | +public define HTML | |
| 583 | 579 | table_in_list_view |
| 584 | 580 | ( |
| 585 | 581 | SQLite3DataBase db, |
| ... | ... | @@ -602,21 +598,21 @@ public define HTML_Partial_Content |
| 602 | 598 | with start_time = unow, |
| 603 | 599 | with jqgrid_table = jqGrid_table(db, uid, current_view, filter_name, _T, lang, /*fk_clause*/ f_clause, table_referer), |
| 604 | 600 | logDebug(show_duration_string("jqGrid_table : current_view '"+view_name+"' filter_name '"+filter_name+"'", start_time)); |
| 605 | - with result = partial_content([ js(js_file("hayamiki/js/jscolor.min.js")) | |
| 601 | + with result = head_tags([ js(js_file("hayamiki/js/jscolor.min.js")) | |
| 606 | 602 | ]+ |
| 607 | 603 | jq_dialog_init + |
| 608 | 604 | jq_datetimepicker_init(lang), |
| 609 | 605 | [ |
| 610 | - partial(jq_dialog_create(dialog_id(uid+action_name+"_dlg_ajax"), ajax(controller_action("hk_c", "ajax_edit_table&dialog_id="+uid+action_name+"_dlg_ajax&table_name="+current_view.table_name+filter_clause+referer_arg)))), | |
| 611 | - partial(img_button(icn16_add, [class("icon_in_text"), event(onclick, jq_dialog_open(dialog_id(uid+action_name+"_dlg_ajax")))], "", [])), | |
| 606 | + jq_dialog_create(dialog_id(uid+action_name+"_dlg_ajax"), ajax(controller_action("hk_c", "ajax_edit_table&dialog_id="+uid+action_name+"_dlg_ajax&table_name="+current_view.table_name+filter_clause+referer_arg))), | |
| 607 | + img_button(icn16_add, [class("icon_in_text"), event(onclick, jq_dialog_open(dialog_id(uid+action_name+"_dlg_ajax")))], "", []), | |
| 612 | 608 | //table_view_selector(_T, vtm_v, view_name), |
| 613 | - partial(jqgrid_table), | |
| 609 | + jqgrid_table, | |
| 614 | 610 | //partial(jquery_datatable(uid+"table_view", view_table_form(_T, uid, action_name, rows), true, false, jq_dt_pt_full_numbers, false, scrollY(200), true, true, true, lang, no_extra, web_site_directory)) |
| 615 | 611 | ]), |
| 616 | 612 | logDebug(show_duration_string("table_in_list_view: current_view '"+view_name+"' filter_name '"+filter_name+"'", start_time)); |
| 617 | 613 | result. |
| 618 | 614 | |
| 619 | -public define Maybe(HTML_Partial_Content) | |
| 615 | +public define Maybe(HTML) | |
| 620 | 616 | view_table_content |
| 621 | 617 | ( |
| 622 | 618 | SQLite3DataBase db, |
| ... | ... | @@ -641,7 +637,7 @@ public define Maybe(HTML_Partial_Content) |
| 641 | 637 | success(view_table_page(db, _T, lang, /*web_site_directory, */action_name, vtm_v, view_name, filter_name, f_clause, table_referer, fk_clause)) |
| 642 | 638 | }. |
| 643 | 639 | |
| 644 | -public define Maybe(HTML_Partial_Content) | |
| 640 | +public define Maybe(HTML) | |
| 645 | 641 | view_table_content |
| 646 | 642 | ( |
| 647 | 643 | SQLite3DataBase db, |
| ... | ... | @@ -655,7 +651,7 @@ public define Maybe(HTML_Partial_Content) |
| 655 | 651 | ) = |
| 656 | 652 | view_table_content(db, _T, lang, /*web_site_directory,*/ table_name, view_name, action_name, "", "", no_referer, "", vtm). |
| 657 | 653 | |
| 658 | -public define Maybe(HTML_Partial_Content) | |
| 654 | +public define Maybe(HTML) | |
| 659 | 655 | table_in_list_view_only |
| 660 | 656 | ( |
| 661 | 657 | SQLite3DataBase db, |
| ... | ... | @@ -811,16 +807,16 @@ public define List(CXM_Form_Field) |
| 811 | 807 | with init_script = "var newOption"+uid+foreign_table_name+"_"+c_name+"_selector = new Option("+to_JS_String(fk_show_string)+", '"+to_String(value)+"', true, true); |
| 812 | 808 | $('#"+uid+foreign_table_name+"_"+c_name+"_selector').select2("+select2_option_str+").append(newOption"+uid+foreign_table_name+"_"+c_name+"_selector).trigger('change');", |
| 813 | 809 | [ |
| 814 | - partial(jq_dialog_create(dialog_id(uid+foreign_table_name+"_dlg_ajax"), ajax(controller_action("hk_c", "ajax_edit_table&dialog_id="+uid+foreign_table_name+"_dlg_ajax&sub_dialog=true&table_name="+foreign_table_name+"&after_close_cb="+refresh_func)))), | |
| 810 | + html(jq_dialog_create(dialog_id(uid+foreign_table_name+"_dlg_ajax"), ajax(controller_action("hk_c", "ajax_edit_table&dialog_id="+uid+foreign_table_name+"_dlg_ajax&sub_dialog=true&table_name="+foreign_table_name+"&after_close_cb="+refresh_func)))), | |
| 815 | 811 | one_line_fields([ |
| 816 | - partial(partial_content([js_inline(refresh_script), | |
| 817 | - js_inline(jquery_ready(init_script)) | |
| 818 | - ],empty)), | |
| 819 | - selector_c([],label(_T(s_name), no_help), html_Id(uid+foreign_table_name+"_"+c_name+"_selector"), wan(c_name), 1, [],/*select.get(db, table_referer, fk_clause), */ success(init("")), mandatory), help_line(help, _T), | |
| 812 | + html(head_tags([js_inline(refresh_script), | |
| 813 | + js_inline(jquery_ready(init_script)) | |
| 814 | + ])), | |
| 815 | + selector_c([],label(_T(s_name), no_help), html_Id(uid+foreign_table_name+"_"+c_name+"_selector"), wan(c_name), 1, [],/*select.get(db, table_referer, fk_clause), */ success(init("")), mandatory), help_line(help, _T), | |
| 820 | 816 | if no_add then |
| 821 | 817 | empty |
| 822 | 818 | else |
| 823 | - partial(img_button(icn16_add, [event(onclick, jq_dialog_open(dialog_id(uid+foreign_table_name+"_dlg_ajax")))], "", [])), | |
| 819 | + html(img_button(icn16_add, [event(onclick, jq_dialog_open(dialog_id(uid+foreign_table_name+"_dlg_ajax")))], "", [])), | |
| 824 | 820 | ]) |
| 825 | 821 | ]), |
| 826 | 822 | |
| ... | ... | @@ -850,7 +846,7 @@ public define List(CXM_Form_Field) |
| 850 | 846 | with combo_init = ajax_combo_init_parameter(uid, foreign_table_name, c_name, to_mb_Int(select), s_fields, active_filters), |
| 851 | 847 | [ |
| 852 | 848 | |
| 853 | - partial(partial_content([ js(js_file("ajax-combobox/js/jquery.ajax-combobox.js")), | |
| 849 | + html(head_tags([ js(js_file("ajax-combobox/js/jquery.ajax-combobox.js")), | |
| 854 | 850 | css(css_file("ajax-combobox/css/jquery.ajax-combobox.css")), |
| 855 | 851 | js_inline(jquery_ready(combo_init))], |
| 856 | 852 | jq_dialog_create(dialog_id(uid+foreign_table_name+"_dlg_ajax"), ajax(controller_action("hk_c", "ajax_edit_table&dialog_id="+uid+foreign_table_name+"_dlg_ajax&sub_dialog=true&table_name="+foreign_table_name))))), |
| ... | ... | @@ -861,7 +857,7 @@ public define List(CXM_Form_Field) |
| 861 | 857 | if no_add then |
| 862 | 858 | empty |
| 863 | 859 | else |
| 864 | - partial(img_button(icn16_add, [event(onclick, jq_dialog_open(dialog_id(uid+foreign_table_name+"_dlg_ajax")))], "", [])), | |
| 860 | + html(img_button(icn16_add, [event(onclick, jq_dialog_open(dialog_id(uid+foreign_table_name+"_dlg_ajax")))], "", [])), | |
| 865 | 861 | ]), |
| 866 | 862 | help_line(help, _T) |
| 867 | 863 | ] |
| ... | ... | @@ -875,7 +871,7 @@ public define List(CXM_Form_Field) |
| 875 | 871 | [ |
| 876 | 872 | if txt_editor is { |
| 877 | 873 | none then empty, |
| 878 | - rich_editor then partial(partial_content( | |
| 874 | + rich_editor then html(head_tags( | |
| 879 | 875 | [ js(js_file("ckeditor/ckeditor.js")), |
| 880 | 876 | js_inline(jquery_ready( |
| 881 | 877 | " console.log('loading CKeditor for "+dialog_uid+"_"+c_name+"'); |
| ... | ... | @@ -922,7 +918,7 @@ public define List(CXM_Form_Field) |
| 922 | 918 | |
| 923 | 919 | |
| 924 | 920 | |
| 925 | -public define HTML_Partial_Content | |
| 921 | +public define HTML | |
| 926 | 922 | renderer_edit_list_form |
| 927 | 923 | ( |
| 928 | 924 | SQLite3DataBase db, |
| ... | ... | @@ -952,7 +948,7 @@ public define HTML_Partial_Content |
| 952 | 948 | with button_name_and_new = if create then _T("CREATE_AND_EDIT_NEW") else _T("UPDATE_AND_EDIT_NEW"), |
| 953 | 949 | with form_id = dialog_id+"_form", |
| 954 | 950 | //println("renderer_edit_list_form dialog_id ["+dialog_id+"]"); |
| 955 | - partial_content( | |
| 951 | + head_tags( | |
| 956 | 952 | [ js(js_file("hayamiki/js/jscolor.min.js")), |
| 957 | 953 | js(js_file("xlib/js/dropzone.js")), |
| 958 | 954 | js(js_file("select2/js/select2.full.min.js")), |
| ... | ... | @@ -975,8 +971,8 @@ public define HTML_Partial_Content |
| 975 | 971 | (if length(list_entries) > 5 then |
| 976 | 972 | [ |
| 977 | 973 | one_line_fields([ |
| 978 | - partial(jquery_button(jQuery_button(button, dialog_id+button_name, button_name, button_label, jQuery_actioner(same, jqscript(jq_form_submit_and_close(dialog_id, form_id, if create then hkc_create_row else hkc_update_row, [("table_name", table_name), ("sub_dialog", sub_dialog)], after_close_cb)))))), | |
| 979 | - partial(jquery_button(jQuery_button(button, dialog_id+"cancel", "cancel", _T("CANCEL"), jQuery_actioner(same, jqscript("$('#"+dialog_id+"').dialog('close')"))))), | |
| 974 | + html(jquery_button(jQuery_button(button, dialog_id+button_name, button_name, button_label, jQuery_actioner(same, jqscript(jq_form_submit_and_close(dialog_id, form_id, if create then hkc_create_row else hkc_update_row, [("table_name", table_name), ("sub_dialog", sub_dialog)], after_close_cb)))))), | |
| 975 | + html(jquery_button(jQuery_button(button, dialog_id+"cancel", "cancel", _T("CANCEL"), jQuery_actioner(same, jqscript("$('#"+dialog_id+"').dialog('close')"))))), | |
| 980 | 976 | ]), |
| 981 | 977 | hr |
| 982 | 978 | ] |
| ... | ... | @@ -995,16 +991,16 @@ public define HTML_Partial_Content |
| 995 | 991 | with referer = hk_referer(table_name, id, fk_table_name, fk_col_name), |
| 996 | 992 | if table_in_list_view_only(db, _T, lang, /* web_site_directory, */ fk_table_name, list_view_name, "", "edit", "", referer, fk_clause, vtm) is |
| 997 | 993 | { |
| 998 | - failure then empty, | |
| 999 | - success(p_content) then partial(p_content) | |
| 994 | + failure then html(empty), | |
| 995 | + success(p_content) then html(p_content) | |
| 1000 | 996 | } |
| 1001 | 997 | //text("Foreign Key from table ["+fk_table_name+"] columns ["+fk_col_name+"] view to use ["+list_view_name+"]") |
| 1002 | 998 | ,list_tabs))+ |
| 1003 | 999 | |
| 1004 | 1000 | [ hr, |
| 1005 | 1001 | one_line_fields([ |
| 1006 | - partial(jquery_button(jQuery_button(button, dialog_id+button_name+"_bt", button_name, button_label, jQuery_actioner(same, jqscript(jq_form_submit_and_close(dialog_id, form_id, if create then hkc_create_row else hkc_update_row, [("table_name", table_name), ("sub_dialog", sub_dialog)], after_close_cb)))))), | |
| 1007 | - partial(jquery_button(jQuery_button(button, dialog_id+"cancel_bt", "cancel", _T("CANCEL"), jQuery_actioner(same, jqscript("$('#"+dialog_id+"').dialog('close')"))))), | |
| 1002 | + html(jquery_button(jQuery_button(button, dialog_id+button_name+"_bt", button_name, button_label, jQuery_actioner(same, jqscript(jq_form_submit_and_close(dialog_id, form_id, if create then hkc_create_row else hkc_update_row, [("table_name", table_name), ("sub_dialog", sub_dialog)], after_close_cb)))))), | |
| 1003 | + html(jquery_button(jQuery_button(button, dialog_id+"cancel_bt", "cancel", _T("CANCEL"), jQuery_actioner(same, jqscript("$('#"+dialog_id+"').dialog('close')"))))), | |
| 1008 | 1004 | ]) |
| 1009 | 1005 | ] |
| 1010 | 1006 | // submit(if create then hkc_save_row else hkc_update_row, failure, button_name, [("table_name", table_name), ("sub_dialog", sub_dialog)]), |
| ... | ... | @@ -1080,14 +1076,14 @@ public define List(CXM_Form_Field) |
| 1080 | 1076 | //with load_script = "Xlib.load_content('"+uid+foreign_table_name+"_"+c_name+"_selector', '?aws_controller=hk_c&aws_action=selector&table_name="+foreign_table_name+"&fk_filter="+fk_clause+"&selected="+value+"');", |
| 1081 | 1077 | with load_script = script("text/javascript","function "+refresh_func+"() { Xlib.load_content('"+uid+foreign_table_name+"_"+c_name+"_selector', '?aws_c=hk_c&aws_a=selector&table_name="+foreign_table_name+"&fk_filter="+fk_clause+"&selected="+value+"');} "+refresh_func+"(); "), |
| 1082 | 1078 | [ |
| 1083 | - partial(jq_dialog_create(dialog_id(uid+foreign_table_name+"_dlg_ajax"), ajax(controller_action("hk_c", "ajax_edit_table&dialog_id="+uid+foreign_table_name+"_dlg_ajax&sub_dialog=true&table_name="+foreign_table_name)))), | |
| 1079 | + html(jq_dialog_create(dialog_id(uid+foreign_table_name+"_dlg_ajax"), ajax(controller_action("hk_c", "ajax_edit_table&dialog_id="+uid+foreign_table_name+"_dlg_ajax&sub_dialog=true&table_name="+foreign_table_name)))), | |
| 1084 | 1080 | one_line_fields([ |
| 1085 | - partial(partial_content([js_inline(load_script)],empty)), | |
| 1081 | + html(head_tags(js_inline(load_script))), | |
| 1086 | 1082 | selector_c([],label(_T(s_name), no_help), html_Id(uid+foreign_table_name+"_"+c_name+"_selector"), wan(c_name), 1, /*select.get(db, table_referer, fk_clause)*/ [], success(init("")), mandatory), help_line(help, _T), |
| 1087 | 1083 | if no_add then |
| 1088 | - empty | |
| 1084 | + html(empty) | |
| 1089 | 1085 | else |
| 1090 | - partial(img_button(icn16_add, [event(onclick, jq_dialog_open(dialog_id(uid+foreign_table_name+"_dlg_ajax")))], "", [])), | |
| 1086 | + html(img_button(icn16_add, [event(onclick, jq_dialog_open(dialog_id(uid+foreign_table_name+"_dlg_ajax")))], "", [])), | |
| 1091 | 1087 | ]) |
| 1092 | 1088 | ], |
| 1093 | 1089 | |
| ... | ... | @@ -1109,7 +1105,7 @@ public define List(CXM_Form_Field) |
| 1109 | 1105 | |
| 1110 | 1106 | with combo_init = ajax_combo_init_parameter(uid, foreign_table_name, c_name, to_mb_Int(select), s_fields, active_filters), |
| 1111 | 1107 | [ |
| 1112 | - partial(partial_content([ | |
| 1108 | + html(head_tags([ | |
| 1113 | 1109 | js(js_file("ajax-combobox/js/jquery.ajax-combobox.js")), |
| 1114 | 1110 | css(css_file("ajax-combobox/css/jquery.ajax-combobox.css")), |
| 1115 | 1111 | js(js_file("select2/js/select2.full.min.js")), |
| ... | ... | @@ -1121,7 +1117,7 @@ public define List(CXM_Form_Field) |
| 1121 | 1117 | if no_add then |
| 1122 | 1118 | empty |
| 1123 | 1119 | else |
| 1124 | - partial(img_button(icn16_add, [event(onclick, jq_dialog_open(dialog_id(uid+foreign_table_name+"_dlg_ajax")))], "", [])), | |
| 1120 | + html(img_button(icn16_add, [event(onclick, jq_dialog_open(dialog_id(uid+foreign_table_name+"_dlg_ajax")))], "", [])), | |
| 1125 | 1121 | ]), |
| 1126 | 1122 | help_line(help, _T) |
| 1127 | 1123 | ] |
| ... | ... | @@ -1135,7 +1131,7 @@ public define List(CXM_Form_Field) |
| 1135 | 1131 | [ |
| 1136 | 1132 | if txt_editor is { |
| 1137 | 1133 | none then empty, |
| 1138 | - rich_editor then partial(partial_content( | |
| 1134 | + rich_editor then html(head_tags( | |
| 1139 | 1135 | [js(js_file("ckeditor/ckeditor.js")), |
| 1140 | 1136 | js_inline(jquery_ready( |
| 1141 | 1137 | " console.log('loading CKeditor for "+c_name+"'); |
| ... | ... | @@ -1146,7 +1142,7 @@ public define List(CXM_Form_Field) |
| 1146 | 1142 | " cke_instance.on('blur', function() { cke_instance.updateElement(); }); |
| 1147 | 1143 | "))],empty)) |
| 1148 | 1144 | }, |
| 1149 | - text_area([],no_label, html_Id(c_name), wan(c_name), init(not_null_String(value)), narrow, (Int)5, mandatory), help_line(help, _T)], | |
| 1145 | + text_area([],no_label, html_Id(c_name), wan(c_name), init(not_null_String(value)), narrow, (Int)5, mandatory), help_line(help, _T)], | |
| 1150 | 1146 | |
| 1151 | 1147 | boolean(s_name, c_name, value, help) then |
| 1152 | 1148 | [checkboxr([],label(_T(s_name), no_help), html_Id(c_name), wan(c_name), value, mandatory), help_line(help, _T)], |
| ... | ... | @@ -1174,7 +1170,7 @@ public define List(CXM_Form_Field) |
| 1174 | 1170 | [url_input([event(onclick, "hk_go_url(this)"), class("clickable")], [class("hk_input_url")], label(_T(s_name), no_help), html_Id(c_name), wan(c_name), init(not_null_String(value)), narrow, mandatory), help_line(help, _T)], |
| 1175 | 1171 | }. |
| 1176 | 1172 | |
| 1177 | -define List(Cell_Option) | |
| 1173 | +define List(CoreAttrs) | |
| 1178 | 1174 | make_cell_option |
| 1179 | 1175 | ( |
| 1180 | 1176 | List(HK_Form_Table_Cell_Attribute) attributes |
| ... | ... | @@ -1183,8 +1179,8 @@ define List(Cell_Option) |
| 1183 | 1179 | |-> |
| 1184 | 1180 | if attr is |
| 1185 | 1181 | { |
| 1186 | - colspan(number) then columns(number), | |
| 1187 | - rowspan(number) then rows(number) | |
| 1182 | + colspan(number) then colspan(number), | |
| 1183 | + rowspan(number) then rowspan(number) | |
| 1188 | 1184 | }, |
| 1189 | 1185 | attributes |
| 1190 | 1186 | ) |
| ... | ... | @@ -1205,17 +1201,17 @@ define CXM_Form_Field |
| 1205 | 1201 | table([class("striped")], |
| 1206 | 1202 | map((HK_Form_Table_Line line) |
| 1207 | 1203 | |-> //construct line |
| 1208 | - row( | |
| 1204 | + tr( | |
| 1209 | 1205 | map((HK_Form_Table_Cell cell_content) |
| 1210 | 1206 | |-> |
| 1211 | 1207 | if cell_content is |
| 1212 | 1208 | { |
| 1213 | 1209 | //construct one cell |
| 1214 | 1210 | hk_form_table_cell(cell_attributes, entry) then |
| 1215 | - cell(make_cell_option(cell_attributes), to_HTML_In_Form(edit_form_cell(db, table_referer, lwa, _T, entry, create, no_add, []), lwa, "form_field table", false)), | |
| 1211 | + td(make_cell_option(cell_attributes), to_HTML(edit_form_cell(db, table_referer, lwa, _T, entry, create, no_add, []), lwa, "form_field table", false)), | |
| 1216 | 1212 | //construct table in one cell |
| 1217 | 1213 | hk_form_table_cell_table(cell_attributes, lines) then |
| 1218 | - cell(make_cell_option(cell_attributes), to_HTML_In_Form([construct_edit_form_table(db, table_referer, _T, lwa, lines, create, no_add)], lwa, "form_field table", false)) | |
| 1214 | + td(make_cell_option(cell_attributes), to_HTML([construct_edit_form_table(db, table_referer, _T, lwa, lines, create, no_add)], lwa, "form_field table", false)) | |
| 1219 | 1215 | }, |
| 1220 | 1216 | line.form_table_cells |
| 1221 | 1217 | ) |
| ... | ... | @@ -1225,6 +1221,7 @@ define CXM_Form_Field |
| 1225 | 1221 | ) |
| 1226 | 1222 | ) |
| 1227 | 1223 | . |
| 1224 | + | |
| 1228 | 1225 | public define List(CXM_Form_Field) |
| 1229 | 1226 | get_hidden |
| 1230 | 1227 | ( |
| ... | ... | @@ -1235,7 +1232,7 @@ public define List(CXM_Form_Field) |
| 1235 | 1232 | |
| 1236 | 1233 | |
| 1237 | 1234 | |
| 1238 | -public define HTML_Partial_Content | |
| 1235 | +public define HTML | |
| 1239 | 1236 | renderer_edit_table_form |
| 1240 | 1237 | ( |
| 1241 | 1238 | SQLite3DataBase db, |
| ... | ... | @@ -1263,7 +1260,7 @@ public define HTML_Partial_Content |
| 1263 | 1260 | with button_name = if create then "create" else "update", |
| 1264 | 1261 | with button_name_and_new = if create then _T("CREATE_AND_EDIT_NEW") else _T("UPDATE_AND_EDIT_NEW"), |
| 1265 | 1262 | with form_id = dialog_id+"_form", |
| 1266 | - partial_content( | |
| 1263 | + head_tags( | |
| 1267 | 1264 | [ js(js_file("hayamiki/js/jscolor.min.js")), |
| 1268 | 1265 | js_script("jscolor.installByClassName('jscolor');") |
| 1269 | 1266 | //js_script("jscolor.init;") |
| ... | ... | @@ -1272,7 +1269,7 @@ public define HTML_Partial_Content |
| 1272 | 1269 | jq_datetimepicker_init(lang), |
| 1273 | 1270 | //get_editor_header(table_form.form_lines)+ //add editor header if need. Like init ck_editor |
| 1274 | 1271 | //get_combo_header(table_name, table_form.form_lines), //add editor header if need. Like init ck_editor |
| 1275 | - sequence([ | |
| 1272 | + [ | |
| 1276 | 1273 | cxm_form( form_id, [], lwa, |
| 1277 | 1274 | get_hidden(table_form.table_attr)+ //collect hidden value from table form |
| 1278 | 1275 | get_hidden(lwa)+ //collect hidden value from lwa |
| ... | ... | @@ -1281,8 +1278,8 @@ public define HTML_Partial_Content |
| 1281 | 1278 | // submit(if create then hkc_save_row else hkc_update_row, failure, button_name, [("table_name", table_name)]), |
| 1282 | 1279 | // submit(if create then hkc_save_row_and_new else hkc_update_row_and_new, failure, button_name_and_new, [("table_name", table_name)]), |
| 1283 | 1280 | // submit(hkc_cancel, failure, _T("CANCEL")) |
| 1284 | - partial(jquery_button(jQuery_button(button, dialog_id+button_name, button_name, button_label, jQuery_actioner(same, jqscript(jq_form_submit_and_close(dialog_id, form_id, if create then hkc_create_row else hkc_update_row, [("table_name", table_name), ("sub_dialog", sub_dialog)], after_close_cb)))))), | |
| 1285 | - partial(jquery_button(jQuery_button(button, dialog_id+"cancel", "cancel", _T("CANCEL"), jQuery_actioner(same, jqscript("$('#"+dialog_id+"').dialog('close')"))))), | |
| 1281 | + html(jquery_button(jQuery_button(button, dialog_id+button_name, button_name, button_label, jQuery_actioner(same, jqscript(jq_form_submit_and_close(dialog_id, form_id, if create then hkc_create_row else hkc_update_row, [("table_name", table_name), ("sub_dialog", sub_dialog)], after_close_cb)))))), | |
| 1282 | + html(jquery_button(jQuery_button(button, dialog_id+"cancel", "cancel", _T("CANCEL"), jQuery_actioner(same, jqscript("$('#"+dialog_id+"').dialog('close')"))))), | |
| 1286 | 1283 | |
| 1287 | 1284 | ]) |
| 1288 | 1285 | ], |
| ... | ... | @@ -1303,10 +1300,10 @@ public define HTML_Partial_Content |
| 1303 | 1300 | // } |
| 1304 | 1301 | // //text("Foreign Key from table ["+fk_table_name+"] columns ["+fk_col_name+"] view to use ["+list_view_name+"]") |
| 1305 | 1302 | // ,list_tabs) |
| 1306 | - )) | |
| 1303 | + ) | |
| 1307 | 1304 | . |
| 1308 | 1305 | |
| 1309 | -public define Maybe(HTML_Partial_Content) | |
| 1306 | +public define Maybe(HTML) | |
| 1310 | 1307 | edit_table_content |
| 1311 | 1308 | ( |
| 1312 | 1309 | SQLite3DataBase db, |
| ... | ... | @@ -1335,7 +1332,7 @@ public define Maybe(HTML_Partial_Content) |
| 1335 | 1332 | } |
| 1336 | 1333 | }. |
| 1337 | 1334 | |
| 1338 | -public define Maybe(HTML_Partial_Content) | |
| 1335 | +public define Maybe(HTML) | |
| 1339 | 1336 | edit_table_content |
| 1340 | 1337 | ( |
| 1341 | 1338 | SQLite3DataBase db, | ... | ... |