applications: add freifunk widgets app to customize the index page
[project/luci.git] / applications / luci-freifunk-widgets / luasrc / view / freifunk / widgets / search / main.htm
1 <%
2 local utl = require "luci.util"
3 local title = luci.i18n.translate(data.title or "Search")
4 local width = data.width or "100%"
5
6 if type(width) == "number" then
7         width = width .. "px"
8 end
9 %>
10
11 <div id="<%=name%>" style="width:<%=width%>;float:left">
12         <h2><%=title%></h2>
13         <div id="form_<%=name%>">
14                 <form name="searchform" id="search_<%=name%>" action="<%=luci.dispatcher.build_url('freifunk', 'search_redirect')%>">
15                         <input type="text" name="searchterms" style="margin-bottom:15px; width: 90%"><br />
16                         <%
17                         local checked = " checked"
18                         for k, v in ipairs(data.engine) do
19                                 local e = utl.split(v, "|")
20                                 local name = e[1]
21                                 local url = e[2]
22                                 if name and url then
23                         %>
24                         <input name="engine" type="radio" value="<%=url%>"<%=checked%>> <%=name%><br />
25         <%      end
26                 checked = ""
27         end
28 %>
29                         <input type="submit" name="SearchSubmit" value="Search" style="margin-top: 15px">
30                 </form>
31         </div>
32 </div>