Added toc to wikipages. Patched wikicloth.

* patched wikicloth to serve anchor links for sections
* added table of contents
* subpages list doesn't show up per default
This commit is contained in:
Benjamin Meichsner 2009-09-28 14:57:11 +02:00
parent 741815e24e
commit 67661cb716
9 changed files with 72 additions and 40 deletions

View file

@ -1,5 +1,9 @@
- content = wikified_body @page.body, @page.title
//#toc
//%h2 Inhaltsverzeichnis
//= generate_toc @page.body
- toc = generate_toc @page.body
- unless toc.blank?
#wikitoc
%h2
Inhaltsverzeichnis
%span= link_to_function "[verstecken]", "Element.toggle('wikitoc-content')"
#wikitoc-content= toc
#wiki_content= content

View file

@ -4,7 +4,7 @@
#breadcrump
= link_to_wikipage_by_permalink("Home", "Foodcoop-Wiki")
%h1 Alle Wikiseite
%h1 Alle Wikiseiten
%p= link_to "Neue Seite anlegen", new_page_path
@ -15,4 +15,4 @@
- for page in @pages
%tr
%td= link_to page.title, wiki_page_path(page.permalink)
%td= format_date page.updated_at
%td= format_datetime page.updated_at

View file

@ -30,7 +30,7 @@
= "(#{User.find(version.updated_by).nick})"
- unless @page.children.empty?
#subpages
#subpages{:style => "display:none"}
.box_title
%h2 Unterseiten
.column_content