Wiki: base implemetation logic
This commit is contained in:
parent
eacea15a21
commit
4c1b8558df
8 changed files with 35 additions and 68 deletions
|
@ -21,5 +21,5 @@
|
|||
Wall
|
||||
|
||||
- if @project.wiki_enabled
|
||||
-#= link_to project_wikis_path(@project), :class => current_page?(:controller => "projects", :action => "wiki", :id => @project) ? "current" : nil do
|
||||
= link_to project_wiki_path(@project, :index), :class => current_page?(:controller => "projects", :action => "wiki", :id => @project) ? "current" : nil do
|
||||
Wiki
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
= form_for @wiki do |f|
|
||||
= form_for [@project, @wiki] do |f|
|
||||
-if @wiki.errors.any?
|
||||
#error_explanation
|
||||
%h2= "#{pluralize(@wiki.errors.count, "error")} prohibited this wiki from being saved:"
|
||||
|
@ -9,6 +9,7 @@
|
|||
.field
|
||||
= f.label :title
|
||||
= f.text_field :title
|
||||
= f.hidden_field :slug
|
||||
.field
|
||||
= f.label :content
|
||||
= f.text_area :content
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
%h1 Editing wiki
|
||||
%h1 Editing page
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Show', @wiki
|
||||
\|
|
||||
= link_to 'Back', wikis_path
|
||||
= link_to 'Show', [@project, @wiki]
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
%h1 Listing wikis
|
||||
|
||||
%table
|
||||
%tr
|
||||
%th Title
|
||||
%th Content
|
||||
%th
|
||||
%th
|
||||
%th
|
||||
|
||||
- @wikis.each do |wiki|
|
||||
%tr
|
||||
%td= wiki.title
|
||||
%td= wiki.content
|
||||
%td= link_to 'Show', wiki
|
||||
%td= link_to 'Edit', edit_wiki_path(wiki)
|
||||
%td= link_to 'Destroy', wiki, :confirm => 'Are you sure?', :method => :delete
|
||||
|
||||
%br
|
||||
|
||||
= link_to 'New Wiki', new_wiki_path
|
|
@ -1,5 +0,0 @@
|
|||
%h1 New wiki
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Back', wikis_path
|
Loading…
Add table
Add a link
Reference in a new issue