modules/freifunk: Try to get the location from /etc/config/freifunk if it isn't found...
[project/luci.git] / modules / freifunk / luasrc / view / freifunk / contact.htm
index 12b072c021abef07717bec53825b3d1a7fefd17f..1ebbf69f71054fc13f7681ac38df6ecdbc41fb5f 100644 (file)
@@ -13,15 +13,23 @@ $Id$
 
 -%>
 <%+header%>
-<% local contact = luci.model.uci.cursor():get_all("freifunk", "contact") %>
-<h1><%:contact%></h1>
+
+<% 
+local uci = require "luci.model.uci".cursor()
+local contact = uci:get_all("freifunk", "contact")
+local location = uci:get_first("system", "system", "location") or contact.location
+local lon = uci:get_first("system", "system", "longitude")
+local lat = uci:get_first("system", "system", "latitude")
+%>
+
+<h2><a id="content" name="content"><%:Contact%></a></h2>
 <table cellspacing="0" cellpadding="6">
-       <tr><th><%:nickname%>:</th><td><%=contact.nickname%></td></tr>
-       <tr><th><%:name%>:</th><td><%=contact.name%></td></tr>
-       <tr><th><%:mail%>:</th><td><%=contact.mail%></td></tr>
-       <tr><th><%:phone%>:</th><td><%=contact.phone%></td></tr>
-       <tr><th><%:location%>:</th><td><%=contact.location%></td></tr>
-       <tr><th><%:geocoord%>:</th><td><%=contact.geo%></td></tr>
-       <tr><th><%:note%>:</th><td><%=contact.note%></td></tr>
+       <tr><th><%:Nickname%>:</th><td><%=contact.nickname%></td></tr>
+       <tr><th><%:Realname%>:</th><td><%=contact.name%></td></tr>
+       <tr><th><%:E-Mail%>:</th><td><%=contact.mail%></td></tr>
+       <tr><th><%:Phone%>:</th><td><%=contact.phone%></td></tr>
+       <tr><th><%:Location%>:</th><td><%=location%></td></tr>
+       <tr><th><%:Coordinates%>:</th><td><%=lat%> <%=lon%></td></tr>
+       <tr><th><%:Notice%>:</th><td><%=contact.note%></td></tr>
 </table>
-<%+footer%>
\ No newline at end of file
+<%+footer%>