mcms_blog 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/images/icons/accept.png +0 -0
  5. data/app/assets/images/icons/add.png +0 -0
  6. data/app/assets/images/icons/ajax-loader.gif +0 -0
  7. data/app/assets/images/icons/application_edit.png +0 -0
  8. data/app/assets/images/icons/application_go.png +0 -0
  9. data/app/assets/images/icons/arrow_left.png +0 -0
  10. data/app/assets/images/icons/arrow_switch.png +0 -0
  11. data/app/assets/images/icons/arrow_up.png +0 -0
  12. data/app/assets/images/icons/bin.png +0 -0
  13. data/app/assets/images/icons/bin_closed.png +0 -0
  14. data/app/assets/images/icons/cancel.png +0 -0
  15. data/app/assets/images/icons/cog_add.png +0 -0
  16. data/app/assets/images/icons/cog_edit.png +0 -0
  17. data/app/assets/images/icons/cross.png +0 -0
  18. data/app/assets/images/icons/delete.png +0 -0
  19. data/app/assets/images/icons/doc.png +0 -0
  20. data/app/assets/images/icons/down.gif +0 -0
  21. data/app/assets/images/icons/edit.png +0 -0
  22. data/app/assets/images/icons/email.png +0 -0
  23. data/app/assets/images/icons/email_edit.png +0 -0
  24. data/app/assets/images/icons/email_go.png +0 -0
  25. data/app/assets/images/icons/email_open.png +0 -0
  26. data/app/assets/images/icons/eye.png +0 -0
  27. data/app/assets/images/icons/folder_page_white.png +0 -0
  28. data/app/assets/images/icons/image_add.png +0 -0
  29. data/app/assets/images/icons/image_edit.png +0 -0
  30. data/app/assets/images/icons/img.png +0 -0
  31. data/app/assets/images/icons/information.png +0 -0
  32. data/app/assets/images/icons/layout_add.png +0 -0
  33. data/app/assets/images/icons/layout_edit.png +0 -0
  34. data/app/assets/images/icons/music.png +0 -0
  35. data/app/assets/images/icons/page_add.png +0 -0
  36. data/app/assets/images/icons/page_edit.png +0 -0
  37. data/app/assets/images/icons/page_white_edit.png +0 -0
  38. data/app/assets/images/icons/page_white_gear.png +0 -0
  39. data/app/assets/images/icons/page_white_put.png +0 -0
  40. data/app/assets/images/icons/pdf.png +0 -0
  41. data/app/assets/images/icons/ppt.png +0 -0
  42. data/app/assets/images/icons/star.png +0 -0
  43. data/app/assets/images/icons/tick.png +0 -0
  44. data/app/assets/images/icons/up.gif +0 -0
  45. data/app/assets/images/icons/user_add.png +0 -0
  46. data/app/assets/images/icons/user_comment.png +0 -0
  47. data/app/assets/images/icons/user_edit.png +0 -0
  48. data/app/assets/images/icons/xls.png +0 -0
  49. data/app/assets/images/icons/zip.png +0 -0
  50. data/app/assets/images/icons/zoom.png +0 -0
  51. data/app/assets/images/page_bg.png +0 -0
  52. data/app/assets/images/rails.png +0 -0
  53. data/app/assets/javascripts/admin/blog/mcms-blog-submenu.js +50 -0
  54. data/app/assets/javascripts/contrib/ui.core.js +519 -0
  55. data/app/assets/javascripts/contrib/ui.tabs.js +688 -0
  56. data/app/assets/javascripts/posts.js +3 -0
  57. data/app/assets/stylesheets/blog_global.css +1587 -0
  58. data/app/assets/stylesheets/blog_home.css +1432 -0
  59. data/app/assets/stylesheets/home.css +1429 -0
  60. data/app/assets/stylesheets/images/back_ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
  61. data/app/assets/stylesheets/images/spellayt.gif +0 -0
  62. data/app/assets/stylesheets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  63. data/app/assets/stylesheets/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
  64. data/app/assets/stylesheets/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  65. data/app/assets/stylesheets/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  66. data/app/assets/stylesheets/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  67. data/app/assets/stylesheets/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  68. data/app/assets/stylesheets/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  69. data/app/assets/stylesheets/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  70. data/app/assets/stylesheets/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  71. data/app/assets/stylesheets/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
  72. data/app/assets/stylesheets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  73. data/app/assets/stylesheets/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
  74. data/app/assets/stylesheets/images/ui-bg_green.png +1 -0
  75. data/app/assets/stylesheets/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  76. data/app/assets/stylesheets/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  77. data/app/assets/stylesheets/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  78. data/app/assets/stylesheets/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  79. data/app/assets/stylesheets/images/ui-icons_217bc0_256x240.png +0 -0
  80. data/app/assets/stylesheets/images/ui-icons_222222_256x240.png +0 -0
  81. data/app/assets/stylesheets/images/ui-icons_2e83ff_256x240.png +0 -0
  82. data/app/assets/stylesheets/images/ui-icons_454545_256x240.png +0 -0
  83. data/app/assets/stylesheets/images/ui-icons_469bdd_256x240.png +0 -0
  84. data/app/assets/stylesheets/images/ui-icons_6da8d5_256x240.png +0 -0
  85. data/app/assets/stylesheets/images/ui-icons_888888_256x240.png +0 -0
  86. data/app/assets/stylesheets/images/ui-icons_cd0a0a_256x240.png +0 -0
  87. data/app/assets/stylesheets/images/ui-icons_d8e7f3_256x240.png +0 -0
  88. data/app/assets/stylesheets/images/ui-icons_f9bd01_256x240.png +0 -0
  89. data/app/assets/stylesheets/jquery-ui-1.8.6.custom.css +572 -0
  90. data/app/assets/stylesheets/submenu.css.scss +32 -0
  91. data/app/controllers/admin/blog/categories_controller.rb +47 -0
  92. data/app/controllers/admin/blog/comments_controller.rb +64 -0
  93. data/app/controllers/admin/blog/posts_controller.rb +80 -0
  94. data/app/controllers/admin/blog/settings_controller.rb +67 -0
  95. data/app/controllers/application_controller.rb +29 -0
  96. data/app/controllers/blog/categories_controller.rb +34 -0
  97. data/app/controllers/blog/comments_controller.rb +34 -0
  98. data/app/controllers/blog/posts_controller.rb +123 -0
  99. data/app/controllers/blog_controller.rb +31 -0
  100. data/app/helpers/application_helper.rb +5 -0
  101. data/app/helpers/blog_helper.rb +66 -0
  102. data/app/helpers/notification_hepler.rb +5 -0
  103. data/app/helpers/settings_helper.rb +38 -0
  104. data/app/mailers/blog/comment_mailer.rb +12 -0
  105. data/app/models/blog_category.rb +29 -0
  106. data/app/models/blog_comment.rb +109 -0
  107. data/app/models/blog_post.rb +121 -0
  108. data/app/models/categorization.rb +16 -0
  109. data/app/models/ckeditor/asset.rb +6 -0
  110. data/app/models/ckeditor/attachment_file.rb +12 -0
  111. data/app/models/ckeditor/picture.rb +13 -0
  112. data/app/models/setting.rb +59 -0
  113. data/app/views/admin/blog/_submenu.html.erb +89 -0
  114. data/app/views/admin/blog/categories/_category.html.erb +20 -0
  115. data/app/views/admin/blog/categories/_form.html.erb +21 -0
  116. data/app/views/admin/blog/categories/_sortable_list.html.erb +3 -0
  117. data/app/views/admin/blog/categories/edit.html.erb +1 -0
  118. data/app/views/admin/blog/categories/index.html.erb +23 -0
  119. data/app/views/admin/blog/categories/new.html.erb +2 -0
  120. data/app/views/admin/blog/comments/_comment.html.erb +27 -0
  121. data/app/views/admin/blog/comments/_sortable_list.html.erb +11 -0
  122. data/app/views/admin/blog/comments/index.html.erb +12 -0
  123. data/app/views/admin/blog/comments/show.html.erb +70 -0
  124. data/app/views/admin/blog/posts/_form.css.erb +22 -0
  125. data/app/views/admin/blog/posts/_form.html.erb +92 -0
  126. data/app/views/admin/blog/posts/_form.js.erb +34 -0
  127. data/app/views/admin/blog/posts/_form_part.html.erb +10 -0
  128. data/app/views/admin/blog/posts/_post.html.erb +26 -0
  129. data/app/views/admin/blog/posts/_sortable_list.html.erb +3 -0
  130. data/app/views/admin/blog/posts/_teaser_part.html.erb +11 -0
  131. data/app/views/admin/blog/posts/edit.html.erb +1 -0
  132. data/app/views/admin/blog/posts/index.html.erb +29 -0
  133. data/app/views/admin/blog/posts/new.html.erb +13 -0
  134. data/app/views/admin/blog/settings/notification_recipients.html.erb +23 -0
  135. data/app/views/blog/categories/show.html.erb +17 -0
  136. data/app/views/blog/posts/_comment.html.erb +17 -0
  137. data/app/views/blog/posts/_nav.html.erb +18 -0
  138. data/app/views/blog/posts/_post.html.erb +25 -0
  139. data/app/views/blog/posts/archive.html.erb +17 -0
  140. data/app/views/blog/posts/index.html.erb +15 -0
  141. data/app/views/blog/posts/show.html.erb +64 -0
  142. data/app/views/blog/posts/tagged.html.erb +20 -0
  143. data/app/views/blog/shared/_categories.html.erb +19 -0
  144. data/app/views/blog/shared/_post.html.erb +34 -0
  145. data/app/views/blog/shared/_posts.html.erb +17 -0
  146. data/app/views/blog/shared/_rss_feed.html.erb +2 -0
  147. data/app/views/blog/shared/_tags.html.erb +17 -0
  148. data/app/views/layouts/_javascript.html.erb +3 -0
  149. data/app/views/layouts/_scripts.html.erb +6 -0
  150. data/app/views/layouts/_stylesheets.html.erb +6 -0
  151. data/app/views/layouts/admin.html.erb +25 -0
  152. data/app/views/layouts/application.html.erb +38 -0
  153. data/app/views/layouts/home.html.erb +38 -0
  154. data/app/views/shared/_footer.html.erb +3 -0
  155. data/app/views/shared/_head.html.erb +4 -0
  156. data/app/views/shared/_header.html.erb +7 -0
  157. data/app/views/shared/_javascripts.html.erb +3 -0
  158. data/app/views/shared/_menu.html.erb +9 -0
  159. data/app/views/shared/_stylesheets.html.erb +6 -0
  160. data/app/views/shared/admin/_error_messages.html.erb +16 -0
  161. data/app/views/shared/admin/_form_actions.html.erb +34 -0
  162. data/config/locales/en.yml +192 -0
  163. data/config/routes.rb +65 -0
  164. data/db/migrate/20120606150655_create_mcms_assets.rb +26 -0
  165. data/db/migrate/20120608071959_create_blog_categories.rb +9 -0
  166. data/db/migrate/20120608072013_create_blog_comments.rb +14 -0
  167. data/db/migrate/20120608072027_create_blog_posts.rb +16 -0
  168. data/db/migrate/20120612055745_create_categorizations.rb +9 -0
  169. data/db/migrate/20120618104134_add_index_in_blog_comments.rb +5 -0
  170. data/db/migrate/20120618105246_add_custom_index_in_mcms_blog_comments.rb +5 -0
  171. data/db/migrate/20120618105511_add_custom_index_in_mcms_blog_posts.rb +5 -0
  172. data/db/migrate/20120619094143_create_settings.rb +12 -0
  173. data/db/migrate/20120627063009_acts_as_taggable_on_migration.rb +28 -0
  174. data/db/migrate/20120629065434_add_slug_to_blog_post.rb +6 -0
  175. data/db/migrate/20120629113457_add_slug_to_mcms_blog_category.rb +6 -0
  176. data/db/seeds.rb +26 -0
  177. data/lib/generators/mcms_blog/USAGE +8 -0
  178. data/lib/generators/mcms_blog/mcms_blog_generator.rb +60 -0
  179. data/lib/generators/mcms_blog/templates/asset_manager.rb +107 -0
  180. data/lib/generators/mcms_blog/templates/ckeditor.rb +18 -0
  181. data/lib/mcms_blog/engine.rb +18 -0
  182. data/lib/mcms_blog/version.rb +3 -0
  183. data/lib/mcms_blog.rb +4 -0
  184. data/lib/tasks/mcms_blog_tasks.rake +4 -0
  185. data/test/dummy/README.rdoc +261 -0
  186. data/test/dummy/Rakefile +7 -0
  187. data/test/dummy/app/assets/javascripts/application.js +15 -0
  188. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  189. data/test/dummy/app/controllers/application_controller.rb +3 -0
  190. data/test/dummy/app/helpers/application_helper.rb +2 -0
  191. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  192. data/test/dummy/config/application.rb +59 -0
  193. data/test/dummy/config/boot.rb +10 -0
  194. data/test/dummy/config/database.yml +25 -0
  195. data/test/dummy/config/environment.rb +5 -0
  196. data/test/dummy/config/environments/development.rb +37 -0
  197. data/test/dummy/config/environments/production.rb +67 -0
  198. data/test/dummy/config/environments/test.rb +37 -0
  199. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  200. data/test/dummy/config/initializers/inflections.rb +15 -0
  201. data/test/dummy/config/initializers/mime_types.rb +5 -0
  202. data/test/dummy/config/initializers/secret_token.rb +7 -0
  203. data/test/dummy/config/initializers/session_store.rb +8 -0
  204. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  205. data/test/dummy/config/locales/en.yml +5 -0
  206. data/test/dummy/config/routes.rb +58 -0
  207. data/test/dummy/config.ru +4 -0
  208. data/test/dummy/public/404.html +26 -0
  209. data/test/dummy/public/422.html +26 -0
  210. data/test/dummy/public/500.html +25 -0
  211. data/test/dummy/public/favicon.ico +0 -0
  212. data/test/dummy/script/rails +6 -0
  213. data/test/integration/navigation_test.rb +10 -0
  214. data/test/mcms_blog_test.rb +7 -0
  215. data/test/test_helper.rb +15 -0
  216. metadata +403 -0
