X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fluci-mod-admin-full%2Fluasrc%2Fview%2Fadmin_uci%2Fchangelog.htm;fp=modules%2Fluci-mod-admin-full%2Fluasrc%2Fview%2Fadmin_uci%2Fchangelog.htm;h=e195befb3e7375916774148c30a48b93c12cb54c;hp=0000000000000000000000000000000000000000;hb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92;hpb=9edd0e46c3f880727738ce8ca6ff1c8b85f99ef4 diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_uci/changelog.htm b/modules/luci-mod-admin-full/luasrc/view/admin_uci/changelog.htm new file mode 100644 index 000000000..e195befb3 --- /dev/null +++ b/modules/luci-mod-admin-full/luasrc/view/admin_uci/changelog.htm @@ -0,0 +1,88 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2010 Jo-Philipp Wich + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +-%> + +<% export("uci_changelog", function(changes) -%> +
+ <%:Legend:%> +
+
  <%:Section added%>
+
  <%:Section removed%>
+
  <%:Option changed%>
+
  <%:Option removed%>
+
+
+
+ +
<% + local util = luci.util + local ret = { } + + for r, tbl in pairs(changes) do + for s, os in pairs(tbl) do + -- section add + if os['.type'] and os['.type'] ~= "" then + ret[#ret+1] = "%s.%s=%s" %{ r, s, os['.type'] } + for o, v in util.kspairs(os) do + if o:sub(1,1) ~= "." then + 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] = "

" + + -- section delete + elseif os['.type'] and os['.type'] == "" then + ret[#ret+1] = "%s.%s
" %{ r, s } + + -- modifications + else + 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 > 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 + end + end + ret[#ret+1] = "

" + end + end + end + + write(table.concat(ret)) + %>
+
+<%- end) %>