<%#
 Copyright 2008 Steven Barth <steven@midlink.org>
 Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
 Licensed to the public under the Apache License 2.0.
-%>

<div class="clear"></div>
</div>
</div>
<%
-- check new theme can be supported
local board = luci.util.ubus("system", "board")
local unsupportlist = {"WR703N"}
local tsupport = true
for i, dev in pairs(unsupportlist) do
	if string.find(board.model, dev) then
		tsupport = false
		break
	end
end
if tsupport then
%>
<script type="text/javascript">//<![CDATA[
    function settheme()
    {
        XHR.get('<%=luci.dispatcher.build_url("rpc", "settheme")%>',
			{ theme: "avalon" },
            function(x, resp)
            {
				if (resp.ret == '0')
				{
					window.location = '<%=luci.dispatcher.build_url("avalon", "page", "index")%>';
				}
            }
        );
    }
//]]></script>
<% end %>

<p class="luci">
	<% local ver = require "luci.version" -%>
	Powered by <%= ver.luciname %> (<%= ver.luciversion %>)
</p>
<% if tsupport then %>
<p><a href="#" onclick="settheme()">Change Theme</a></p>
<% end %>
</body>
</html>
