summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-freifunk/luasrc/view/freifunk/contact.htm
blob: dececeff51dcc9ad8ae75a4957dcdad52f2a9977 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<%#
 Copyright 2008 Steven Barth <steven@midlink.org>
 Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
 Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
 Licensed to the public under the Apache License 2.0.
-%>

<%+header%>

<% 
local uci = require "luci.model.uci".cursor()
local nickname = uci:get("freifunk", "contact", "nickname") or ""
local name = uci:get("freifunk", "contact", "name") or ""
local homepage = uci:get("freifunk", "contact", "homepage") or {}
local mail = uci:get("freifunk", "contact", "mail") or ""
local phone = uci:get("freifunk", "contact", "phone") or ""
local location = uci:get_first("system", "system", "locaton") or uci:get("freifunk", "contact", "location") or ""
local note = uci:get("freifunk", "contact", "note") or ""
local lon = uci:get_first("system", "system", "longitude") or ""
local lat = uci:get_first("system", "system", "latitude") or ""
%>

<h2 name="content"><%:Contact%></h2>

<fieldset xmlns="http://www.w3.org/1999/xhtml" class="cbi-section">
<legend><%:Operator%></legend>
	<div class="table" cellspacing="10" width="100%" style="text-align:left">
		<div class="tr"><div class="th" width="33%"><%:Nickname%>:</div><div class="td"><%=nickname%></div></div>
		<div class="tr"><div class="th" width="33%"><%:Realname%>:</div><div class="td"><%=name%></div></div>
		<div class="tr"><div class="th" width="33%"><%:Homepage%>:</div><div class="td">
			<% for k, v in ipairs(homepage) do %>
			<a href="<%=v%>"><%=v%></a><br />
			<% end %>
		</div></div>
		<div class="tr"><div class="th" width="33%"><%:E-Mail%>:</div><div class="td"><a href="mailto:<%=mail%>"><%=mail%></a></div></div>
		<div class="tr"><div class="th" width="33%"><%:Phone%>:</div><div class="td"><%=phone%></div></div>
	</div>
</fieldset>

<fieldset xmlns="http://www.w3.org/1999/xhtml" class="cbi-section">
<legend><%:Location%></legend>
	<div class="table" cellspacing="10" width="100%" style="text-align:left">
		<div class="tr"><div class="th" width="33%"><%:Location%>:</div><div class="td"><%=location%></div></div>
		<div class="tr"><div class="th" width="33%"><%:Coordinates%>:</div><div class="td"><%=lat%> <%=lon%> (<a href="<%=pcdata(luci.dispatcher.build_url("freifunk/map"))%>"><%:Show on map%>)</a></div></div>
	</div>
</fieldset>

<% if note then %>
<fieldset xmlns="http://www.w3.org/1999/xhtml" class="cbi-section">
<legend><%:Notice%></legend>
	<div class="table" cellspacing="10" width="100%" style="text-align:left">
		<div class="tr"><div class="td"><%=note%></div></div>
	</div>
</fieldset>
<%end%>

<%+footer%>