[KSS-checkins] r43716 - in kukit/KSSPylonsWiki/trunk/kss/pylonswiki: controllers public templates

jvloothuis at codespeak.net jvloothuis at codespeak.net
Sun May 27 14:46:04 CEST 2007


Author: jvloothuis
Date: Sun May 27 14:46:04 2007
New Revision: 43716

Modified:
   kukit/KSSPylonsWiki/trunk/kss/pylonswiki/controllers/ksspage.py
   kukit/KSSPylonsWiki/trunk/kss/pylonswiki/public/wiki.kss
   kukit/KSSPylonsWiki/trunk/kss/pylonswiki/templates/footer.myt
Log:

Made the list page work with KSS


Modified: kukit/KSSPylonsWiki/trunk/kss/pylonswiki/controllers/ksspage.py
==============================================================================
--- kukit/KSSPylonsWiki/trunk/kss/pylonswiki/controllers/ksspage.py	(original)
+++ kukit/KSSPylonsWiki/trunk/kss/pylonswiki/controllers/ksspage.py	Sun May 27 14:46:04 2007
@@ -3,13 +3,6 @@
 from kss.commands.selectors import CSS
 from kss.pylons import render_kss_response
 
-class Command(object):
-    def __init__(self, name, selector='', selector_type='', **parameters):
-        self.name = name
-        self.selector = selector
-        self.selector_type = selector_type
-        self.parameters = parameters
-
 class KsspageController(BaseController):
     def edit(self):
         title = request.params.get('title')
@@ -62,3 +55,16 @@
         core.replace_html(CSS('p.footer'), footer_html)
                 
         return render_kss_response(commands)
+
+    def list(self):
+        c.titles = [page.title for page in model.Page.select()]
+        html = render('/titles.myt', fragment=True)
+
+        commands = KSSCommands()
+        core = commands.get_command_set('core')
+        core.replace_inner_html(CSS('div.content'), html)
+
+        footer_html = render('/footer.myt', fragment=True)
+        core.replace_html(CSS('p.footer'), footer_html)
+        
+        return render_kss_response(commands)

Modified: kukit/KSSPylonsWiki/trunk/kss/pylonswiki/public/wiki.kss
==============================================================================
--- kukit/KSSPylonsWiki/trunk/kss/pylonswiki/public/wiki.kss	(original)
+++ kukit/KSSPylonsWiki/trunk/kss/pylonswiki/public/wiki.kss	Sun May 27 14:46:04 2007
@@ -15,4 +15,9 @@
   evt-click-preventdefault: True;
   action-server: kss/page;
   kss/page-title: nodeContent();
+}
+
+#title-list-link a:click{
+  evt-click-preventdefault: True;
+  action-server: kss/list;
 }
\ No newline at end of file

Modified: kukit/KSSPylonsWiki/trunk/kss/pylonswiki/templates/footer.myt
==============================================================================
--- kukit/KSSPylonsWiki/trunk/kss/pylonswiki/templates/footer.myt	(original)
+++ kukit/KSSPylonsWiki/trunk/kss/pylonswiki/templates/footer.myt	Sun May 27 14:46:04 2007
@@ -1,10 +1,12 @@
 <p class="footer">
   Return to the
   <% h.link_to('FrontPage', h.url_for(action="index", title="FrontPage")) %>
-% if h.url_for() != '/page/list':
+% if not h.url_for().endswith('/list'):
   | <span class="<% h.kss_class_attributes(title=c.title) %>">
     <% h.link_to('Edit '+c.title, h.url_for(title=c.title, action='edit')) %>
   </span>
+  <span id="title-list-link">
   | <% h.link_to('Title List', h.url_for(action='list', title=None, controller='page')) %>
+  </span>			
 % # end if
 </p>


More information about the Kukit-checkins mailing list