First steps for an own wiki.
* Scaffold for Page Objekt * Using textile for rendering html * Easy wiki-links with [[wikipage]]
This commit is contained in:
parent
37199bae1d
commit
f450070dbf
16 changed files with 252 additions and 1 deletions
|
|
@ -16,6 +16,11 @@
|
|||
{ :name => "Aufgaben", :url => "/tasks"}
|
||||
]
|
||||
},
|
||||
{ :name => "Wiki", :url => "/pages", :active => ["pages", "wiki"],
|
||||
:subnav => [
|
||||
{ :name => "Alle Seiten", :url => "pages/all" }
|
||||
]
|
||||
},
|
||||
{ :name => "Bestellungen", :url => u.ordergroup ? "/ordering/" : "/orders",
|
||||
:active => ["orders", "ordering"],
|
||||
:subnav => [
|
||||
|
|
|
|||
15
app/views/pages/_form.html.haml
Normal file
15
app/views/pages/_form.html.haml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
- form_for @page do |f|
|
||||
= f.error_messages
|
||||
|
||||
%p
|
||||
%b Title
|
||||
%br/
|
||||
= f.text_field :title
|
||||
%p
|
||||
%b Inhalt
|
||||
%br/
|
||||
= f.text_area :body, :size => "60x30"
|
||||
%p
|
||||
= f.submit "Speichern"
|
||||
|
|
||||
= link_to "Abbrechen", :back
|
||||
12
app/views/pages/all.html.haml
Normal file
12
app/views/pages/all.html.haml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
- title "Alle Wikiseiten"
|
||||
|
||||
%p= link_to "Neue Seite anlegen", new_page_path
|
||||
|
||||
%table
|
||||
%tr
|
||||
%th Title
|
||||
%th zuletzt aktualisiert
|
||||
- for page in @pages
|
||||
%tr
|
||||
%td= link_to page.title, page
|
||||
%td= format_date page.updated_at
|
||||
3
app/views/pages/edit.html.haml
Normal file
3
app/views/pages/edit.html.haml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
- title "#{@page.title} bearbeiten"
|
||||
|
||||
= render :partial => 'form'
|
||||
3
app/views/pages/new.html.haml
Normal file
3
app/views/pages/new.html.haml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
- title "Neue Wikiseite anlegen"
|
||||
|
||||
= render :partial => 'form'
|
||||
7
app/views/pages/show.html.haml
Normal file
7
app/views/pages/show.html.haml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
- title @page.title
|
||||
|
||||
= wikified_body @page.body
|
||||
|
||||
%hr/
|
||||
%p
|
||||
= link_to "Seite bearbeiten", edit_page_path(@page)
|
||||
Loading…
Add table
Add a link
Reference in a new issue