main.htm 966 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <%
  2. --[[
  3. LuCI - Lua Configuration Interface
  4. Copyright 2012 Manuel Munz <freifunk at somakoma dot de>
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. ]]--
  10. --local utl = require "luci.util"
  11. local fs = require "nixio.fs"
  12. local title = data.title
  13. local name = data['.name']
  14. local file = "/usr/share/customtext/" .. name .. ".html"
  15. local text = fs.readfile(file)
  16. local width = data.width or "100%"
  17. local pr = data.paddingright or "0"
  18. if type(width) == "number" then
  19. width = width .. "px"
  20. end
  21. %>
  22. <div id="<%=name%>" style="width:<%=width%>;float:left">
  23. <div style="padding-right: <%=pr%>">
  24. <% if title then %>
  25. <h2><%=title%></h2>
  26. <% end %>
  27. <% if text then %>
  28. <%=text%>
  29. <%else%>
  30. <%:Could not load the custom text from%> "<%=file%>!"
  31. <%end%>
  32. <%=data.text%>
  33. </div>
  34. </div>