contact.htm 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. <%+header%>
  8. <%
  9. local uci = require "luci.model.uci".cursor()
  10. local contact = uci:get_all("freifunk", "contact")
  11. local nickname, name, mail, phone, location, note
  12. local lon = uci:get_first("system", "system", "longitude")
  13. local lat = uci:get_first("system", "system", "latitude")
  14. if not contact then
  15. nickname, name, homepage, mail, phone, location, note = ""
  16. else
  17. nickname = contact.nickname or ""
  18. name = contact.name or ""
  19. homepage = contact.homepage or {}
  20. mail = contact.mail or ""
  21. phone = contact.phone or ""
  22. location = uci:get_first("system", "system", "location") or contact.location
  23. note = contact.note or ""
  24. end
  25. %>
  26. <h2 name="content"><%:Contact%></h2>
  27. <fieldset xmlns="http://www.w3.org/1999/xhtml" class="cbi-section">
  28. <legend><%:Operator%></legend>
  29. <table cellspacing="10" width="100%" style="text-align:left">
  30. <tr><th width="33%"><%:Nickname%>:</th><td><%=nickname%></td></tr>
  31. <tr><th width="33%"><%:Realname%>:</th><td><%=name%></td></tr>
  32. <tr><th width="33%"><%:Homepage%>:</th><td>
  33. <% for k, v in ipairs(homepage) do %>
  34. <a href="<%=v%>"><%=v%></a><br />
  35. <% end %>
  36. </td></tr>
  37. <tr><th width="33%"><%:E-Mail%>:</th><td><a href="mailto:<%=mail%>"><%=mail%></a></td></tr>
  38. <tr><th width="33%"><%:Phone%>:</th><td><%=phone%></td></tr>
  39. </table>
  40. </fieldset>
  41. <fieldset xmlns="http://www.w3.org/1999/xhtml" class="cbi-section">
  42. <legend><%:Location%></legend>
  43. <table cellspacing="10" width="100%" style="text-align:left">
  44. <tr><th width="33%"><%:Location%>:</th><td><%=location%></td></tr>
  45. <tr><th width="33%"><%:Coordinates%>:</th><td><%=lat%> <%=lon%> (<a href="<%=pcdata(luci.dispatcher.build_url("freifunk/map"))%>"><%:Show on map%>)</a></td></tr>
  46. </table>
  47. </fieldset>
  48. <% if note then %>
  49. <fieldset xmlns="http://www.w3.org/1999/xhtml" class="cbi-section">
  50. <legend><%:Notice%></legend>
  51. <table cellspacing="10" width="100%" style="text-align:left">
  52. <tr><td><%=note%></td></tr>
  53. </table>
  54. </fieldset>
  55. <%end%>
  56. <%+footer%>