comfortable_mexican_sofa 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. data/.gitignore +10 -0
  2. data/CHANGELOG.rdoc +2 -0
  3. data/LICENSE +20 -0
  4. data/README.rdoc +55 -0
  5. data/Rakefile +88 -0
  6. data/VERSION +1 -0
  7. data/app/controllers/cms_admin/attachments_controller.rb +55 -0
  8. data/app/controllers/cms_admin/base_controller.rb +25 -0
  9. data/app/controllers/cms_admin/categories_controller.rb +69 -0
  10. data/app/controllers/cms_admin/layouts_controller.rb +71 -0
  11. data/app/controllers/cms_admin/pages_controller.rb +79 -0
  12. data/app/controllers/cms_admin/sections_controller.rb +17 -0
  13. data/app/controllers/cms_admin/snippets_controller.rb +58 -0
  14. data/app/controllers/cms_common/render_page.rb +47 -0
  15. data/app/controllers/cms_content_controller.rb +30 -0
  16. data/app/helpers/cms_helper.rb +12 -0
  17. data/app/models/cms_attachment.rb +17 -0
  18. data/app/models/cms_attachment_categorization.rb +5 -0
  19. data/app/models/cms_block.rb +15 -0
  20. data/app/models/cms_category.rb +36 -0
  21. data/app/models/cms_layout.rb +102 -0
  22. data/app/models/cms_page.rb +125 -0
  23. data/app/models/cms_page_categorization.rb +6 -0
  24. data/app/models/cms_snippet.rb +15 -0
  25. data/app/views/cms_admin/attachments/_details.html.haml +27 -0
  26. data/app/views/cms_admin/attachments/_form.html.haml +24 -0
  27. data/app/views/cms_admin/attachments/edit.html.haml +10 -0
  28. data/app/views/cms_admin/attachments/index.html.haml +36 -0
  29. data/app/views/cms_admin/attachments/new.html.haml +8 -0
  30. data/app/views/cms_admin/categories/_category.html.haml +21 -0
  31. data/app/views/cms_admin/categories/_category_subform.html.haml +12 -0
  32. data/app/views/cms_admin/categories/_form.html.haml +18 -0
  33. data/app/views/cms_admin/categories/_new.html.haml +7 -0
  34. data/app/views/cms_admin/categories/_toggle_link.html.haml +9 -0
  35. data/app/views/cms_admin/categories/_tree_branch.html.haml +36 -0
  36. data/app/views/cms_admin/categories/children.js.rjs +10 -0
  37. data/app/views/cms_admin/categories/create.js.rjs +9 -0
  38. data/app/views/cms_admin/categories/edit.html.haml +10 -0
  39. data/app/views/cms_admin/categories/index.html.haml +7 -0
  40. data/app/views/cms_admin/categories/new.html.haml +8 -0
  41. data/app/views/cms_admin/categories/show.html.haml +17 -0
  42. data/app/views/cms_admin/layouts/_details.html.haml +6 -0
  43. data/app/views/cms_admin/layouts/_form.html.haml +19 -0
  44. data/app/views/cms_admin/layouts/_toggle_link.html.haml +9 -0
  45. data/app/views/cms_admin/layouts/_tree_branch.html.haml +39 -0
  46. data/app/views/cms_admin/layouts/children.js.rjs +10 -0
  47. data/app/views/cms_admin/layouts/edit.html.haml +10 -0
  48. data/app/views/cms_admin/layouts/index.html.haml +7 -0
  49. data/app/views/cms_admin/layouts/new.html.haml +8 -0
  50. data/app/views/cms_admin/pages/_details.html.haml +25 -0
  51. data/app/views/cms_admin/pages/_form.html.haml +45 -0
  52. data/app/views/cms_admin/pages/_form_blocks.html.haml +48 -0
  53. data/app/views/cms_admin/pages/_toggle_link.html.haml +10 -0
  54. data/app/views/cms_admin/pages/_tree_branch.html.haml +41 -0
  55. data/app/views/cms_admin/pages/children.js.rjs +10 -0
  56. data/app/views/cms_admin/pages/edit.html.haml +11 -0
  57. data/app/views/cms_admin/pages/form_blocks.js.rjs +1 -0
  58. data/app/views/cms_admin/pages/index.html.haml +6 -0
  59. data/app/views/cms_admin/pages/new.html.haml +9 -0
  60. data/app/views/cms_admin/sections/show.html.haml +23 -0
  61. data/app/views/cms_admin/snippets/_form.html.haml +10 -0
  62. data/app/views/cms_admin/snippets/edit.html.haml +10 -0
  63. data/app/views/cms_admin/snippets/index.html.haml +26 -0
  64. data/app/views/cms_admin/snippets/new.html.haml +8 -0
  65. data/app/views/cms_content/show.xml.rxml +27 -0
  66. data/app/views/cms_content/sitemap.xml.rxml +16 -0
  67. data/app/views/layouts/cms_admin.html.haml +44 -0
  68. data/comfortable_mexican_sofa.gemspec +254 -0
  69. data/config/cms_routes.rb +25 -0
  70. data/generators/cms/cms_generator.rb +55 -0
  71. data/generators/cms/templates/README +32 -0
  72. data/generators/cms/templates/images/arrow_bottom.gif +0 -0
  73. data/generators/cms/templates/images/arrow_right.gif +0 -0
  74. data/generators/cms/templates/images/icon_attachment.gif +0 -0
  75. data/generators/cms/templates/images/icon_category.gif +0 -0
  76. data/generators/cms/templates/images/icon_draft.gif +0 -0
  77. data/generators/cms/templates/images/icon_layout.gif +0 -0
  78. data/generators/cms/templates/images/icon_move.gif +0 -0
  79. data/generators/cms/templates/images/icon_regular.gif +0 -0
  80. data/generators/cms/templates/images/icon_snippet.gif +0 -0
  81. data/generators/cms/templates/images/logo.png +0 -0
  82. data/generators/cms/templates/initializers/cms.rb +14 -0
  83. data/generators/cms/templates/initializers/paperclip.rb +14 -0
  84. data/generators/cms/templates/javascripts/codemirror_init.js +16 -0
  85. data/generators/cms/templates/javascripts/mce_init.js +17 -0
  86. data/generators/cms/templates/javascripts/utilities.js +27 -0
  87. data/generators/cms/templates/migrations/create_cms.rb +113 -0
  88. data/generators/cms/templates/stylesheets/cms_master.sass +414 -0
  89. data/init.rb +1 -0
  90. data/lib/comfortable_mexican_sofa.rb +46 -0
  91. data/lib/comfortable_mexican_sofa/acts_as_categorized.rb +87 -0
  92. data/lib/comfortable_mexican_sofa/acts_as_published.rb +60 -0
  93. data/lib/comfortable_mexican_sofa/cms_acts_as_tree.rb +108 -0
  94. data/lib/comfortable_mexican_sofa/cms_rails_extensions.rb +12 -0
  95. data/lib/comfortable_mexican_sofa/cms_tag.rb +109 -0
  96. data/lib/comfortable_mexican_sofa/cms_tags/attachment.rb +3 -0
  97. data/lib/comfortable_mexican_sofa/cms_tags/block.rb +117 -0
  98. data/lib/comfortable_mexican_sofa/cms_tags/helper.rb +3 -0
  99. data/lib/comfortable_mexican_sofa/cms_tags/page_block.rb +119 -0
  100. data/lib/comfortable_mexican_sofa/cms_tags/partial.rb +19 -0
  101. data/lib/comfortable_mexican_sofa/cms_tags/snippet.rb +19 -0
  102. data/rails/init.rb +1 -0
  103. data/test/fixtures/cms_attachment_categorizations.yml +7 -0
  104. data/test/fixtures/cms_attachments.yml +6 -0
  105. data/test/fixtures/cms_blocks.yml +38 -0
  106. data/test/fixtures/cms_categories.yml +19 -0
  107. data/test/fixtures/cms_layouts.yml +41 -0
  108. data/test/fixtures/cms_page_categorizations.yml +15 -0
  109. data/test/fixtures/cms_pages.yml +38 -0
  110. data/test/fixtures/cms_snippets.yml +7 -0
  111. data/test/fixtures/files/upload_file.txt +1 -0
  112. data/test/functional/cms_admin/attachments_controller_test.rb +63 -0
  113. data/test/functional/cms_admin/categories_controller_test.rb +86 -0
  114. data/test/functional/cms_admin/layouts_controller_test.rb +77 -0
  115. data/test/functional/cms_admin/pages_controller_test.rb +153 -0
  116. data/test/functional/cms_admin/sections_controller_test.rb +9 -0
  117. data/test/functional/cms_admin/snippets_controller_test.rb +63 -0
  118. data/test/functional/cms_content_controller_test.rb +52 -0
  119. data/test/models/cms_attachment_test.rb +16 -0
  120. data/test/models/cms_block_test.rb +11 -0
  121. data/test/models/cms_categorization_test.rb +39 -0
  122. data/test/models/cms_category_test.rb +71 -0
  123. data/test/models/cms_layout_test.rb +44 -0
  124. data/test/models/cms_page_test.rb +55 -0
  125. data/test/models/cms_snippet_test.rb +16 -0
  126. data/test/models/cms_tag_test.rb +70 -0
  127. data/test/rails_root/README +243 -0
  128. data/test/rails_root/Rakefile +10 -0
  129. data/test/rails_root/app/controllers/application_controller.rb +10 -0
  130. data/test/rails_root/app/helpers/application_helper.rb +3 -0
  131. data/test/rails_root/app/views/cms/under-development.html.haml +1 -0
  132. data/test/rails_root/app/views/complex_page/_example.html.erb +1 -0
  133. data/test/rails_root/config/boot.rb +110 -0
  134. data/test/rails_root/config/database.yml +22 -0
  135. data/test/rails_root/config/environment.rb +48 -0
  136. data/test/rails_root/config/environments/development.rb +17 -0
  137. data/test/rails_root/config/environments/production.rb +28 -0
  138. data/test/rails_root/config/environments/test.rb +28 -0
  139. data/test/rails_root/config/initializers/backtrace_silencers.rb +7 -0
  140. data/test/rails_root/config/initializers/inflections.rb +10 -0
  141. data/test/rails_root/config/initializers/mime_types.rb +5 -0
  142. data/test/rails_root/config/initializers/new_rails_defaults.rb +19 -0
  143. data/test/rails_root/config/initializers/session_store.rb +15 -0
  144. data/test/rails_root/config/locales/en.yml +5 -0
  145. data/test/rails_root/config/routes.rb +43 -0
  146. data/test/rails_root/doc/README_FOR_APP +2 -0
  147. data/test/rails_root/public/404.html +30 -0
  148. data/test/rails_root/public/422.html +30 -0
  149. data/test/rails_root/public/500.html +30 -0
  150. data/test/rails_root/public/favicon.ico +0 -0
  151. data/test/rails_root/public/images/rails.png +0 -0
  152. data/test/rails_root/public/index.html +275 -0
  153. data/test/rails_root/public/javascripts/application.js +2 -0
  154. data/test/rails_root/public/javascripts/controls.js +963 -0
  155. data/test/rails_root/public/javascripts/dragdrop.js +973 -0
  156. data/test/rails_root/public/javascripts/effects.js +1128 -0
  157. data/test/rails_root/public/javascripts/prototype.js +4320 -0
  158. data/test/rails_root/public/robots.txt +5 -0
  159. data/test/rails_root/public/stylesheets/sass/cms_master.sass +414 -0
  160. data/test/rails_root/script/about +4 -0
  161. data/test/rails_root/script/console +3 -0
  162. data/test/rails_root/script/dbconsole +3 -0
  163. data/test/rails_root/script/destroy +3 -0
  164. data/test/rails_root/script/generate +3 -0
  165. data/test/rails_root/script/performance/benchmarker +3 -0
  166. data/test/rails_root/script/performance/profiler +3 -0
  167. data/test/rails_root/script/plugin +3 -0
  168. data/test/rails_root/script/runner +3 -0
  169. data/test/rails_root/script/server +3 -0
  170. data/test/test_helper.rb +17 -0
  171. metadata +303 -0
