From: Jo-Philipp Wich Date: Sat, 12 Nov 2011 14:31:31 +0000 (+0000) Subject: modules/admin-full: prepare uci changelog template for revised libuci-lua changelog... X-Git-Tag: 0.11.0~1374 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=52f6514541d6d6efa32b4eaf75f97a9d61b76db2 modules/admin-full: prepare uci changelog template for revised libuci-lua changelog format to properly expose add_list operations --- diff --git a/modules/admin-full/luasrc/view/admin_uci/changelog.htm b/modules/admin-full/luasrc/view/admin_uci/changelog.htm index 43f7bd196..e195befb3 100644 --- a/modules/admin-full/luasrc/view/admin_uci/changelog.htm +++ b/modules/admin-full/luasrc/view/admin_uci/changelog.htm @@ -35,7 +35,16 @@ $Id$ ret[#ret+1] = "%s.%s=%s" %{ r, s, os['.type'] } for o, v in util.kspairs(os) do if o:sub(1,1) ~= "." then - ret[#ret+1] = "
%s.%s.%s=%s" %{ r, s, o, util.pcdata(v) } + if type(v) == "table" then + local i + for i = 1, #v do + ret[#ret+1] = "
%s.%s.%s+=%s" + %{ r, s, o, util.pcdata(v[i]) } + end + else + ret[#ret+1] = "
%s.%s.%s=%s" + %{ r, s, o, util.pcdata(v) } + end end end ret[#ret+1] = "

" @@ -49,8 +58,20 @@ $Id$ ret[#ret+1] = "%s.%s
" %{ r, s } for o, v in util.kspairs(os) do if o:sub(1,1) ~= "." then - if v and v ~= "" then - ret[#ret+1] = "%s.%s.%s=%s
" %{ r, s, o, util.pcdata(v) } + if v and #v > 0 then + ret[#ret+1] = "" + if type(v) == "table" then + local i + for i = 1, #v do + ret[#ret+1] = "%s.%s.%s+=%s
" + %{ r, s, o, util.pcdata(v[i]) } + end + + else + ret[#ret+1] = "%s.%s.%s=%s
" + %{ r, s, o, util.pcdata(v) } + end + ret[#ret+1] = "
" else ret[#ret+1] = "%s.%s.%s
" %{ r, s, o } end