Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

test

  • Loading branch information...
commit 7c7cbc22330a6bba2e8e2f917074c8122b46f5db 1 parent 9d576b2
authored January 10, 2012
2  app/models/page.rb
@@ -13,7 +13,7 @@ class Page < ActiveRecord::Base
13 13
   validates_presence_of :slug
14 14
   attr_protected :deleteable
15 15
   accepts_nested_attributes_for :links
16  
-  attr_accessible :pageable_id, :pageable_type, :link_path, :title, :description, :slug, :layout, :tags, :inherit_widgets, :parent_id, :state, :links_attributes
  16
+  attr_accessible :pageable_id, :pageable_type, :link_path, :title, :show_title, :description, :slug, :layout, :tags, :inherit_widgets, :parent_id, :state, :links_attributes
17 17
   before_save :generateLinkPath
18 18
   after_update :updateLinkPaths
19 19
 
2  app/models/post.rb
@@ -9,7 +9,7 @@ class Post < ActiveRecord::Base
9 9
           
10 10
   validates_presence_of :title, :content
11 11
   accepts_nested_attributes_for :page
12  
-  attr_accessible :title, :summary, :content, :show_title, :sticky, :featured, :user_created, :user_modified, :page_attributes
  12
+  attr_accessible :title, :summary, :content, :sticky, :featured, :user_created, :user_modified, :page_attributes
13 13
   
14 14
   def self.get(post)
15 15
     select("posts.*, users.display_name, users.username, COUNT(comments.id) AS comment_count")
2  app/views/admin/menus/_admin_menu.html.erb
@@ -2,7 +2,7 @@
2 2
 	<ul id="menuAdminItems">
3 3
 		<%= raw("<li><div>#{link_to content_tag(:span, 'Profile'), user_profile_index_path}</div></li>")%>
4 4
 		<%= raw("<li><div>#{link_to content_tag(:span, 'Menus'), admin_menus_path}</div></li>") if can? :manage, Menu %>
5  
-		<%= raw("<li><div>#{link_to content_tag(:span, 'Images'), admin_images_path}</div></li>") if can? :create, Image %>
  5
+		<%= raw("<li><div>#{link_to content_tag(:span, 'Images'), admin_images_path}</div></li>") if can? :manage, Menu %>
6 6
 		<%= raw("<li><div>#{link_to content_tag(:span, 'Users'), admin_users_path}</div></li>") if can? :manage, User  %>
7 7
 		<%= raw("<li><div>#{link_to content_tag(:span, 'Roles'), admin_roles_path}</div></li>") if can? :manage, Role %>
8 8
 		<%= raw("<li><div>#{link_to content_tag(:span, 'Settings'), admin_settings_path}</div></li>") if can? :manage, Setting %>
4  app/views/admin/posts/_form.html.erb
@@ -12,6 +12,7 @@
12 12
 	<%= f.input :content, :as => :text, :input_html => {:class => 'autogrow'} %>
13 13
 	<%= f.semantic_fields_for :page do |p|%>
14 14
       <%= p.input :state, :as => :boolean, :label => "Published"%>
  15
+      
15 16
 	  <% unless @post.id%>
16 17
 		<%menus = Menu.all%>
17 18
 		  	Menus:<br />
@@ -28,6 +29,7 @@
28 29
 		  <%end%>
29 30
 		<%end%>
30 31
 	  <%end%>
  32
+	  <%= p.input :show_title, :as => :boolean%>
31 33
 	  <%= p.input :title, :as => :hidden, :input_html => {:class => "autofillPageTitle"}, :wrapper_html => {:style => "display:none;" }%>
32 34
 	    <%= p.input :layout, :as => :hidden, :wrapper_html => {:style => "display:none;"}, :value => "1_2_1", %>
33 35
 		  <%if @postable%>
@@ -35,7 +37,7 @@
35 37
 	  		<%= p.input :inherit_widgets, :as => :hidden, :value => 1%>
36 38
 	  	  <%end%>
37 39
 	  <%end%>
38  
-	  <%= f.input :show_title, :as => :boolean%>
  40
+	  
39 41
 	  <%= f.input :sticky, :as => :boolean%>
40 42
 	  <%= f.input :user_created, :as => :hidden, :wrapper_html => {:style => "display:none;" }, :value => current_user.id unless @post.id?%>
41 43
 	  <%= f.input :user_modified, :as => :hidden, :wrapper_html => {:style => "display:none;" }, :value => current_user.id%>
2  app/views/pages/page_widgets/_post.html.erb
@@ -14,7 +14,7 @@
14 14
 
15 15
 <div id="postWrapper" class="editable nowidth" name="Post Wrapper">
16 16
 	<div id="post" class="editable nowidth" name="Post">
17  
-		<% if @post.show_title%>
  17
+		<% if @page.show_title%>
18 18
 			<div id="<%=postable_type%>PostHeader" class="editable <%=postable_type%>PostHeader nowidth" name="Post Header">	
19 19
 				<span id="<%=postable_type%>PostTitle" class="editable nowidth <%=postable_type%>PostTitle" name="Post Title">
20 20
 					<%= @post.title%>
10  db/seeds.rb
@@ -55,7 +55,7 @@
55 55
 
56 56
 # Default Pages
57 57
 Post.create(:title => "Home", :content => 'Welcome to the Home Page.', :user_created => 1, :user_modified => 1)
58  
-Page.create(:pageable_id => 1,:pageable_type => "Post", :slug => "home", :title => "Home", :description => "Welcome to the Home Page", :layout => "1_2_1", :state => 1, :deletable => false)
  58
+Page.create(:pageable_id => 1,:pageable_type => "Post", :slug => "home", :title => "Home", :show_title => false, :description => "Welcome to the Home Page", :layout => "1_2_1", :state => 1, :deletable => false)
59 59
 
60 60
 # Default Menu
61 61
 Menu.create(:name => "Main Menu", :orientation => "horizontal")
@@ -63,4 +63,10 @@
63 63
 # Default Menu Links
64 64
 Link.create(:title => "Home", :linkable_type => "Menu", :linkable_id => 1, :link_path => "", :position => 1,  :page_id => 1)
65 65
 
66  
-# Widgets
  66
+# Widgets
  67
+Widget.create(:page_widget => true, :name => "Post", :description => "HTML", :position => 1)
  68
+Widget.create(:page_widget => true, :name => "Blog", :description => "HTML", :position => 2)
  69
+Widget.create(:page_widget => true, :name => "Gallery", :description => "HTML", :position => 3)
  70
+Widget.create(:page_widget => true, :name => "Form", :description => "HTML", :position => 4)
  71
+Widget.create(:page_widget => false, :name => "Menu", :description => "HTML", :position => 1)
  72
+Widget.create(:page_widget => false, :name => "Login", :description => "HTML", :position => 2)

0 notes on commit 7c7cbc2

Please sign in to comment.
Something went wrong with that request. Please try again.