Author: jvloothuis
Date: Sat May 26 14:24:35 2007
New Revision: 43674
Added:
kukit/KSSPylonsWiki/trunk/kss/pylonswiki/templates/footer.myt
Modified:
kukit/KSSPylonsWiki/trunk/kss/pylonswiki/controllers/ksspage.py
kukit/KSSPylonsWiki/trunk/kss/pylonswiki/public/wiki.kss
kukit/KSSPylonsWiki/trunk/kss/pylonswiki/templates/autohandler
Log:
Made links to other pages use KSS as well. This makes the wiki a single page
app for most operations.
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 Sat May
26 14:24:35 2007
@@ -44,3 +44,21 @@
core.replace_inner_html(CSS('div.content'), html)
return render_kss_response(commands)
+
+ def page(self):
+ title = request.params.get('title')
+ page = model.Page.get_by(title=title)
+ c.title = title
+ if page:
+ c.content = page.get_wiki_content()
+
+ commands = KSSCommands()
+ core = commands.get_command_set('core')
+
+ content_html = render('/page.myt', fragment=True)
+ core.replace_inner_html(CSS('div.content'), 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 Sat May 26
14:24:35 2007
@@ -1,4 +1,4 @@
-.footer a:click {
+.footer span a:click {
evt-click-preventdefault: True;
action-server: kss/edit;
kss/edit-title: kssAttr(title, True);
@@ -10,3 +10,9 @@
kss/save-title: currentFormVar(title);
kss/save-content: currentFormVar(content);
}
+
+.content a:click{
+ evt-click-preventdefault: True;
+ action-server: kss/page;
+ kss/page-title: nodeContent();
+}
\ No newline at end of file
Modified: kukit/KSSPylonsWiki/trunk/kss/pylonswiki/templates/autohandler
==============================================================================
--- kukit/KSSPylonsWiki/trunk/kss/pylonswiki/templates/autohandler
(original)
+++ kukit/KSSPylonsWiki/trunk/kss/pylonswiki/templates/autohandler Sat May
26 14:24:35 2007
@@ -14,10 +14,6 @@
<div class="content">
% m.call_next()
</div>
- <p class="footer">
- Return to the
- <% h.link_to('FrontPage', h.url_for(action="index",
title="FrontPage")) %>
- | <span class="kssattr-title-<% c.title %>"><% h.link_to('Edit
'+c.title, h.url_for(title=c.title, action='edit')) %></span>
- </p>
+ <& footer.myt &>
</body>
</html>
Added: kukit/KSSPylonsWiki/trunk/kss/pylonswiki/templates/footer.myt
==============================================================================
--- (empty file)
+++ kukit/KSSPylonsWiki/trunk/kss/pylonswiki/templates/footer.myt Sat May
26 14:24:35 2007
@@ -0,0 +1,5 @@
+ <p class="footer">
+ Return to the
+ <% h.link_to('FrontPage', h.url_for(action="index",
title="FrontPage")) %>
+ | <span class="kssattr-title-<% c.title %>"><% h.link_to('Edit
'+c.title, h.url_for(title=c.title, action='edit')) %></span>
+ </p>
\ No newline at end of file
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins