From: Steven Barth Date: Wed, 16 Apr 2008 09:32:43 +0000 (+0000) Subject: * Reintroduced public pages X-Git-Tag: 0.8.0~1123 X-Git-Url: http://git.archive.openwrt.org/?a=commitdiff_plain;h=69bc3fad1f0a49427a06cec47fe6a2b8b07969b8;p=project%2Fluci.git * Reintroduced public pages * Automatically replace nil template values with '' --- diff --git a/contrib/package/ffluci/Makefile b/contrib/package/ffluci/Makefile index 2230145fb..67f83d0db 100644 --- a/contrib/package/ffluci/Makefile +++ b/contrib/package/ffluci/Makefile @@ -45,7 +45,7 @@ define Package/ffluci/install $(INSTALL_DIR) $(1)/sbin $(CP) $(PKG_BUILD_DIR)/core/dist/* $(1)/usr/lib/lua/ -R - $(CP) $(PKG_BUILD_DIR)/core/contrib/uci/luci $(1)/etc/config/luci + $(CP) $(PKG_BUILD_DIR)/core/contrib/uci/* $(1)/etc/config/luci $(INSTALL_BIN) $(PKG_BUILD_DIR)/core/contrib/ffluci $(1)/www/cgi-bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/core/contrib/ffluci-upload $(1)/www/cgi-bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/core/contrib/index.cgi $(1)/www/cgi-bin diff --git a/core/contrib/uci/freifunk b/core/contrib/uci/freifunk new file mode 100644 index 000000000..128267d04 --- /dev/null +++ b/core/contrib/uci/freifunk @@ -0,0 +1,16 @@ +config public contact + option nickname + option name + option mail + option phone + option location + option geo + option note + +config public community + option name "Freifunk Halle" + option homepage http://halle.freifunk.net + option essid halle.freifunk.net + option bssid 02:CA:FF:EE:BA:BE + option realm netz.freifunk-halle.net + option pool 104.62.0.0/16 \ No newline at end of file diff --git a/core/contrib/uci/luci b/core/contrib/uci/luci index e54d74717..7cc08215a 100644 --- a/core/contrib/uci/luci +++ b/core/contrib/uci/luci @@ -6,22 +6,13 @@ config core category_privileges option public nobody:nogroup config extern flash_keep - option uci "/etc/config" + option uci "/etc/config" option dropbear "/etc/dropbear" - option openvpn "/etc/openvpn" - option passwd "/etc/passwd" - option ipkg "/etc/ipkg.conf" - option httpd "/etc/httpd.conf" - option firewall "/etc/firewall.user" - -config public contact - option nickname - option name - option mail - option phone - option location - option geo - option note + option openvpn "/etc/openvpn" + option passwd "/etc/passwd" + option ipkg "/etc/ipkg.conf" + option httpd "/etc/httpd.conf" + option firewall "/etc/firewall.user" config event uci_oncommit option network "/etc/init.d/network restart" diff --git a/core/src/ffluci/template.lua b/core/src/ffluci/template.lua index 502013684..797e9d127 100644 --- a/core/src/ffluci/template.lua +++ b/core/src/ffluci/template.lua @@ -95,7 +95,7 @@ function compile(template) local r_include = "')\ninclude('%s')\nwrite('" local r_i18n = "'..translate('%1','%2')..'" local r_uci = "'..config('%1','%2','%3')..'" - local r_pexec = "'..%s..'" + local r_pexec = "'..(%s or '')..'" local r_exec = "')\n%s\nwrite('" -- Parse the expressions diff --git a/core/src/ffluci/view/cbi/dvalue.htm b/core/src/ffluci/view/cbi/dvalue.htm index 178f2e16a..f54667def 100644 --- a/core/src/ffluci/view/cbi/dvalue.htm +++ b/core/src/ffluci/view/cbi/dvalue.htm @@ -6,7 +6,7 @@ <%=self.value%> <% end else %> - <%=(self:cfgvalue(section) or "")%> + <%=self:cfgvalue(section)%> <% end %>   <%+cbi/valuefooter%> diff --git a/core/src/ffluci/view/cbi/value.htm b/core/src/ffluci/view/cbi/value.htm index 61033a0f5..31bf38f77 100644 --- a/core/src/ffluci/view/cbi/value.htm +++ b/core/src/ffluci/view/cbi/value.htm @@ -1,3 +1,3 @@ <%+cbi/valueheader%> - size="<%=self.size%>" <% end %><% if self.maxlength then %>maxlength="<%=self.maxlength%>" <% end %>name="cbid.<%=self.config.."."..section.."."..self.option%>" id="cbid.<%=self.config.."."..section.."."..self.option%>" value="<%=(self:cfgvalue(section) or "")%>" /> + size="<%=self.size%>" <% end %><% if self.maxlength then %>maxlength="<%=self.maxlength%>" <% end %>name="cbid.<%=self.config.."."..section.."."..self.option%>" id="cbid.<%=self.config.."."..section.."."..self.option%>" value="<%=self:cfgvalue(section)%>" /> <%+cbi/valuefooter%> diff --git a/module/admin-core/src/model/cbi/admin_index/contact.lua b/module/admin-core/src/model/cbi/admin_index/contact.lua index 187db9f3c..ecb4bedd7 100644 --- a/module/admin-core/src/model/cbi/admin_index/contact.lua +++ b/module/admin-core/src/model/cbi/admin_index/contact.lua @@ -1,5 +1,5 @@ -- Todo: Translate -m = Map("luci", translate("contact", "Kontakt"), translate("contact1", [[Diese Daten sind +m = Map("freifunk", translate("contact", "Kontakt"), translate("contact1", [[Diese Daten sind auf der öffentlichen Kontaktseite sichtbar. Bitte gib an, wie man dich am besten kontaktieren kann. Diese Informationen sollten nach der Picopeering Vereinbarung mindestens deine E-Mail-Adresse enthalten. Damit dein Knoten durch Topographieprogramme erfasst werden kann, gib bitte deine Geokoordinaten oder diff --git a/module/admin-core/src/view/admin_system/editor.htm b/module/admin-core/src/view/admin_system/editor.htm index 0215c91df..ef3e0d8ab 100644 --- a/module/admin-core/src/view/admin_system/editor.htm +++ b/module/admin-core/src/view/admin_system/editor.htm @@ -1,10 +1,10 @@ <%+header%>