@@ -0,0 +1,38 @@
1
+ <!DOCTYPE html>
2
+ <head>
3
+ <%= render :partial => "/shared/javascripts" %>
4
+ <%= render :partial => "/shared/stylesheets" %>
5
+ </head>
6
+ <% site_bar = render(:partial => "/shared/site_bar", :locals => {:head => true}) -%>
7
+ <%= render :partial => "/shared/head" %>
8
+
9
+ <body>
10
+ <%= site_bar -%>
11
+ <%= render :partial => "/shared/ie6check" if request.env['HTTP_USER_AGENT'] =~ /MSIE/ -%>
12
+ <div id="container">
13
+ <div id="container-inner" class="pkg">
14
+ <div id="pagebody">
15
+ <div id="pagebody-inner" class="pkg">
16
+ <div id="beta">
17
+ <div id="beta-inner" class="pkg">
18
+ <%= yield %>
19
+ </div>
20
+ </div>
21
+ <div id="gamma">
22
+ <div id="gamma-inner" class="pkg">
23
+ <%= render :partial => "/blog/shared/categories" %>
24
+ <%= render :partial => "/blog/shared/tags" %>
25
+ <%= render :partial => "/blog/shared/rss_feed" %>
26
+ <%= blog_archive_list %>
27
+ </div>
28
+ </div>
29
+ </section>
30
+ </div>
31
+ </div>
32
+ <footer>
33
+ <%= render :partial => "/shared/footer" -%>
34
+ </footer>
35
+ </div>
36
+ </div>
37
+ </body>
38
+ </html>
@@ -0,0 +1,3 @@
1
+ <p>
2
+ <%= "Company Name"%>
3
+ </p>
@@ -0,0 +1,4 @@
1
+ <head>
2
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
3
+ <title><%= 'home' %></title>
4
+ </head>
@@ -0,0 +1,7 @@
1
+ <h1 id='logo'>
2
+ <%= link_to "home", '' %>
3
+ </h1>
4
+ <%= render(:partial => "/shared/menu", :locals => {
5
+ :dom_id => 'menu',
6
+ :css => 'menu'
7
+ }) %>
@@ -0,0 +1,3 @@
1
+ <% AssetManager.get_libraries.each do |library| %>
2
+ <%= javascript_include_tag library %>
3
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <%
2
+ # Collect the root items.
3
+ # Refinery::Menu is smart enough to remember all of the items in the original collection.
4
+ %>
5
+ <nav>
6
+ <ul>
7
+ <%=link_to 'home', ''%>
8
+ </ul>
9
+ </nav>
@@ -0,0 +1,6 @@
1
+ <% AssetManager.get_css.each do |css| %>
2
+ <%= stylesheet_link_tag css %>
3
+ <% end %>
4
+
5
+
6
+ <%= stylesheet_link_tag "jquery-ui-1.8.6.custom.css" %>
@@ -0,0 +1,16 @@
1
+ <% if object.errors.any? %>
2
+ <div class="errorExplanation" id="errorExplanation">
3
+ <p><%= t('.problems_in_following_fields') %>:</p>
4
+ <ul>
5
+ <% unless defined?(include_object_name) and include_object_name %>
6
+ <% object.errors.each do |key, value| %>
7
+ <li><%= value %></li>
8
+ <% end %>
9
+ <% else %>
10
+ <% object.errors.full_messages.each do |value| %>
11
+ <li><%= value %></li>
12
+ <% end %>
13
+ <% end %>
14
+ </ul>
15
+ </div>
16
+ <% end %>
@@ -0,0 +1,34 @@
1
+ <!--
2
+ @Name: views/shared/admin/_form_actions.html.erb
3
+ @Use: This is a partial for common submit button
4
+ @Created date: 08-06-2012
5
+ @Modified Date: 12-06-2012
6
+ @Company: Mindfire Solutions
7
+ -->
8
+ <%
9
+ submit_button_text ||= t('.save')
10
+ submit_button_id ||= "submit_button"
11
+ submit_button_title ||= nil
12
+ cancel_button_text ||= t('.cancel')
13
+ cancel_title = t('.cancel_lose_changes')
14
+ cancel_button_id ||= "cancel_button"
15
+ cancel_url ||= root_path
16
+ %>
17
+ <div class='form-actions'>
18
+ <div class='form-actions-left'>
19
+ <%= submit_tag submit_button_text,
20
+ :id => submit_button_id,
21
+ :name => nil,
22
+ :class => "wymupdate button",
23
+ :tooltip => submit_button_title %>
24
+
25
+
26
+
27
+
28
+ <%= link_to(cancel_button_text, cancel_url,
29
+ :title => cancel_title,
30
+ :id => cancel_button_id,
31
+ :class => "close_dialog button") %>
32
+ </div>
33
+
34
+ </div>
@@ -0,0 +1,192 @@
1
+ en:
2
+ plugins:
3
+ refinerycms_blog:
4
+ title: Blog
5
+ admin:
6
+ blog:
7
+ categories:
8
+ category:
9
+ edit: Edit this category
10
+ delete: Delete this category forever
11
+ index:
12
+ no_items_yet: 'There are no categories yet. Click "%{create}" to add your first category.'
13
+ comments:
14
+ approved: 'The comment from "%{author}" has been approved.'
15
+ comment:
16
+ view_live_html: 'View this comment live <br/><em>(opens in a new window)</em>'
17
+ read: Read this comment
18
+ reject: Reject this comment
19
+ approve: Approve this comment
20
+ rejected: 'The comment from "%{author}" has been rejected.'
21
+ index:
22
+ no_items_yet: 'There are no %{type} comments.'
23
+ show:
24
+ comment: Comment
25
+ blog_post: Blog Post
26
+ from: Posted by
27
+ date: Posted at
28
+ message: Comment
29
+ details: Details
30
+ age: Age
31
+ actions: Actions
32
+ back: Back to all comments
33
+ reject: Reject this comment
34
+ approve: Approve this comment
35
+ posts:
36
+ form:
37
+ advanced_options: Advanced Options
38
+ toggle_advanced_options: Click to access meta tag settings and menu options
39
+ save_as_draft: Save as Draft
40
+ published_at: Publish Date
41
+ custom_url: Custom Url
42
+ custom_url_help: Generate the url for the blog post from this text instead of the title.
43
+ copy_body: Copy Post Body to Teaser
44
+ copy_body_help: Copies the post body to the teaser. Leave teaser blank to let Refinery automatically make the teaser.
45
+ index:
46
+ no_items_yet: 'There are no Blog Posts yet. Click "%{create}" to add your first blog post.'
47
+ uncategorized:
48
+ no_items_yet: 'There are no Uncategorized Blog Posts.'
49
+ post:
50
+ view_live_html: 'View this blog post live <br/><em>(opens in a new window)</em>'
51
+ edit: Edit this blog post
52
+ delete: Remove this blog post forever
53
+ settings:
54
+ notification_recipients:
55
+ value: Send notifications to
56
+ explanation: 'Every time someone comments on a blog post, Refinery sends out an email to say there is a new comment.'
57
+ hint: 'When a new comment is added, MCMS will send an email notification to you.'
58
+ example: "Enter your email address(es) like: jack@work.com, jill@office.com"
59
+ updated: 'Notification recipients have been set to "%{recipients}"'
60
+ submenu:
61
+ categories:
62
+ title: Categories
63
+ manage: Manage
64
+ new: Create new category
65
+ comments:
66
+ title: Comments
67
+ title_with_count: 'Comments (%{new_count} new)'
68
+ new: New
69
+ unmoderated: New
70
+ approved: Approved
71
+ rejected: Rejected
72
+ posts:
73
+ title: Posts
74
+ manage: Manage posts
75
+ new: Create new post
76
+ uncategorized: Uncategorized posts
77
+ settings:
78
+ title: Settings
79
+ moderation: Moderation
80
+ update_notified: Update who gets notified
81
+ comments: Comments
82
+ blog:
83
+ comment_mailer:
84
+ notification:
85
+ greeting: Hi there
86
+ you_recieved_new_comment: You just received a new comment on your website.
87
+ comment_starts: --- comment starts ---
88
+ comment_ends: --- comment ends ---
89
+ from: From
90
+ email: Email
91
+ message: Message
92
+ closing_line: Kind Regards
93
+ ps: 'P.S. All your comments are stored in the "Blog" section of Refinery under the "Comments" submenu should you ever want to view it later there.'
94
+ shared:
95
+ categories:
96
+ title: Categories
97
+ rss_feed:
98
+ title: RSS Feed
99
+ subscribe: Subscribe
100
+ posts:
101
+ other: Other Posts
102
+ created_at: 'Posted on %{when}'
103
+ read_more: Read more
104
+ comments:
105
+ singular: comment
106
+ none: no comments
107
+ archives: Archives
108
+ tags:
109
+ title: "Tags"
110
+ categories:
111
+ show:
112
+ no_posts: There are no posts here yet.
113
+ posts:
114
+ post:
115
+ filed_in: Filed in
116
+ comment: comment
117
+ comments:
118
+ by: 'Posted by %{who}'
119
+ time_ago: '%{time} ago'
120
+ thank_you: 'Thank you for commenting.'
121
+ thank_you_moderated: 'Thank you for commenting. Your message has been placed in the moderation queue and will appear shortly.'
122
+ index:
123
+ no_blog_articles_yet: There are no blog articles posted yet. Stay tuned.
124
+ show:
125
+ blog_home: Blog Home
126
+ comments:
127
+ title: Comments
128
+ add: Make a Comment
129
+ other: Other Blog Posts
130
+ filed_in: Filed in
131
+ tagged: Tagged
132
+ submit: Send comment
133
+ name: Name
134
+ email: Email
135
+ message: Message
136
+ by: by
137
+ tagged:
138
+ no_blog_articles_yet: There are no blog articles posted yet. Stay tuned.
139
+ posts_tagged: Posts tagged
140
+ archive:
141
+ blog_archive_for: 'Blog Archive for %{date}'
142
+ no_blog_articles_posted: 'There are no blog articles posted for %{date}. Stay tuned.'
143
+ activerecord:
144
+ models:
145
+ blog_category: Category
146
+ blog_comment: Comment
147
+ blog_post: Blog post
148
+ attributes:
149
+ blog_category:
150
+ title: Title
151
+ blog_comment:
152
+ name: Name
153
+ email: Email
154
+ message: Message
155
+ blog_post:
156
+ title: Title
157
+ body: Body
158
+ shared:
159
+ site_bar:
160
+ log_out: Log out
161
+ switch_to_your_website: Switch to your website
162
+ switch_to_your_website_editor: Switch to your website editor
163
+ admin:
164
+ continue_editing:
165
+ save_and_continue_editing: 'Save & continue editing'
166
+ form_actions:
167
+ save: Save
168
+ cancel: Cancel
169
+ cancel_lose_changes: If you cancel you will lose any changes you have made here
170
+ delete: Remove
171
+ close: Close
172
+ image_picker:
173
+ none_selected: 'There is currently no %{what} selected, please click here to add one.'
174
+ remove_current: 'Remove current %{what}'
175
+ change: Click here to pick a image
176
+ show: Show
177
+ resource_picker:
178
+ download_current: Download current file
179
+ opens_in_new_window: Opens in a new window
180
+ remove_current: "Remove current file"
181
+ no_resource_selected: 'There is currently no file selected, click here to add one.'
182
+ name: Add File
183
+ current: Current File
184
+ search:
185
+ button_text: Search
186
+ results_for: "Search results for '%{query}'"
187
+ no_results: 'Sorry, no results found'
188
+ delete:
189
+ message: "Are you sure you want to remove '%{title}'?"
190
+ error_messages:
191
+ problems_in_following_fields: There were problems with the following fields
192
+ help: help
data/config/routes.rb ADDED
@@ -0,0 +1,65 @@
1
+ =begin
2
+ @Name : routes.rb
3
+ @Use : Defines the rails routing for pages
4
+ @Created at :8-6-2012
5
+ @Modified at : 13-06-2012
6
+ @Company : Mindfire Solutions
7
+ =end
8
+ Rails.application.routes.draw do
9
+ mount Ckeditor::Engine => '/ckeditor'
10
+
11
+ root :to => 'admin/blog/posts#index'
12
+ mount Ckeditor::Engine => "/ckeditor"
13
+
14
+ scope(:path => 'blog', :module => 'blog') do
15
+ root :to => 'posts#index', :as => 'blog_root'
16
+ match ':id', :to => 'posts#show', :as => 'blog_post'
17
+ match 'categories/:id', :to => 'categories#show', :as => 'blog_category'
18
+ match 'feed.rss', :to => 'posts#index.rss', :as => 'blog_rss_feed'
19
+ match ':id/comments', :to => 'posts#comment', :as => 'blog_post_blog_comments'
20
+ get 'tagged/:tag_id/:tag_name' => 'posts#tagged', :as => 'tagged_posts'
21
+ get 'archive/:year(/:month)', :to => 'posts#archive', :as => 'archive_blog_posts'
22
+ end
23
+
24
+ #Admin module pages routing
25
+ #scope(:path => 'admin', :module => 'admin') do
26
+ #scope(:path => 'blog', :as => 'blog', :module => 'blog') do #Blog module under admin module pages routing
27
+ namespace :admin, :path => 'mcms' do
28
+ namespace :blog do
29
+ root :to => 'posts#index'
30
+ resources :posts do
31
+ collection do
32
+ get :uncategorized
33
+ get :tags
34
+ end
35
+ end
36
+
37
+ #resource categories
38
+ resources :categories
39
+
40
+ #resource comments
41
+ resources :comments do
42
+ collection do
43
+ get :approved
44
+ get :rejected
45
+ end
46
+ member do
47
+ get :approved
48
+ get :rejected
49
+ end
50
+ end
51
+
52
+ #resource settings
53
+ resources :settings do
54
+ collection do
55
+ get :notification_recipients
56
+ post :notification_recipients
57
+
58
+ get :moderation
59
+ get :comments
60
+ end
61
+ end
62
+ end
63
+ end
64
+
65
+ end
@@ -0,0 +1,26 @@
1
+ class CreateMcmsAssets < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :mcms_assets do |t|
4
+ t.string :data_file_name, :null => false
5
+ t.string :data_content_type
6
+ t.integer :data_file_size
7
+
8
+ t.integer :assetable_id
9
+ t.string :assetable_type, :limit => 30
10
+ t.string :type, :limit => 30
11
+
12
+ # Uncomment it to save images dimensions, if your need it
13
+ t.integer :width
14
+ t.integer :height
15
+
16
+ t.timestamps
17
+ end
18
+
19
+ add_index "mcms_assets", ["assetable_type", "type", "assetable_id"], :name => "idx_ckeditor_assetable_type"
20
+ add_index "mcms_assets", ["assetable_type", "assetable_id"], :name => "idx_ckeditor_assetable"
21
+ end
22
+
23
+ def self.down
24
+ drop_table :mcms_assets
25
+ end
26
+ end
@@ -0,0 +1,9 @@
1
+ class CreateBlogCategories < ActiveRecord::Migration
2
+ def change
3
+ create_table :mcms_blog_categories do |t|
4
+ t.string :title
5
+ t.string :cached_slug
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,14 @@
1
+ class CreateBlogComments < ActiveRecord::Migration
2
+ def change
3
+ create_table :mcms_blog_comments do |t|
4
+ t.integer :blog_post_id
5
+ t.boolean :spam
6
+ t.string :name
7
+ t.string :email
8
+ t.text :body
9
+ t.string :state
10
+
11
+ t.timestamps
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,16 @@
1
+ class CreateBlogPosts < ActiveRecord::Migration
2
+ def change
3
+ create_table :mcms_blog_posts do |t|
4
+ t.string :title
5
+ t.text :body
6
+ t.boolean :draft
7
+ t.datetime :published_at
8
+ t.integer :user_id
9
+ t.text :cached_slug
10
+ t.string :custom_url
11
+ t.string :custom_teaser
12
+
13
+ t.timestamps
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,9 @@
1
+ class CreateCategorizations < ActiveRecord::Migration
2
+ def change
3
+ create_table :mcms_blog_categories_blog_posts do |t|
4
+ t.references :blog_category
5
+ t.references :blog_post
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class AddIndexInBlogComments < ActiveRecord::Migration
2
+ def change
3
+ add_index :mcms_blog_comments, :state
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddCustomIndexInMcmsBlogComments < ActiveRecord::Migration
2
+ def change
3
+ add_index :mcms_blog_comments, :blog_post_id
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddCustomIndexInMcmsBlogPosts < ActiveRecord::Migration
2
+ def change
3
+ add_index :mcms_blog_posts, :user_id
4
+ end
5
+ end
@@ -0,0 +1,12 @@
1
+ class CreateSettings < ActiveRecord::Migration
2
+ def change
3
+ create_table :mcms_settings do |t|
4
+ t.string :name, :null => true
5
+ t.string :value, :null => true
6
+ t.boolean :destroyable, :default => 1
7
+ t.timestamps
8
+ end
9
+
10
+ add_index :mcms_settings, :name, :unique => true
11
+ end
12
+ end
@@ -0,0 +1,28 @@
1
+ class ActsAsTaggableOnMigration < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :tags do |t|
4
+ t.string :name
5
+ end
6
+
7
+ create_table :taggings do |t|
8
+ t.references :tag
9
+
10
+ # You should make sure that the column created is
11
+ # long enough to store the required class names.
12
+ t.references :taggable, :polymorphic => true
13
+ t.references :tagger, :polymorphic => true
14
+
15
+ t.string :context
16
+
17
+ t.datetime :created_at
18
+ end
19
+
20
+ add_index :taggings, :tag_id
21
+ add_index :taggings, [:taggable_id, :taggable_type, :context]
22
+ end
23
+
24
+ def self.down
25
+ drop_table :taggings
26
+ drop_table :taggings
27
+ end
28
+ end
@@ -0,0 +1,6 @@
1
+ class AddSlugToBlogPost < ActiveRecord::Migration
2
+ def change
3
+ add_column :mcms_blog_posts, :slug, :string
4
+ add_index :mcms_blog_posts, :slug, :unique => true
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ class AddSlugToMcmsBlogCategory < ActiveRecord::Migration
2
+ def change
3
+ add_column :mcms_blog_categories, :slug, :string
4
+ add_index :mcms_blog_categories, :slug, :unique => true
5
+ end
6
+ end
data/db/seeds.rb ADDED
@@ -0,0 +1,26 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
+ # Mayor.create(name: 'Emanuel', city: cities.first)
8
+
9
+ Setting.create({
10
+
11
+ :name => "comment_allowed",
12
+ :value => '1',
13
+ :destroyable => '1',
14
+ :created_at => Time.now,
15
+ :updated_at => Time.now
16
+
17
+ })
18
+ Setting.create({
19
+
20
+ :name => "comment_moderation",
21
+ :value => '1',
22
+ :destroyable => '1',
23
+ :created_at => Time.now,
24
+ :updated_at => Time.now
25
+
26
+ })
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Explain the generator
3
+
4
+ Example:
5
+ rails generate mcms_blog Thing
6
+
7
+ This will create:
8
+ what/will/it/create
@@ -0,0 +1,60 @@
1
+ class McmsBlogGenerator < Rails::Generators::NamedBase
2
+ source_root File.expand_path('../templates', __FILE__)
3
+
4
+
5
+ # @Params : None
6
+ # @Returns : None
7
+ # @Purpose : To Copy asset_manager from engine to app
8
+ def copy_asset_manager
9
+
10
+ #copy file lib/asset_manager.rb to app/lib/asset_manager.rb if it doesn't exists
11
+ copy_file "asset_manager.rb", "lib/asset_manager.rb" unless File.exists?(File.join(destination_root, 'lib', 'asset_manager.rb'))
12
+
13
+
14
+ end
15
+
16
+ # @Params : None
17
+ # @Returns : None
18
+ # @Purpose : To Copy initializer from engine to app
19
+ def copy_initializer
20
+
21
+ #copy file lib/asset_manager.rb to app/lib/asset_manager.rb if it doesn't exists
22
+ copy_file "ckeditor.rb", "config/initializers/ckeditor.rb" unless File.exists?(File.join(destination_root, 'config/initializers', 'ckeditor.rb'))
23
+
24
+
25
+ end
26
+
27
+ # @Params : None
28
+ # @Returns : None
29
+ # @Purpose : To Copy all the migrations from db/migrate of engine to db/migrate of application
30
+ def add_migrations
31
+
32
+ say "copying migrations......."
33
+
34
+ # running command line command to copy engine's migration file
35
+ rake("mcms_blog_engine:install:migrations")
36
+
37
+ end # end method
38
+
39
+ # @Params : None
40
+ # @Returns : None
41
+ # @Purpose : To append seeds data from engine to app's seeds.rb
42
+ def append_seed_data
43
+
44
+ # create file db/seeds.rb to parent app if not exists
45
+ create_file "db/seeds.rb" unless File.exists?(File.join(destination_root, 'db', 'seeds.rb'))
46
+
47
+ # append data to app's seeds.rb
48
+ append_file 'db/seeds.rb', :verbose => true do
49
+
50
+ <<-EOH
51
+
52
+ McmsBlog::Engine.load_seed
53
+
54
+ EOH
55
+
56
+ end # end block
57
+
58
+ end # end method
59
+
60
+ end