Commit b8aa617256796f9854109429d4478be4c52bbfe9

Authored by totoro
1 parent 3948b4f1

add the number of record in show apps

Showing 1 changed file with 14 additions and 5 deletions   Show diff stats
view/view_apps_renderer.anubis
... ... @@ -8,7 +8,7 @@
8 8  
9 9 read hayamiki_lib/types/hayamiki.anubis
10 10 read hayamiki_lib/view/web_action.anubis
11   -
  11 +read hayamiki_lib/controller/hk_sql_utils.anubis
12 12 read calexium_lib/web/CXM_making_a_web_site.anubis
13 13  
14 14 read calexium_lib/web/jQuery/CXM_jquery_dialog.anubis
... ... @@ -20,11 +20,12 @@ read calexium_lib/web/widgets/button.anubis
20 20 define List(HTML_Row(HTML_Off_Form))
21 21 generate_apps
22 22 (
  23 + SQLite3DataBase db,
23 24 List(HK_App) apps,
24 25 (String) -> String _T,
25 26 )=
26 27 map_append((HK_App app) |-> since app is hk_app(app_name, icon, help, tables),
27   - [ (HTML_Row(HTML_Off_Form))row([core_attrs([class("hk_app_title")])],cell([columns(2)],text(app_name)))]+ //APP name line
  28 + [ (HTML_Row(HTML_Off_Form))row([core_attrs([class("hk_app_title")])],cell([columns(5)],text(app_name)))]+ //APP name line
28 29 //here map for each table
29 30 map((HK_Table table) |-> since table is hk_table(_table_name, short_name, model, display),
30 31 //construct the real name of the table (app + table_name)
... ... @@ -34,9 +35,17 @@ define List(HTML_Row(HTML_Off_Form))
34 35 cell(
35 36 sequence([
36 37 partial(img_button(icn16_add, [event(onclick, jq_dialog_open(dialog_id("edit_table_dlg_ajax"), "'table_name="+table_name+"'"))], "", [])),
37   - partial(img_button(icn16_view_list, hkc_list_view, [("table_name",table_name)]))
  38 + text(_T("ADD")),
  39 + ])
  40 + ),
  41 + cell(
  42 + sequence([
  43 + partial(img_button(icn16_view_list, hkc_list_view, [("table_name",table_name)])),
  44 + text(_T("LIST"))
38 45 ])
39   - )
  46 + ),
  47 + cell(text(_T("RECORDS_COUNT")+" ")),
  48 + cell([right], text(get_count(db, table_name)))
40 49 ])
41 50 ,tables)
42 51  
... ... @@ -59,7 +68,7 @@ public define Maybe(HTML_Partial_Content)
59 68 jq_dialog_init + jq_datetimepicker_init(lang),
60 69 sequence([
61 70 partial(jq_dialog_create(dialog_id("edit_table_dlg_ajax"), ajax(controller_action("hk_c", "ajax_edit_table")))), /*&table_name="+rows.table_name*/
62   - table([class("hk_table_apps")], generate_apps(hk_db.apps, _T))
  71 + table([class("hk_table_apps")], generate_apps(db, hk_db.apps, _T))
63 72 ])
64 73 ))
65 74 .
... ...