@@ -0,0 +1,45 @@
1
+ = form.error_messages
2
+
3
+ .form_right_column
4
+ .form_element_group.publishing
5
+ .form_element
6
+ .label= form.label :published_at, 'Publish at'
7
+ .field= form.calendar_date_select :published_at, :time => true
8
+
9
+ .form_element
10
+ .label= form.label :unpublished_at, 'Unpublish at'
11
+ .field= form.calendar_date_select :unpublished_at, :time => true
12
+
13
+ = render :partial => 'cms_admin/categories/category_subform', :locals => { :item => @cms_page }
14
+
15
+ .form_left_column
16
+ .form_element_group.horizontal
17
+ .form_element.text.large
18
+ .label= form.label :label, 'Title'
19
+ .field= form.text_field :label, :onkeyup => (@cms_page.new_record? ? "slugify_field($('cms_page_slug'), this.value)" : nil)
20
+
21
+ - unless CmsPage.count == 0 || @cms_page == CmsPage.root
22
+ .form_element.text
23
+ .label= form.label :slug, 'Slug'
24
+ .field= form.text_field :slug
25
+
26
+ .form_element.select
27
+ .label= form.label :parent_id, 'Parent Page'
28
+ .field= form.select :parent_id, @cms_page.pages_for_select(nil, 0, true)
29
+
30
+ .form_element.select
31
+ .label= form.label :redirect_to_page_id, 'Redirect To'
32
+ .field= form.select :redirect_to_page_id, [['---', nil]] + @cms_page.pages_for_select
33
+
34
+ .form_element.checkbox
35
+ .label
36
+ .field
37
+ = form.check_box :is_section
38
+ = form.label :is_section, 'Children of this page have their own section'
39
+
40
+ .form_element.select
41
+ .label= form.label :cms_layout_id, 'Layout'
42
+ .field= form.select :cms_layout_id, CmsLayout.options_for_select, {}, :onchange => remote_function(:url => {:action => :form_blocks, :id => (@cms_page.try(:id) || 0)}, :with => "'layout_id=' + value")
43
+
44
+ #form_blocks
45
+ = render :partial => 'form_blocks'
@@ -0,0 +1,48 @@
1
+ - @layout ||= @cms_page.cms_layout
2
+ - @layout && tags = @layout.tags(:view => self, :page => @cms_page).reject{|t| !t.class.has_form?}.group_by(&:tag_type)
3
+
4
+ - #use these to see if we need to re-initiliaze CodeMirror or TinyMCE.
5
+ - init_codemirror = false
6
+ - init_tinymce = false
7
+
8
+ - unless tags.blank?
9
+
10
+ - unless (cms_block_tags = tags.delete('cms_block')).blank?
11
+ .form_element_group.block
12
+ - cms_block_tags.each do |tag|
13
+
14
+ - #check the format to see if it needs JS initialization.
15
+ - init_codemirror = true if tag.format == 'code'
16
+ - init_tinymce = true if tag.format == 'rich_text'
17
+
18
+ .form_element{:class => tag.format}
19
+ .label= tag.form_label
20
+ .field= tag.form_input
21
+
22
+
23
+ - unless (cms_page_block_tags = tags.delete('cms_page_block')).blank?
24
+ .form_element_group.page_block
25
+ - cms_page_block_tags.each do |tag|
26
+
27
+ - #check the format to see if it needs JS initialization.
28
+ - init_codemirror = true if tag.format == 'code'
29
+ - init_tinymce = true if tag.format == 'rich_text'
30
+
31
+ .form_element{:class => tag.format}
32
+ .label= tag.form_label
33
+ .field= tag.form_input
34
+
35
+ - # outputting any other tag that has a form element
36
+ - tags.each do |type, tags|
37
+ .form_element_group{:class => type.to_s}
38
+ - tags.each do |tag|
39
+ .form_element
40
+ .label= tag.form_label
41
+ .field= tag.form_input
42
+
43
+ - if init_codemirror && request.xhr?
44
+ :javascript
45
+ init_CodeMirror();
46
+ - if init_tinymce && request.xhr?
47
+ :javascript
48
+ init_TinyMCE();
@@ -0,0 +1,10 @@
1
+ - page ||= toggle_link
2
+
3
+ - if page.children.count > 0
4
+
5
+ - if session[:cms_page_tree] && session[:cms_page_tree].member?(page.id.to_s)
6
+ = link_to_remote page.children.count, :url => {:action => 'children', :id => page.id, :state => 'open'}, :loading => "$('page_#{page.id}_children').show()", :html => {:id => "page_#{page.id}_link", :class => 'tree_toggle open', :title => 'collapse level'}
7
+
8
+ - else
9
+ = link_to_remote page.children.count, :url => {:action => 'children', :id => page.id, :state => 'closed'}, :loading => "$('page_#{page.id}_children').show()", :html => {:id => "page_#{page.id}_link", :class => 'tree_toggle closed', :title => 'expand level'}
10
+
@@ -0,0 +1,41 @@
1
+ - container_id = tree_branch.first.try(:parent).try(:id).to_i
2
+
3
+ %ul{:id => "page_#{container_id}_branch"}
4
+ - tree_branch.each do |page|
5
+
6
+ %li{:id => "page_#{page.id}"}
7
+
8
+ = render :partial => 'toggle_link', :object => page
9
+
10
+ .item
11
+ .icon{:class => page.published_status}
12
+ - if page.siblings.size > 0
13
+ .dragger
14
+
15
+ = link_to page.label, edit_cms_admin_page_path(page), :class => 'label'
16
+
17
+ %span.action_links
18
+ [
19
+ = link_to_function 'Toggle Details', "$('page_details_#{page.id}').toggle()"
20
+ |
21
+ = link_to 'Add Child Page', new_cms_admin_page_path + "?parent_id=#{page.id}"
22
+ |
23
+ = link_to 'Edit', edit_cms_admin_page_path(page)
24
+ |
25
+ = link_to 'Remove', cms_admin_page_path(page), :method => 'delete', :confirm => 'Are you sure you want to remove this page?'
26
+ ]
27
+
28
+ %br/
29
+ = link_to page.full_path, page.full_path, :class => 'url'
30
+
31
+ = render :partial => 'details', :object => page
32
+
33
+ - if session[:cms_page_tree] && session[:cms_page_tree].member?(page.id.to_s)
34
+ %div{:id => "page_#{page.id}_children"}
35
+ = render :partial => 'tree_branch', :object => page.children
36
+ - else
37
+ %div{:id => "page_#{page.id}_children", :style => 'display: none'}
38
+ Please wait. I'm loading stuff...
39
+
40
+ - if page.siblings.size > 0
41
+ = sortable_element "page_#{container_id}_branch", :url => {:action => :reorder, :id => container_id}, :handle => 'dragger'
@@ -0,0 +1,10 @@
1
+ case params[:state]
2
+ when 'closed'
3
+ page.replace "page_#{@cms_page.id}_link", :partial => 'toggle_link', :object => @cms_page, :locals => { :state => 'open' }
4
+ page.replace_html "page_#{@cms_page.id}_children", :partial => 'tree_branch', :object => @cms_page.children
5
+ when 'open'
6
+ page.replace "page_#{@cms_page.id}_link", :partial => 'toggle_link', :object => @cms_page, :locals => { :state => 'closed' }
7
+ page.hide "page_#{@cms_page.id}_children"
8
+ page.replace_html "page_#{@cms_page.id}_children", ''
9
+ end
10
+
@@ -0,0 +1,11 @@
1
+ = link_to 'Add New Page', new_cms_admin_page_path, :class => 'big_button'
2
+
3
+ %h2 Editing Page
4
+
5
+ - form_for :cms_page, :url => {:action => :update}, :html => {:method => :put} do |form|
6
+ = render :partial => form
7
+ .submit
8
+ = form.submit 'Edit Page', :onclick => 'this.form.target = ""'
9
+ = form.submit 'Preview Page', :onclick => 'this.form.target = "_blank"', :name => 'preview'
10
+ or
11
+ = link_to 'Return to List', cms_admin_pages_path
@@ -0,0 +1 @@
1
+ page.replace_html 'form_blocks', :partial => 'form_blocks'
@@ -0,0 +1,6 @@
1
+ = link_to 'Add New Page', new_cms_admin_page_path, :class => 'big_button'
2
+
3
+ %h2 Pages
4
+
5
+ .tree_structure
6
+ = render :partial => 'tree_branch', :object => @cms_pages
@@ -0,0 +1,9 @@
1
+ %h2 New Page
2
+
3
+ - form_for :cms_page, :url => {:action => :create } do |form|
4
+ = render :partial => form
5
+ .submit
6
+ = form.submit 'Create Page', :onclick => 'this.form.target = ""'
7
+ = form.submit 'Preview Page', :onclick => 'this.form.target = "_blank"', :name => 'preview'
8
+ or
9
+ = link_to 'Return to List', cms_admin_pages_path
@@ -0,0 +1,23 @@
1
+ = link_to "Add New #{@section_label}", new_cms_admin_page_path + "?parent_id=#{@page.id}", :class => 'big_button'
2
+
3
+ %h2= @page.label
4
+
5
+ = will_paginate @pages
6
+
7
+ %table.formatted
8
+ - @pages.each do |page|
9
+ %tr
10
+ %td
11
+ .icon{:class => page.published_status}
12
+
13
+ %td.main
14
+ = link_to page.label, edit_cms_admin_page_path(page), :class => 'label'
15
+ %br/
16
+ = link_to page.full_path, page.full_path, :class => 'url'
17
+
18
+ %td.action_links
19
+ = link_to 'Edit', edit_cms_admin_page_path(page)
20
+ |
21
+ = link_to 'Remove', cms_admin_page_path(page), :method => 'delete', :confirm => 'Are you sure you want to remove this page?'
22
+
23
+ = will_paginate @pages
@@ -0,0 +1,10 @@
1
+ = form.error_messages
2
+
3
+ .form_element_group.horizontal
4
+ .form_element.text.large
5
+ .label= form.label :label, 'Label'
6
+ .field= form.text_field :label
7
+
8
+ .form_element.text_area
9
+ .label= form.label :content, 'Content'
10
+ .field= form.text_area :content
@@ -0,0 +1,10 @@
1
+ = link_to 'Add New Snippet', new_cms_admin_snippet_path, :class => 'big_button'
2
+
3
+ %h2 Editing Snippet
4
+
5
+ - form_for :snippet, :url => {:action => :update}, :html => {:method => :put} do |form|
6
+ = render :partial => form
7
+ .submit
8
+ = form.submit 'Edit Snippet'
9
+ or
10
+ = link_to 'Return to List', cms_admin_snippets_path
@@ -0,0 +1,26 @@
1
+ = link_to 'Add New Snippet', new_cms_admin_snippet_path, :class => 'big_button'
2
+
3
+ %h2 Snippets
4
+
5
+ = will_paginate @snippets
6
+
7
+ %table.formatted
8
+ %tr
9
+ %th.first{:colspan => 2} Snippet Label
10
+ %th.last
11
+
12
+ - @snippets.each do |snippet|
13
+ %tr
14
+ %td
15
+ .icon
16
+ %td.main
17
+ = link_to snippet.label.titleize, edit_cms_admin_snippet_path(snippet), :class => 'label'
18
+ %br/
19
+ = link_to snippet.label, edit_cms_admin_snippet_path(snippet), :class => 'slug'
20
+ %td.action_links
21
+ = link_to 'Edit', edit_cms_admin_snippet_path(snippet)
22
+ |
23
+ = link_to 'Remove', cms_admin_snippet_path(snippet), :method => 'delete', :confirm => 'Are you sure you want to remove this snippet?'
24
+
25
+ = will_paginate @snippets
26
+
@@ -0,0 +1,8 @@
1
+ %h2 New Snippet
2
+
3
+ - form_for :snippet, :url => {:action => :create } do |form|
4
+ = render :partial => form
5
+ .submit
6
+ = form.submit 'Create Snippet'
7
+ or
8
+ = link_to 'Return to List', cms_admin_snippets_path
@@ -0,0 +1,27 @@
1
+ pub_date = @cms_page_children.first.try(:created_at) || Time.now
2
+
3
+ xml.instruct!
4
+
5
+ xml.rss(:version => '2.0') do
6
+ xml.channel do
7
+ xml.title @cms_page.label
8
+ xml.description '' # @cms_page.content
9
+ xml.link "http://#{request.host}"
10
+ xml.language 'en-US'
11
+ xml.pubDate pub_date.utc.strftime("%d %b %Y %H:%M:%S GMT")
12
+ xml.lastBuildDate Time.now.utc.strftime("%d %b %Y %H:%M:%S GMT")
13
+
14
+ @cms_page_children.each do |page|
15
+ link = "http://#{request.host}#{page.full_path}"
16
+ xml.item do
17
+ xml.title page.label
18
+ xml.link link
19
+ xml.description do
20
+ xml.cdata! page.rendered_content
21
+ end
22
+ xml.pubDate page.created_at.utc.strftime("%d %b %Y %H:%M:%S GMT")
23
+ xml.guid link
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,16 @@
1
+ xml.instruct!
2
+
3
+ xml.urlset(
4
+ "xmlns" => "http://www.google.com/schemas/sitemap/0.84",
5
+ "xmlns:xsi" => "http://www.w3.org/3004/XMLSchema-instance",
6
+ "xsi:schemaLocation" => "http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd"
7
+ ) do
8
+
9
+ @cms_pages.each do |page|
10
+ xml.url do
11
+ xml.loc "http://#{request.host_with_port}" + page.full_path
12
+ xml.lastmod page.updated_at.utc.strftime("%Y-%m-%dT%H:%M:%S+00:00")
13
+ xml.changefreq 'daily'
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,44 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title
5
+ = stylesheet_link_tag 'cms_master'
6
+ = javascript_include_tag 'prototype', 'effects', 'controls', 'dragdrop', 'cms/utilities', 'codemirror/codemirror', 'tiny_mce/tiny_mce', 'cms/mce_init', 'cms/codemirror_init'
7
+ = calendar_date_select_includes
8
+
9
+ = yield :head
10
+
11
+ %body{ :id => "#{params[:controller]}_#{params[:action]}".idify }
12
+
13
+ .header
14
+ %h1= link_to application_name, '/cms-admin'
15
+
16
+ .content_wrapper
17
+ .left_navigation_column
18
+
19
+ %ul.primary
20
+ %li= active_link_to 'Layouts', cms_admin_layouts_path
21
+ %li= active_link_to 'Pages', cms_admin_pages_path, :active => {:when => [['cms_admin/pages'], %w(index new edit create update)]}
22
+ %li= active_link_to 'Snippets', cms_admin_snippets_path
23
+ %li= active_link_to 'Attachments', cms_admin_attachments_path
24
+ %li= active_link_to 'Categories', cms_admin_categories_path
25
+
26
+ - unless CmsPage.sections.blank?
27
+ %ul.secondary
28
+ - CmsPage.sections.all.each do |page|
29
+ %li= active_link_to page.label, cms_admin_section_path(page.id)
30
+
31
+ - unless ComfortableMexicanSofa::Config.additional_cms_tabs.blank?
32
+ %ul.secondary
33
+ - ComfortableMexicanSofa::Config.additional_cms_tabs.each do |label, url|
34
+ %li= active_link_to label, url
35
+
36
+ .content_column
37
+ - flash.each do |type, value|
38
+ .flash{:class => type.to_s}
39
+ = value
40
+
41
+ = yield
42
+
43
+ .footer
44
+ The Working Group © 2009
@@ -0,0 +1,254 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{comfortable_mexican_sofa}
8
+ s.version = "0.0.18"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Oleg Khabarov, The Working Group Inc"]
12
+ s.date = %q{2009-10-15}
13
+ s.description = %q{}
14
+ s.email = %q{oleg@theworkinggroup.ca}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".gitignore",
21
+ "CHANGELOG.rdoc",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "app/controllers/cms_admin/attachments_controller.rb",
27
+ "app/controllers/cms_admin/base_controller.rb",
28
+ "app/controllers/cms_admin/categories_controller.rb",
29
+ "app/controllers/cms_admin/layouts_controller.rb",
30
+ "app/controllers/cms_admin/pages_controller.rb",
31
+ "app/controllers/cms_admin/sections_controller.rb",
32
+ "app/controllers/cms_admin/snippets_controller.rb",
33
+ "app/controllers/cms_common/render_page.rb",
34
+ "app/controllers/cms_content_controller.rb",
35
+ "app/helpers/cms_helper.rb",
36
+ "app/models/cms_attachment.rb",
37
+ "app/models/cms_attachment_categorization.rb",
38
+ "app/models/cms_block.rb",
39
+ "app/models/cms_category.rb",
40
+ "app/models/cms_layout.rb",
41
+ "app/models/cms_page.rb",
42
+ "app/models/cms_page_categorization.rb",
43
+ "app/models/cms_snippet.rb",
44
+ "app/views/cms_admin/attachments/_details.html.haml",
45
+ "app/views/cms_admin/attachments/_form.html.haml",
46
+ "app/views/cms_admin/attachments/edit.html.haml",
47
+ "app/views/cms_admin/attachments/index.html.haml",
48
+ "app/views/cms_admin/attachments/new.html.haml",
49
+ "app/views/cms_admin/categories/_category.html.haml",
50
+ "app/views/cms_admin/categories/_category_subform.html.haml",
51
+ "app/views/cms_admin/categories/_form.html.haml",
52
+ "app/views/cms_admin/categories/_new.html.haml",
53
+ "app/views/cms_admin/categories/_toggle_link.html.haml",
54
+ "app/views/cms_admin/categories/_tree_branch.html.haml",
55
+ "app/views/cms_admin/categories/children.js.rjs",
56
+ "app/views/cms_admin/categories/create.js.rjs",
57
+ "app/views/cms_admin/categories/edit.html.haml",
58
+ "app/views/cms_admin/categories/index.html.haml",
59
+ "app/views/cms_admin/categories/new.html.haml",
60
+ "app/views/cms_admin/categories/show.html.haml",
61
+ "app/views/cms_admin/layouts/_details.html.haml",
62
+ "app/views/cms_admin/layouts/_form.html.haml",
63
+ "app/views/cms_admin/layouts/_toggle_link.html.haml",
64
+ "app/views/cms_admin/layouts/_tree_branch.html.haml",
65
+ "app/views/cms_admin/layouts/children.js.rjs",
66
+ "app/views/cms_admin/layouts/edit.html.haml",
67
+ "app/views/cms_admin/layouts/index.html.haml",
68
+ "app/views/cms_admin/layouts/new.html.haml",
69
+ "app/views/cms_admin/pages/_details.html.haml",
70
+ "app/views/cms_admin/pages/_form.html.haml",
71
+ "app/views/cms_admin/pages/_form_blocks.html.haml",
72
+ "app/views/cms_admin/pages/_toggle_link.html.haml",
73
+ "app/views/cms_admin/pages/_tree_branch.html.haml",
74
+ "app/views/cms_admin/pages/children.js.rjs",
75
+ "app/views/cms_admin/pages/edit.html.haml",
76
+ "app/views/cms_admin/pages/form_blocks.js.rjs",
77
+ "app/views/cms_admin/pages/index.html.haml",
78
+ "app/views/cms_admin/pages/new.html.haml",
79
+ "app/views/cms_admin/sections/show.html.haml",
80
+ "app/views/cms_admin/snippets/_form.html.haml",
81
+ "app/views/cms_admin/snippets/edit.html.haml",
82
+ "app/views/cms_admin/snippets/index.html.haml",
83
+ "app/views/cms_admin/snippets/new.html.haml",
84
+ "app/views/cms_content/show.xml.rxml",
85
+ "app/views/cms_content/sitemap.xml.rxml",
86
+ "app/views/layouts/cms_admin.html.haml",
87
+ "comfortable_mexican_sofa.gemspec",
88
+ "config/cms_routes.rb",
89
+ "generators/cms/cms_generator.rb",
90
+ "generators/cms/templates/README",
91
+ "generators/cms/templates/images/arrow_bottom.gif",
92
+ "generators/cms/templates/images/arrow_right.gif",
93
+ "generators/cms/templates/images/icon_attachment.gif",
94
+ "generators/cms/templates/images/icon_category.gif",
95
+ "generators/cms/templates/images/icon_draft.gif",
96
+ "generators/cms/templates/images/icon_layout.gif",
97
+ "generators/cms/templates/images/icon_move.gif",
98
+ "generators/cms/templates/images/icon_regular.gif",
99
+ "generators/cms/templates/images/icon_snippet.gif",
100
+ "generators/cms/templates/images/logo.png",
101
+ "generators/cms/templates/initializers/cms.rb",
102
+ "generators/cms/templates/initializers/paperclip.rb",
103
+ "generators/cms/templates/javascripts/codemirror_init.js",
104
+ "generators/cms/templates/javascripts/mce_init.js",
105
+ "generators/cms/templates/javascripts/utilities.js",
106
+ "generators/cms/templates/migrations/create_cms.rb",
107
+ "generators/cms/templates/stylesheets/cms_master.sass",
108
+ "init.rb",
109
+ "lib/comfortable_mexican_sofa.rb",
110
+ "lib/comfortable_mexican_sofa/acts_as_categorized.rb",
111
+ "lib/comfortable_mexican_sofa/acts_as_published.rb",
112
+ "lib/comfortable_mexican_sofa/cms_acts_as_tree.rb",
113
+ "lib/comfortable_mexican_sofa/cms_rails_extensions.rb",
114
+ "lib/comfortable_mexican_sofa/cms_tag.rb",
115
+ "lib/comfortable_mexican_sofa/cms_tags/attachment.rb",
116
+ "lib/comfortable_mexican_sofa/cms_tags/block.rb",
117
+ "lib/comfortable_mexican_sofa/cms_tags/helper.rb",
118
+ "lib/comfortable_mexican_sofa/cms_tags/page_block.rb",
119
+ "lib/comfortable_mexican_sofa/cms_tags/partial.rb",
120
+ "lib/comfortable_mexican_sofa/cms_tags/snippet.rb",
121
+ "rails/init.rb",
122
+ "test/fixtures/cms_attachment_categorizations.yml",
123
+ "test/fixtures/cms_attachments.yml",
124
+ "test/fixtures/cms_blocks.yml",
125
+ "test/fixtures/cms_categories.yml",
126
+ "test/fixtures/cms_layouts.yml",
127
+ "test/fixtures/cms_page_categorizations.yml",
128
+ "test/fixtures/cms_pages.yml",
129
+ "test/fixtures/cms_snippets.yml",
130
+ "test/fixtures/files/upload_file.txt",
131
+ "test/functional/cms_admin/attachments_controller_test.rb",
132
+ "test/functional/cms_admin/categories_controller_test.rb",
133
+ "test/functional/cms_admin/layouts_controller_test.rb",
134
+ "test/functional/cms_admin/pages_controller_test.rb",
135
+ "test/functional/cms_admin/sections_controller_test.rb",
136
+ "test/functional/cms_admin/snippets_controller_test.rb",
137
+ "test/functional/cms_content_controller_test.rb",
138
+ "test/models/cms_attachment_test.rb",
139
+ "test/models/cms_block_test.rb",
140
+ "test/models/cms_categorization_test.rb",
141
+ "test/models/cms_category_test.rb",
142
+ "test/models/cms_layout_test.rb",
143
+ "test/models/cms_page_test.rb",
144
+ "test/models/cms_snippet_test.rb",
145
+ "test/models/cms_tag_test.rb",
146
+ "test/rails_root/README",
147
+ "test/rails_root/Rakefile",
148
+ "test/rails_root/app/controllers/application_controller.rb",
149
+ "test/rails_root/app/helpers/application_helper.rb",
150
+ "test/rails_root/app/views/cms/under-development.html.haml",
151
+ "test/rails_root/app/views/complex_page/_example.html.erb",
152
+ "test/rails_root/config/boot.rb",
153
+ "test/rails_root/config/database.yml",
154
+ "test/rails_root/config/environment.rb",
155
+ "test/rails_root/config/environments/development.rb",
156
+ "test/rails_root/config/environments/production.rb",
157
+ "test/rails_root/config/environments/test.rb",
158
+ "test/rails_root/config/initializers/backtrace_silencers.rb",
159
+ "test/rails_root/config/initializers/inflections.rb",
160
+ "test/rails_root/config/initializers/mime_types.rb",
161
+ "test/rails_root/config/initializers/new_rails_defaults.rb",
162
+ "test/rails_root/config/initializers/session_store.rb",
163
+ "test/rails_root/config/locales/en.yml",
164
+ "test/rails_root/config/routes.rb",
165
+ "test/rails_root/doc/README_FOR_APP",
166
+ "test/rails_root/public/404.html",
167
+ "test/rails_root/public/422.html",
168
+ "test/rails_root/public/500.html",
169
+ "test/rails_root/public/favicon.ico",
170
+ "test/rails_root/public/images/rails.png",
171
+ "test/rails_root/public/index.html",
172
+ "test/rails_root/public/javascripts/application.js",
173
+ "test/rails_root/public/javascripts/controls.js",
174
+ "test/rails_root/public/javascripts/dragdrop.js",
175
+ "test/rails_root/public/javascripts/effects.js",
176
+ "test/rails_root/public/javascripts/prototype.js",
177
+ "test/rails_root/public/robots.txt",
178
+ "test/rails_root/public/stylesheets/sass/cms_master.sass",
179
+ "test/rails_root/script/about",
180
+ "test/rails_root/script/console",
181
+ "test/rails_root/script/dbconsole",
182
+ "test/rails_root/script/destroy",
183
+ "test/rails_root/script/generate",
184
+ "test/rails_root/script/performance/benchmarker",
185
+ "test/rails_root/script/performance/profiler",
186
+ "test/rails_root/script/plugin",
187
+ "test/rails_root/script/runner",
188
+ "test/rails_root/script/server",
189
+ "test/rails_root/vendor/plugins/.gitignore",
190
+ "test/test_helper.rb"
191
+ ]
192
+ s.homepage = %q{http://theworkinggroup.ca}
193
+ s.rdoc_options = ["--charset=UTF-8"]
194
+ s.require_paths = ["lib"]
195
+ s.rubyforge_project = %q{cms-sofa}
196
+ s.rubygems_version = %q{1.3.5}
197
+ s.summary = %q{ComfortableMexicanSofa is a Rails Engine CMS gem}
198
+ s.test_files = [
199
+ "test/functional/cms_admin/attachments_controller_test.rb",
200
+ "test/functional/cms_admin/categories_controller_test.rb",
201
+ "test/functional/cms_admin/layouts_controller_test.rb",
202
+ "test/functional/cms_admin/pages_controller_test.rb",
203
+ "test/functional/cms_admin/sections_controller_test.rb",
204
+ "test/functional/cms_admin/snippets_controller_test.rb",
205
+ "test/functional/cms_content_controller_test.rb",
206
+ "test/models/cms_attachment_test.rb",
207
+ "test/models/cms_block_test.rb",
208
+ "test/models/cms_categorization_test.rb",
209
+ "test/models/cms_category_test.rb",
210
+ "test/models/cms_layout_test.rb",
211
+ "test/models/cms_page_test.rb",
212
+ "test/models/cms_snippet_test.rb",
213
+ "test/models/cms_tag_test.rb",
214
+ "test/rails_root/app/controllers/application_controller.rb",
215
+ "test/rails_root/app/helpers/application_helper.rb",
216
+ "test/rails_root/config/boot.rb",
217
+ "test/rails_root/config/environment.rb",
218
+ "test/rails_root/config/environments/development.rb",
219
+ "test/rails_root/config/environments/production.rb",
220
+ "test/rails_root/config/environments/test.rb",
221
+ "test/rails_root/config/initializers/backtrace_silencers.rb",
222
+ "test/rails_root/config/initializers/inflections.rb",
223
+ "test/rails_root/config/initializers/mime_types.rb",
224
+ "test/rails_root/config/initializers/new_rails_defaults.rb",
225
+ "test/rails_root/config/initializers/session_store.rb",
226
+ "test/rails_root/config/routes.rb",
227
+ "test/test_helper.rb"
228
+ ]
229
+
230
+ if s.respond_to? :specification_version then
231
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
232
+ s.specification_version = 3
233
+
234
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
235
+ s.add_runtime_dependency(%q<haml>, [">= 0"])
236
+ s.add_runtime_dependency(%q<will_paginate>, [">= 0"])
237
+ s.add_runtime_dependency(%q<paperclip>, [">= 0"])
238
+ s.add_runtime_dependency(%q<calendar_date_select>, [">= 0"])
239
+ s.add_runtime_dependency(%q<active_link_to>, [">= 0"])
240
+ else
241
+ s.add_dependency(%q<haml>, [">= 0"])
242
+ s.add_dependency(%q<will_paginate>, [">= 0"])
243
+ s.add_dependency(%q<paperclip>, [">= 0"])
244
+ s.add_dependency(%q<calendar_date_select>, [">= 0"])
245
+ s.add_dependency(%q<active_link_to>, [">= 0"])
246
+ end
247
+ else
248
+ s.add_dependency(%q<haml>, [">= 0"])
249
+ s.add_dependency(%q<will_paginate>, [">= 0"])
250
+ s.add_dependency(%q<paperclip>, [">= 0"])
251
+ s.add_dependency(%q<calendar_date_select>, [">= 0"])
252
+ s.add_dependency(%q<active_link_to>, [">= 0"])
253
+ end
254
+ end