[Checkins] SVN: grokui.admin/branches/fancy-layout/src/grokui/admin/ Worked on the integration of the namespace.

Souheil CHELFOUH souheil at chelfouh.com
Fri Oct 9 08:00:42 EDT 2009


Log message for revision 104963:
  Worked on the integration of the namespace.
  This is still hacky. We need to fix the tests.
  

Changed:
  U   grokui.admin/branches/fancy-layout/src/grokui/admin/applications.py
  U   grokui.admin/branches/fancy-layout/src/grokui/admin/templates/applications.pt

-=-
Modified: grokui.admin/branches/fancy-layout/src/grokui/admin/applications.py
===================================================================
--- grokui.admin/branches/fancy-layout/src/grokui/admin/applications.py	2009-10-09 11:05:58 UTC (rev 104962)
+++ grokui.admin/branches/fancy-layout/src/grokui/admin/applications.py	2009-10-09 12:00:41 UTC (rev 104963)
@@ -4,6 +4,7 @@
 from zope.contentprovider.interfaces import IContentProvider
 from zope.component import getMultiAdapter, getAllUtilitiesRegisteredFor
 from grokui.base.layout import AdminView
+from grokui.base.namespace import GrokUILayer
 from grokui.base.contentproviders import ApplicationInformation
 from grokui.base.interfaces import IInstallableApplication, \
                                    IInstalledApplication, \
@@ -17,10 +18,10 @@
     """
     """
     grok.implements(IInstalledApplication)
-    
+   
     def __init__(self, obj, request):
         self.__name__ = obj.__name__
