view_apps_renderer.anubis
2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Created by PyramIDE.
* User: フランスのトトロ aka (David RENÉ)
* Date: 11/03/2017
* Time: 19:12
* © Calexium
*/
read hayamiki_lib/types/hayamiki.anubis
read hayamiki_lib/view/web_action.anubis
read calexium_lib/web/CXM_making_a_web_site.anubis
read calexium_lib/web/jQuery/CXM_jquery_dialog.anubis
read calexium_lib/web/jQuery/CXM_jquery_button.anubis
read calexium_lib/web/jQuery/ui-addon/datetimepicker.anubis
read calexium_lib/web/widgets/button.anubis
define List(HTML_Row(HTML_Off_Form))
generate_apps
(
List(HK_App) apps,
(String) -> String _T,
)=
map_append((HK_App app) |-> since app is hk_app(app_name, icon, help, tables),
[ (HTML_Row(HTML_Off_Form))row([core_attrs([class("hk_app_title")])],cell([columns(2)],text(app_name)))]+ //APP name line
//here map for each table
map((HK_Table table) |-> since table is hk_table(_table_name, short_name, model, display),
//construct the real name of the table (app + table_name)
with table_name = if length(app_name) > 0 then app_name +"_"+_table_name else _table_name,
(HTML_Row(HTML_Off_Form))row([core_attrs([class("hk_table_line")])],
[ cell(text(_table_name)),
cell(
sequence([
partial(img_button(icn16_add, [event(onclick, jq_dialog_open(dialog_id("edit_table_dlg_ajax"), "'table_name="+table_name+"'"))], "", [])),
partial(img_button(icn16_view_list, view_table, [("table_name",table_name)]))
])
)
])
,tables)
,apps
)
.
public define Maybe(HTML_Partial_Content)
show_apps_content
(
SQLite3DataBase db,
HK_Database hk_db,
(String) -> String _T,
String lang,
String web_site_directory
) =
success(partial_content([css(css_file("hayamiki/hayamiki.css")),]+
jq_dialog_init + jq_datetimepicker_init(lang),
sequence([
partial(jq_dialog_create(dialog_id("edit_table_dlg_ajax"), ajax(controller_action("hk_c", "ajax_edit_table")))), /*&table_name="+rows.table_name*/
table([class("hk_table_apps")], generate_apps(hk_db.apps, _T))
])
))
.