[Checkins] SVN: grokui.admin/branches/fancy-layout/src/grokui/admin/ Worked on the templates and views

Souheil CHELFOUH souheil at chelfouh.com
Fri Sep 18 12:08:50 EDT 2009


Log message for revision 104354:
  Worked on the templates and views
  

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

-=-
Modified: grokui.admin/branches/fancy-layout/src/grokui/admin/applications.py
===================================================================
--- grokui.admin/branches/fancy-layout/src/grokui/admin/applications.py	2009-09-18 16:08:09 UTC (rev 104353)
+++ grokui.admin/branches/fancy-layout/src/grokui/admin/applications.py	2009-09-18 16:08:49 UTC (rev 104354)
@@ -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.contentproviders import ApplicationInformation
 from grokui.base.interfaces import IInstallableApplication, \
                                    IInstalledApplication, \
                                    IApplicationRepresentation
@@ -74,6 +75,10 @@
 
 
     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-09-18 16:08:09 UTC (rev 104353)
+++ grokui.admin/branches/fancy-layout/src/grokui/admin/templates/applications.pt	2009-09-18 16:08:49 UTC (rev 104354)
@@ -1,5 +1,5 @@
 <form tal:define="apps context/values"
-      tal:attributes="action string:${context/@@absolute_url}/manageapps">
+      tal:attributes="action string:${view/url}/manageapps">
 
   <fieldset>
     <legend>Installed applications</legend>
@@ -20,6 +20,7 @@
 	<span tal:replace="app/__name__"/>
       </a>
       (<span tal:replace="app/classname"/>)
+      <div tal:content="app/@@info" />
     </div>
 
     <div tal:condition="view/broken">
@@ -53,7 +54,7 @@
   <div class="menu-box1"
        tal:repeat="app view/installable">
     <form action=""
-	  tal:attributes="action string:${context/@@absolute_url}/add;
+	  tal:attributes="action string:${view/url}/add;
 			  name app/__name__">
       <div class="menu-box2">
 	<div class="menu-head1">
@@ -64,7 +65,7 @@
 	    Application description here.
 	  </p>
 	</div>
-	<div tal:replace="app/@@info" />
+	<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=""

Modified: grokui.admin/branches/fancy-layout/src/grokui/admin/view.py
===================================================================
--- grokui.admin/branches/fancy-layout/src/grokui/admin/view.py	2009-09-18 16:08:09 UTC (rev 104353)
+++ grokui.admin/branches/fancy-layout/src/grokui/admin/view.py	2009-09-18 16:08:49 UTC (rev 104354)
@@ -181,7 +181,7 @@
                 msg = (u'%sBroken application `%s` was successfully '
                        u'deleted.\n' % (msg, name))
 
-        flash(msg)
+        self.flash(msg)
         self.redirect(self.url(self.context))
 
     def render(self, rename=None, delete=None, items=None):
@@ -230,15 +230,15 @@
             if oldname == newname:
                 continue
             if oldname not in self.context.keys():
-                flash('Could not rename %s: not found' % oldname)
+                self.flash('Could not rename %s: not found' % oldname)
                 continue
             if newname in self.context.keys():
-                flash('`%s` already exists.' % newname)
+                self.flash('`%s` already exists.' % newname)
                 continue
             self.context[newname] = self.context[oldname]
             self.context[newname].__name__ = newname
             del self.context[oldname]
-            flash('Renamed `%s` to `%s`.' % (oldname, newname))
+            self.flash('Renamed `%s` to `%s`.' % (oldname, newname))
         self.redirect(self.url(self.context))
         return
 



More information about the checkins mailing list