modules/freifunk: Add homepage(s) field to contact information
authorManuel Munz <freifunk@somakoma.de>
Wed, 9 Jan 2013 11:22:15 +0000 (11:22 +0000)
committerManuel Munz <freifunk@somakoma.de>
Wed, 9 Jan 2013 11:22:15 +0000 (11:22 +0000)
modules/freifunk/luasrc/model/cbi/freifunk/contact.lua
modules/freifunk/luasrc/view/freifunk/contact.htm

index f6cdec7fe128a8fb06dd728cb04df07ac726373b..30e94a3e96d455ddbc5544db7905a662ef36e401 100644 (file)
@@ -17,6 +17,7 @@ c = m:section(NamedSection, "contact", "public", "")
 
 c:option(Value, "nickname", translate("Nickname"))
 c:option(Value, "name", translate("Realname"))
+c:option(DynamicList, "homepage", translate("Homepage"))
 c:option(Value, "mail", translate("E-Mail"))
 c:option(Value, "phone", translate("Phone"))
 c:option(TextValue, "note", translate("Notice")).rows = 10
index 23a5e7b1af0c0eb1b538a4bfbfa7bcc889b128c3..2d79ccd40616788dc099e5cc8c5071ba92ee6e0b 100644 (file)
@@ -21,10 +21,11 @@ local lon = uci:get_first("system", "system", "longitude")
 local lat = uci:get_first("system", "system", "latitude")
 
 if not contact then
-       nickname, name, mail, phone, location, note = ""
+       nickname, name, homepage, mail, phone, location, note = ""
 else
        nickname = contact.nickname or ""
        name = contact.name or ""
+       homepage = contact.homepage or {}
        mail = contact.mail or ""
        phone = contact.phone or ""
        location = uci:get_first("system", "system", "location") or contact.location
@@ -39,6 +40,11 @@ end
        <table cellspacing="10" width="100%" style="text-align:left">
                <tr><th width="33%"><%:Nickname%>:</th><td><%=nickname%></td></tr>
                <tr><th width="33%"><%:Realname%>:</th><td><%=name%></td></tr>
+               <tr><th width="33%"><%:Homepage%>:</th><td>
+                       <% for k, v in ipairs(homepage) do %>
+                       <a href="<%=v%>"><%=v%></a><br />
+                       <% end %>
+               </td></tr>
                <tr><th width="33%"><%:E-Mail%>:</th><td><a href="mailto:<%=mail%>"><%=mail%></a></td></tr>
                <tr><th width="33%"><%:Phone%>:</th><td><%=phone%></td></tr>
        </table>