wiki pages

This commit is contained in:
albert
2011-03-10 18:35:19 -05:00
parent 9c0a961ab2
commit 81aec6b950
8 changed files with 48 additions and 451 deletions

View File

@@ -4,6 +4,7 @@ module PostSets
def initialize(tag_name)
@tag_name = tag_name
super()
end
def load_posts
@@ -17,6 +18,10 @@ module PostSets
def offset
0
end
def tags
[@tag_name]
end
def use_sequential_paginator?
false

View File

@@ -56,6 +56,10 @@ class WikiPage < ActiveRecord::Base
def creator_name
User.id_to_name(user_id).tr("_", " ")
end
def category_name
Tag.category_for(title)
end
def pretty_title
title.tr("_", " ")

View File

@@ -5,4 +5,6 @@
<% if CurrentUser.is_janitor? %>
<%= f.input :is_locked %>
<% end %>
<%= f.button :submit, "Save" %><%= f.button :submit, "Cancel" %><%= f.button :submit "Preview" %>
<div id="multiple-buttons">
<%= f.button :submit, "Save" %><%= f.button :submit, "Cancel" %><%= f.button :submit, "Preview" %>
</div>

View File

@@ -1,8 +1,8 @@
<aside id="sidebar">
<section>
<h1>Search</h1>
<%= simple_form_for(@search) do |f| %>
<%= f.input :title_contains %>
<%= form_tag(wiki_pages_path, :method => :get) do %>
<%= text_field_tag "title", params[:title], :size => 20 %>
<% end %>
</section>

View File

@@ -3,6 +3,7 @@
<%= render "sidebar" %>
<section id="content">
<h1>New Wiki Page</h1>
<div id="preview">
</div>

View File

@@ -15,3 +15,5 @@
</section>
</div>
</div>
<%= render "secondary_links" %>