X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fadmin-full%2Fluasrc%2Fview%2Fadmin_uci%2Fchangelog.htm;fp=modules%2Fadmin-full%2Fluasrc%2Fview%2Fadmin_uci%2Fchangelog.htm;h=13bbdffcb47b0ab622312d3ae54f6ef0dd8421cc;hp=0000000000000000000000000000000000000000;hb=670648ad214ed26e74b25801e04f1430662de470;hpb=79674ec6ab2cd034f33c3ffffc2cae3a94631928 diff --git a/modules/admin-full/luasrc/view/admin_uci/changelog.htm b/modules/admin-full/luasrc/view/admin_uci/changelog.htm new file mode 100644 index 000000000..13bbdffcb --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_uci/changelog.htm @@ -0,0 +1,67 @@ +<%# +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 + ret[#ret+1] = "
%s.%s.%s=%s" %{ r, s, o, util.pcdata(v) } + 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 ~= "" then + ret[#ret+1] = "%s.%s.%s=%s
" %{ r, s, o, util.pcdata(v) } + else + ret[#ret+1] = "%s.%s.%s
" %{ r, s, o } + end + end + end + ret[#ret+1] = "

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