NevowServer : Added minimalist css style customization and a link to go to settings page and back
authordporopat <denis.poropat@smarteh.si>
Tue, 14 Aug 2018 11:14:20 +0200
changeset 2266 ed415982a9aa
parent 2226 addb6eff8d94
child 2267 e83aa36b6627
NevowServer : Added minimalist css style customization and a link to go to settings page and back
runtime/NevowServer.py
runtime/webinterface.css
runtime_files.list
--- a/runtime/NevowServer.py	Fri Jul 20 11:10:42 2018 +0200
+++ b/runtime/NevowServer.py	Tue Aug 14 11:14:20 2018 +0200
@@ -30,6 +30,7 @@
 from zope.interface import implements
 from nevow import appserver, inevow, tags, loaders, athena, url, rend
 from nevow.page import renderer
+from nevow.static import File
 from formless import annotate
 from formless import webform
 from formless import configurable
@@ -76,10 +77,12 @@
 class MainPage(athena.LiveElement):
     jsClass = u"WebInterface.PLC"
     docFactory = loaders.stan(
-        tags.div(render=tags.directive('liveElement'))[
-            tags.div(id='content')[
-                tags.div(render=tags.directive('PLCElement'))]
-        ])
+        tags.invisible[
+            tags.div(render=tags.directive('liveElement'))[
+                tags.div(id='content')[
+                    tags.div(render=tags.directive('PLCElement'))]
+            ],
+            tags.a(href='settings')['Settings']])
 
     def __init__(self, *a, **kw):
         athena.LiveElement.__init__(self, *a, **kw)
@@ -180,6 +183,7 @@
     
     # This makes webform_css url answer some default CSS
     child_webform_css = webform.defaultCSS
+    child_webinterface_css = File(paths.AbsNeighbourFile(__file__, 'webinterface.css'), 'text/css')
 
     implements(ISettings)
 
@@ -189,12 +193,16 @@
                                        tags.title[_("Beremiz Runtime Settings")],
                                        tags.link(rel='stylesheet',
                                                  type='text/css', 
-                                                 href=url.here.child("webform_css"))
+                                                 href=url.here.child("webform_css")),
+                                       tags.link(rel='stylesheet',
+                                                 type='text/css',
+                                                 href=url.here.child("webinterface_css"))
                                    ],
                                    tags.body[ 
+                                       tags.a(href='/')['back'],
                                        tags.h1["Runtime settings:"],
                                        webform.renderForms('staticSettings'),
-                                       tags.h2["Extensions settings:"],
+                                       tags.h1["Extensions settings:"],
                                        webform.renderForms('dynamicSettings'),
                                    ]]])
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/runtime/webinterface.css	Tue Aug 14 11:14:20 2018 +0200
@@ -0,0 +1,6 @@
+
+.freeform-label {
+    float: left;
+    width: 30%;
+}
+
--- a/runtime_files.list	Fri Jul 20 11:10:42 2018 +0200
+++ b/runtime_files.list	Tue Aug 14 11:14:20 2018 +0200
@@ -10,6 +10,7 @@
 runtime/PLCObject.py
 runtime/NevowServer.py
 runtime/webinterface.js
+runtime/webinterface.css
 runtime/__init__.py
 runtime/ServicePublisher.py
 runtime/typemapping.py