From b8aa617256796f9854109429d4478be4c52bbfe9 Mon Sep 17 00:00:00 2001 From: totoro Date: Sat, 6 May 2017 09:24:55 +0900 Subject: [PATCH] add the number of record in show apps --- view/view_apps_renderer.anubis | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/view/view_apps_renderer.anubis b/view/view_apps_renderer.anubis index a066423..f0288d2 100644 --- a/view/view_apps_renderer.anubis +++ b/view/view_apps_renderer.anubis @@ -8,7 +8,7 @@ read hayamiki_lib/types/hayamiki.anubis read hayamiki_lib/view/web_action.anubis - +read hayamiki_lib/controller/hk_sql_utils.anubis read calexium_lib/web/CXM_making_a_web_site.anubis read calexium_lib/web/jQuery/CXM_jquery_dialog.anubis @@ -20,11 +20,12 @@ read calexium_lib/web/widgets/button.anubis define List(HTML_Row(HTML_Off_Form)) generate_apps ( + SQLite3DataBase db, 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 + [ (HTML_Row(HTML_Off_Form))row([core_attrs([class("hk_app_title")])],cell([columns(5)],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) @@ -34,9 +35,17 @@ define List(HTML_Row(HTML_Off_Form)) 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, hkc_list_view, [("table_name",table_name)])) + text(_T("ADD")), + ]) + ), + cell( + sequence([ + partial(img_button(icn16_view_list, hkc_list_view, [("table_name",table_name)])), + text(_T("LIST")) ]) - ) + ), + cell(text(_T("RECORDS_COUNT")+" ")), + cell([right], text(get_count(db, table_name))) ]) ,tables) @@ -59,7 +68,7 @@ public define Maybe(HTML_Partial_Content) 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)) + table([class("hk_table_apps")], generate_apps(db, hk_db.apps, _T)) ]) )) . -- libgit2 0.21.4