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