<%:texteditor Texteditor%>

-
<%:file Datei%>: +
<%:file Datei%>: <% if msg then %><%:error Fehler%>: <%=msg%><% end %>

-
+

diff --git a/module/admin-core/src/view/admin_system/ipkg.htm b/module/admin-core/src/view/admin_system/ipkg.htm index bbe7f3bc6..c1f6ad0be 100644 --- a/module/admin-core/src/view/admin_system/ipkg.htm +++ b/module/admin-core/src/view/admin_system/ipkg.htm @@ -11,7 +11,7 @@
-
+

diff --git a/module/admin-core/src/view/admin_system/packages.htm b/module/admin-core/src/view/admin_system/packages.htm index d9cdb4dd0..52da37040 100644 --- a/module/admin-core/src/view/admin_system/packages.htm +++ b/module/admin-core/src/view/admin_system/packages.htm @@ -43,7 +43,7 @@
<%:filter Filter%>: - +
@@ -63,10 +63,10 @@ <% for k, pkg in pairs(pkgs) do %> <%=pkg.Package%> - <%=(pkg.Version or '')%> + <%=pkg.Version%> <% if not pkg.Status or not pkg.Status.installed then %><% else %><%:installed installiert%><% end %> <% if pkg.Status and pkg.Status.installed then %><% else %><%:notinstalled nicht installiert%><% end %> - <%=(pkg.Description or '')%> + <%=pkg.Description%> <% end %> diff --git a/module/admin-core/src/view/admin_system/sshkeys.htm b/module/admin-core/src/view/admin_system/sshkeys.htm index 1e1cc24ce..9cf91f998 100644 --- a/module/admin-core/src/view/admin_system/sshkeys.htm +++ b/module/admin-core/src/view/admin_system/sshkeys.htm @@ -11,7 +11,7 @@
-
+

diff --git a/module/public-core/src/view/public_index/contact.htm b/module/public-core/src/view/public_index/contact.htm index ded0a94af..e5aee1906 100644 --- a/module/public-core/src/view/public_index/contact.htm +++ b/module/public-core/src/view/public_index/contact.htm @@ -1,12 +1,13 @@ <%+header%> +<% local contact = ffluci.model.uci.show("freifunk", "contact").freifunk.contact %>

<%:contact Kontakt%>

- - - - - - - + + + + + + +
<%:nickname Pseudonym%>:<%~luci.contact.nickname%>
<%:name Name%>:<%~luci.contact.name%>
<%:mail E-Mail%>:<%~luci.contact.mail%>
<%:phone Telefon%>:<%~luci.contact.phone%>
<%:location Standort%>:<%~luci.contact.location%>
<%:geocoord Geokoordinaten%>:<%~luci.contact.geo%>
<%:note Notiz%>:<%~luci.contact.note%>
<%:nickname Pseudonym%>:<%=contact.nickname%>
<%:name Name%>:<%=contact.name%>
<%:mail E-Mail%>:<%=contact.mail%>
<%:phone Telefon%>:<%=contact.phone%>
<%:location Standort%>:<%=contact.location%>
<%:geocoord Geokoordinaten%>:<%=contact.geo%>
<%:note Notiz%>:<%=contact.note%>
<%+footer%> \ No newline at end of file diff --git a/module/public-core/src/view/public_index/index.htm b/module/public-core/src/view/public_index/index.htm index 1f06e344c..838bf02ee 100644 --- a/module/public-core/src/view/public_index/index.htm +++ b/module/public-core/src/view/public_index/index.htm @@ -1,5 +1,11 @@ <%+header%> -

<%:hello Hallo!%>

-

<%:admin1 Dies ist der Administrationsbereich. %> -

ToDo: Intelligenter Einleitungstext

+<% local ff = ffluci.model.uci.show("freifunk").freifunk %> +

<%:hellonet Hallo und willkommen im Netz von%> <%=ff.community.name%>!

+

<%:public1 Wir sind eine Initiative zur Schaffung eines freien, offenen und unabhängigen Funknetzwerks auf WLAN-Basis.%>
+<%:public2 Dies ist der Zugangspunkt %><%=ffluci.sys.hostname()%>. <%:public3 Er wird betrieben von %> +<%=ff.contact.nickname%>.

+

<%:public4 Weitere Informationen zur globalen Freifunkinitiative findest du unter%> Freifunk.net.
+<%:public5 Hast du Interesse an diesem Projekt, dann wende dich an deine lokale Gemeinschaft%> <%=ff.community.name%>.

+

<%:note Hinweis%>:<%:public6 Der Internetzugang über das experimentelle Freifunknetz ist an technische und organisatorische Bedingungen geknüpft und deshalb möglicherweise +nicht (immer) gewährleistet.%>

<%+footer%> \ No newline at end of file