From f76b90af20a02ba96276df090dfcc1100e35403a Mon Sep 17 00:00:00 2001 From: andrew Date: Sat, 17 Nov 2007 09:42:02 +0000 Subject: [PATCH] adding a basic browser for the page/wiki section git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@41 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7 --- app/controllers/pages_controller.rb | 9 ++++++++- app/views/pages/_page.rhtml | 11 ++++++----- app/views/pages/index.rhtml | 11 ++++++++++- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 42365f6..01b5920 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -7,9 +7,16 @@ class PagesController < ApplicationController @page = Page.find_by_title 'HomePage' @page ||= Page.create :title => 'HomePage', :redcloth => 'Welcome to BarleySodas!' + @content_title = 'The Beer Wiki' + @secondary_title = 'Browsing all pages' + + cond_ary = [ 'owner_id IS NULL' ] + cond_ary << "title <> 'HomePage'" + @pages, @wiki_pages = paginate :page, :per_page => 25, + :order => 'title ASC', :conditions => [ cond_ary.join(' AND ') ] + respond_to do |format| format.html # index.rhtml - format.xml { render :xml => @page.to_xml } end end diff --git a/app/views/pages/_page.rhtml b/app/views/pages/_page.rhtml index 5a45020..3bb911b 100644 --- a/app/views/pages/_page.rhtml +++ b/app/views/pages/_page.rhtml @@ -1,20 +1,21 @@ +<% simple ||= false -%>

<%= @page.title %> - Comment Size Here + <% unless simple -%>Comment Size Here<% end -%>

-
+ <% unless simple -%>
Posted by Author Name Here -
+
<% end -%>
<%= @page.html %>
- <% end -%>
diff --git a/app/views/pages/index.rhtml b/app/views/pages/index.rhtml index fa2b8d4..bec6e3e 100644 --- a/app/views/pages/index.rhtml +++ b/app/views/pages/index.rhtml @@ -1,4 +1,13 @@ -<%= render :partial => 'page' -%> +<%= render :partial => 'page', :locals => { :simple => true } -%> + +<% unless @wiki_pages.empty? -%> +
+ + <%= render :partial => 'shared/pagination_links' %> +
+<% end -%> <% content_for :sidebar do -%> <%= new_page_link -%>