-        self.url = absoluteURL(obj, request)
+        self.url = absoluteURL(obj, request).replace('/++grokui++', '')
         self.description = obj.__doc__
         self.__parent__ = obj.__parent__
         self.classname = ".".join((obj.__class__.__module__,
@@ -43,8 +44,6 @@
 
 
 class InstallableApplication(object):
-    """
-    """
     grok.implements(IInstallableApplication)
     
     def __init__(self, klass):
@@ -69,16 +68,12 @@
 class Applications(AdminView):
     """View for application management.
     """
+    grok.layer(GrokUILayer)
     grok.name('applications')
     grok.title('Applications')
     grok.require('grok.ManageApplications')
 
-
     def update(self):
-        # URL of the context
-        self.url = getMultiAdapter((self.context, self.request),
-                                   name="absolute_url")
-
         # Available apps...
         apps = getAllUtilitiesRegisteredFor(grok.interfaces.IApplication)
         self.installable = (InstallableApplication(x) for x in apps)

Modified: grokui.admin/branches/fancy-layout/src/grokui/admin/templates/applications.pt
===================================================================
--- grokui.admin/branches/fancy-layout/src/grokui/admin/templates/applications.pt	2009-10-09 11:05:58 UTC (rev 104962)
+++ grokui.admin/branches/fancy-layout/src/grokui/admin/templates/applications.pt	2009-10-09 12:00:41 UTC (rev 104963)
@@ -1,79 +1,76 @@
-<form tal:define="apps context/values"
-      tal:attributes="action string:${view/url}/manageapps">
+<div id="applications-panel" tal:define="root context/@@absolute_url">
+  <form tal:attributes="action string:$root/manageapps">
+    <fieldset>
+      <legend>Installed applications</legend>
 
-  <fieldset>
-    <legend>Installed applications</legend>
+      <div tal:condition="not: view/installed">
+	<p class="menu-description1">
+	  Currently no working applications are installed.
+	</p>
+      </div>
 
-    <div tal:condition="not: view/installed">
-      <p class="menu-description1">
-	Currently no working applications are installed.
-      </p>
-    </div>
+      <div tal:condition="view/installed" 
+	   tal:repeat="app view/installed">
+	<input type="checkbox" 
+	       class="checkbox" 
+	       tal:attributes="value app/__name__;
+			       name string:items" />
+	<a tal:attributes="href app/url">
+	  <span tal:replace="app/__name__"/>
+	</a>
+	(<span tal:replace="app/classname"/>)
+	<div tal:content="app/@@info" />
+      </div>
 
-    <div tal:condition="view/installed" 
-	 tal:repeat="app view/installed">
-      <input type="checkbox" 
-	     class="checkbox" 
-	     tal:attributes="value app/__name__;
-			     name string:items" />
-      <a tal:attributes="href app/url">
-	<span tal:replace="app/__name__"/>
-      </a>
-      (<span tal:replace="app/classname"/>)
-      <div tal:content="app/@@info" />
-    </div>
+      <div tal:condition="view/broken">
+	<br/><div class="emph">Broken applications:</div>
+      </div>
+      <div tal:repeat="app view/broken">
+	<input type="checkbox" 
+	       class="checkbox" 
+	       tal:attributes="value app/__name__;
+			       name string:items" />
+	<span tal:content="app/__name__" />
+	(broken type: <span tal:replace="app/classname"/>).
+	This application is broken!
+      </div>
 
-    <div tal:condition="view/broken">
-      <br/><div class="emph">Broken applications:</div>
-    </div>
-    <div tal:repeat="app view/broken">
-      <input type="checkbox" 
-	     class="checkbox" 
-	     tal:attributes="value app/__name__;
-			     name string:items" />
-      <span tal:content="app/__name__" />
-      (broken type: <span tal:replace="app/classname"/>).
-      This application is broken!
-    </div>
+      <p>
+	<input tal:condition="view/has_apps"
+	       class="button" type="submit" name="delete" 
+	       id="form.actions.delete"
+	       value="Delete Selected"/>
+	<input tal:condition="view/installed"
+	       class="button" type="submit" name="rename"
+	       value="Rename"/>
+      </p>
+    </fieldset>
+  </form>
 
-    <p>
-      <input tal:condition="view/has_apps"
-	     class="button" type="submit" name="delete" 
-	     id="form.actions.delete"
-	     value="Delete Selected"/>
-      <input tal:condition="view/installed"
-	     class="button" type="submit" name="rename"
-	     value="Rename"/>
-    </p>
-  </fieldset>
-</form>
+  <fieldset>	
+    <legend>Add application</legend>
 
-<fieldset>	
-  <legend>Add application</legend>
-
-  <div class="menu-box1"
-       tal:repeat="app view/installable">
-    <form action=""
-	  tal:attributes="action string:${view/url}/add;
-			  name app/__name__">
-      <div class="menu-box2">
-	<div class="menu-head1">
-	  <h3 tal:content="app/__name__">Application Name</h3>
+    <div class="menu-box1" tal:repeat="app view/installable">
+      <form action="" tal:attributes="action string:${root}/add;">
+	<div class="menu-box2">
+	  <div class="menu-head1">
+	    <h3 tal:content="app/__name__">Application Name</h3>
+	  </div>
+	  <div class="menu-description1">
+	    <p tal:replace="structure app/description">
+	      Application description here.
+	    </p>
+	  </div>
+	  <div tal:content="app/@@info" />
+	  <div class="menu-box3">
+	    <label>Name your new app: <input type="text" name="name"/></label>
+	    <input type="hidden" name="application" value=""
+		   tal:attributes="value app/classname" />
+	    <input class="button" type="submit" name="Add" value="Create"/>
+	  </div>
 	</div>
-	<div class="menu-description1">
-	  <p tal:replace="structure app/description">
-	    Application description here.
-	  </p>
-	</div>
-	<div tal:content="app/@@info" />
-	<div class="menu-box3">
-	  <label>Name your new app: <input type="text" name="name"/></label>
-	  <input type="hidden" name="application" value=""
-		 tal:attributes="value app/classname" />
-	  <input class="button" type="submit" name="Add" value="Create"/>
-	</div>
-      </div>
-    </form>
-  </div>
+      </form>
+    </div>
 
-</fieldset>
+  </fieldset>
+</div>



More information about the checkins mailing list