applications: add freifunk widgets app to customize the index page
[project/luci.git] / applications / luci-freifunk-widgets / luasrc / view / freifunk / widgets / html / main.htm
1 <%
2 --local utl = require "luci.util"
3 local fs = require "luci.fs"
4 local title = data.title
5 local file = "/usr/share/customtext/" .. name .. ".html"
6 local text = fs.readfile(file)
7 local width = data.width or "100%"
8 local pr = data.paddingright or "0"
9 if type(width) == "number" then
10 width = width .. "px"
11 end
12
13 %>
14
15 <div id="<%=name%>" style="width:<%=width%>;float:left">
16 <div style="padding-right: <%=pr%>">
17 <% if title then %>
18 <h2><%=title%></h2>
19 <% end %>
20 <% if text then %>
21 <%=text%>
22 <%else%>
23 <%:Could not load the custom text from%> "<%=file%>!"
24 <%end%>
25
26 <%=data.text%>
27 </div>
28 </div>