Globally convert headline anchors into name attributes.
[project/luci.git] / modules / luci-mod-freifunk / luasrc / view / freifunk / contact.htm
1 <%#
2  Copyright 2008 Steven Barth <steven@midlink.org>
3  Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
4  Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
5  Licensed to the public under the Apache License 2.0.
6 -%>
7
8 <%+header%>
9
10 <% 
11 local uci = require "luci.model.uci".cursor()
12 local contact = uci:get_all("freifunk", "contact")
13 local nickname, name, mail, phone, location, note
14 local lon = uci:get_first("system", "system", "longitude")
15 local lat = uci:get_first("system", "system", "latitude")
16
17 if not contact then
18         nickname, name, homepage, mail, phone, location, note = ""
19 else
20         nickname = contact.nickname or ""
21         name = contact.name or ""
22         homepage = contact.homepage or {}
23         mail = contact.mail or ""
24         phone = contact.phone or ""
25         location = uci:get_first("system", "system", "location") or contact.location
26         note = contact.note or ""
27 end
28 %>
29
30 <h2 name="content"><%:Contact%></h2>
31
32 <fieldset xmlns="http://www.w3.org/1999/xhtml" class="cbi-section">
33 <legend><%:Operator%></legend>
34         <table cellspacing="10" width="100%" style="text-align:left">
35                 <tr><th width="33%"><%:Nickname%>:</th><td><%=nickname%></td></tr>
36                 <tr><th width="33%"><%:Realname%>:</th><td><%=name%></td></tr>
37                 <tr><th width="33%"><%:Homepage%>:</th><td>
38                         <% for k, v in ipairs(homepage) do %>
39                         <a href="<%=v%>"><%=v%></a><br />
40                         <% end %>
41                 </td></tr>
42                 <tr><th width="33%"><%:E-Mail%>:</th><td><a href="mailto:<%=mail%>"><%=mail%></a></td></tr>
43                 <tr><th width="33%"><%:Phone%>:</th><td><%=phone%></td></tr>
44         </table>
45 </fieldset>
46
47 <fieldset xmlns="http://www.w3.org/1999/xhtml" class="cbi-section">
48 <legend><%:Location%></legend>
49         <table cellspacing="10" width="100%" style="text-align:left">
50                 <tr><th width="33%"><%:Location%>:</th><td><%=location%></td></tr>
51                 <tr><th width="33%"><%:Coordinates%>:</th><td><%=lat%> <%=lon%> (<a href="<%=pcdata(luci.dispatcher.build_url("freifunk/map"))%>"><%:Show on map%>)</a></td></tr>
52         </table>
53 </fieldset>
54
55 <% if note then %>
56 <fieldset xmlns="http://www.w3.org/1999/xhtml" class="cbi-section">
57 <legend><%:Notice%></legend>
58         <table cellspacing="10" width="100%" style="text-align:left">
59                 <tr><td><%=note%></td></tr>
60         </table>
61 </fieldset>
62 <%end%>
63
64 <%+footer%>