summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-freifunk/luasrc/view/freifunk/contact.htm
blob: dca35376cb23eba141952075e3ec8232ee9f86f5 (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
58
59
60
61
62
63
64
<%#
 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 contact = uci:get_all("freifunk", "contact")
local nickname, name, mail, phone, location, note
local lon = uci:get_first("system", "system", "longitude")
local lat = uci:get_first("system", "system", "latitude")

if not contact then
	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
	note = contact.note or ""
end
%>

<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%>