mcms_blog 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. data/app/assets/images/icons/download.jpeg +0 -0
  2. data/app/assets/javascripts/admin/blog/mcms-blog-submenu.js +61 -44
  3. data/app/assets/stylesheets/blog_global.css +26 -486
  4. data/app/assets/stylesheets/blog_home.css +60 -0
  5. data/app/assets/stylesheets/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  6. data/app/assets/stylesheets/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  7. data/app/controllers/admin/blog/categories_controller.rb +10 -7
  8. data/app/controllers/admin/blog/comments_controller.rb +9 -4
  9. data/app/controllers/admin/blog/posts_controller.rb +11 -7
  10. data/app/controllers/admin/blog/settings_controller.rb +9 -5
  11. data/app/controllers/blog/posts_controller.rb +1 -1
  12. data/app/models/ckeditor/asset.rb +1 -1
  13. data/app/models/setting.rb +1 -1
  14. data/app/views/admin/blog/_submenu.html.erb +104 -77
  15. data/app/views/admin/blog/categories/_category.html.erb +28 -18
  16. data/app/views/admin/blog/categories/_form.html.erb +1 -0
  17. data/app/views/admin/blog/categories/index.html.erb +4 -3
  18. data/app/views/admin/blog/comments/_comment.html.erb +23 -20
  19. data/app/views/admin/blog/comments/index.html.erb +9 -2
  20. data/app/views/admin/blog/comments/show.html.erb +72 -60
  21. data/app/views/admin/blog/posts/_form.html.erb +26 -7
  22. data/app/views/admin/blog/posts/_form.js.erb +1 -1
  23. data/app/views/admin/blog/posts/_post.html.erb +20 -17
  24. data/app/views/admin/blog/posts/index.html.erb +22 -20
  25. data/app/views/admin/blog/posts/index.js.erb +1 -0
  26. data/app/views/blog/posts/_post.html.erb +1 -1
  27. data/app/views/blog/shared/_post.html.erb +1 -1
  28. data/app/views/layouts/_javascript.html.erb +2 -0
  29. data/app/views/layouts/_stylesheets.html.erb +1 -1
  30. data/app/views/layouts/admin.html.erb +6 -4
  31. data/app/views/layouts/home.html.erb +15 -6
  32. data/app/views/shared/admin/_error_messages.html.erb +1 -1
  33. data/app/views/shared/admin/_form_actions.html.erb +12 -2
  34. data/app/views/shared/admin/_includes.html.erb +4 -0
  35. data/config/locales/en.yml +6 -6
  36. data/config/routes.rb +0 -5
  37. data/db/seeds.rb +33 -13
  38. metadata +7 -7
  39. data/app/assets/javascripts/posts.js +0 -3
  40. data/app/views/layouts/application.html.erb +0 -38
  41. data/app/views/shared/_javascripts.html.erb +0 -3
  42. data/app/views/shared/_stylesheets.html.erb +0 -6
  43. data/lib/tasks/mcms_blog_tasks.rake +0 -4
@@ -7,14 +7,17 @@
7
7
  =end
8
8
  class Admin::Blog::CategoriesController < ::ApplicationController
9
9
 
10
+ #prepending before filter for authenticating user via devise
10
11
  prepend_before_filter :authenticate_user!
11
12
 
12
- load_and_authorize_resource
13
+ #use of cancan to load authorized resource
14
+ load_and_authorize_resource :class => "BlogCategory"
15
+
13
16
  #Assigning a layout admin for admin side controller
14
- layout 'admin'
17
+ layout '/mcms/main_layout'
15
18
 
16
19
  #calling load_assets method before all method to include css and javascript files
17
- before_filter :load_assets1
20
+ before_filter :load_assets
18
21
 
19
22
  #Crudify method used for a normal crud methods by crudify gem
20
23
  #It creates new, create, edit, update, delete, show methods for blog category
@@ -32,15 +35,15 @@ class Admin::Blog::CategoriesController < ::ApplicationController
32
35
  if @blog_category.save
33
36
  redirect_to admin_blog_categories_path
34
37
  else
35
- render new_admin_blog_category_path
38
+ render 'new'
36
39
  end
37
40
  end
38
41
 
39
- protected
42
+ protected #protected methods start here
40
43
 
41
44
  #include css and javascript files to AssetManager class global array
42
- def load_assets1
43
- AssetManager.include_css [:blog_global, :submenu]
45
+ def load_assets
46
+ AssetManager.include_css [:blog_global]
44
47
  end
45
48
 
46
49
 
@@ -6,16 +6,18 @@
6
6
  @Company : Mindfire Solutions
7
7
  =end
8
8
  class Admin::Blog::CommentsController < ApplicationController
9
-
10
- prepend_before_filter :authenticate_user!
11
9
 
12
- load_and_authorize_resource
10
+ #prepending before filter for authenticating user via devise
11
+ prepend_before_filter :authenticate_user!
13
12
 
13
+ #use of cancan to load authorized resource
14
+ load_and_authorize_resource :class => "BlogComment"
14
15
 
16
+ #before filter for loading assets
15
17
  before_filter :load_assets
16
18
 
17
19
  #Assigning a layout admin for admin side controller
18
- layout 'admin'
20
+ layout '/mcms/main_layout'
19
21
 
20
22
  #Crudify method used for a normal crud methods by crudify gem
21
23
  #It creates new, create, edit, update, delete, show methods for blog comment
@@ -57,6 +59,9 @@ class Admin::Blog::CommentsController < ApplicationController
57
59
  end
58
60
  end
59
61
 
62
+ protected #protected methods start here
63
+
64
+ #Initializing assets array for this controller
60
65
  def load_assets
61
66
  AssetManager.include_css [:blog_global, :submenu]
62
67
  end
@@ -7,10 +7,11 @@
7
7
  =end
8
8
  require 'will_paginate/array'
9
9
  class Admin::Blog::PostsController < ::ApplicationController
10
+ #before_filter :authenticate_user!
11
+ prepend_before_filter :authenticate_user!
10
12
 
11
- #prepend_before_filter :authenticate_user!
12
-
13
- #load_and_authorize_resource
13
+ #load_and_authorize_resource :class => false
14
+ load_and_authorize_resource :class => "BlogPost"
14
15
  #include will_paginate
15
16
  #
16
17
 
@@ -31,7 +32,10 @@ class Admin::Blog::PostsController < ::ApplicationController
31
32
 
32
33
 
33
34
  #Assigning a layout admin for admin side controller
34
- layout 'admin'
35
+ layout '/mcms/main_layout'
36
+
37
+ #respond_to :html, :js
38
+
35
39
  #create method for creating blogbosts
36
40
  #parameters: title, body, cached_slug
37
41
  def create
@@ -48,7 +52,7 @@ class Admin::Blog::PostsController < ::ApplicationController
48
52
  if @blog_post.save
49
53
  redirect_to admin_blog_root_path
50
54
  else
51
- render new_admin_blog_post_path
55
+ render 'new'
52
56
  end
53
57
  end
54
58
 
@@ -71,9 +75,9 @@ class Admin::Blog::PostsController < ::ApplicationController
71
75
  #initailizing the array of javascript and css files by Asset manger for including in page
72
76
  def load_js
73
77
  AssetManager.include_contrib_library [:core_ui, :jquery_tab]
74
- AssetManager.include_local_library [:posts, 'ckeditor/init']
78
+ AssetManager.include_local_library [ 'ckeditor/init']
75
79
 
76
- AssetManager.include_css [:blog_global, :submenu]
80
+ AssetManager.include_css [:blog_global]
77
81
  end
78
82
 
79
83
  end
@@ -7,14 +7,17 @@
7
7
  =end
8
8
  class Admin::Blog::SettingsController < ::ApplicationController
9
9
 
10
+ #prepending before filter for authenticating user via devise
10
11
  prepend_before_filter :authenticate_user!
11
12
 
12
- load_and_authorize_resource
13
-
13
+ #use of cancan to load authorized resource
14
+ load_and_authorize_resource
15
+
16
+ #before filter for loading assets
14
17
  before_filter :load_assets
15
18
 
16
19
  #Assigning a layout admin for admin side controller
17
- layout 'admin'
20
+ layout '/mcms/main_layout'
18
21
 
19
22
  #Checking for the blog is commentable or not then do commentable or uncommentable
20
23
  def comments
@@ -49,7 +52,7 @@ class Admin::Blog::SettingsController < ::ApplicationController
49
52
  if request.post?
50
53
  BlogComment::Notification.recipients = params[:recipients]
51
54
  flash[:notice] = t('admin.blog.settings.notification_recipients.updated',
52
- :recipients => BlogComment::Notification.recipients)
55
+ :recipients => params[:recipients])
53
56
  unless request.xhr?
54
57
  redirect_to admin_blog_posts_path
55
58
  else
@@ -59,8 +62,9 @@ class Admin::Blog::SettingsController < ::ApplicationController
59
62
  end
60
63
  end
61
64
 
62
- protected
65
+ protected #protected methods start here
63
66
 
67
+ #Initializing assets array for this controller
64
68
  def load_assets
65
69
  AssetManager.include_css [:blog_global, :submenu]
66
70
  end
@@ -20,7 +20,7 @@ class Blog::PostsController < BlogController
20
20
  #before_filter :layout_include
21
21
 
22
22
 
23
- respond_to :html, :js, :rss
23
+ respond_to :html, :js
24
24
 
25
25
 
26
26
  #Crudify method used for a normal crud methods by crudify gem
@@ -1,5 +1,5 @@
1
1
  class Ckeditor::Asset < ActiveRecord::Base
2
- self.table_name = 'mcms_assets'
2
+ set_table_name 'mcms_assets'
3
3
  include Ckeditor::Orm::ActiveRecord::AssetBase
4
4
  include Ckeditor::Backend::Paperclip
5
5
  end
@@ -14,7 +14,7 @@ class Setting < ActiveRecord::Base
14
14
  include SettingsHelper
15
15
 
16
16
  #attr_accessibles
17
- attr_accessible :name, :value, :destroyable
17
+ attr_accessible :name, :value, :destroyable, :created_at, :updated_at
18
18
 
19
19
  #make settings for blogs to be uncommentable by updating attribute value to 0
20
20
  def self.blog_uncommentable_setting
@@ -2,88 +2,115 @@
2
2
  @Name: admin/blog/_submenu.html.erb
3
3
  @Use: This is a page for displaying menu parts in admin side
4
4
  @Created date: 13-06-2012
5
- @Modified Date: 13-06-2012
5
+ @Modified Date: 13-07-2012
6
6
  @Company: Mindfire Solutions
7
7
  -->
8
- <nav id='actions' class='multilist'>
9
-
10
- <ul class='collapsible-menu'>
11
- <li class='not-a-link'>
12
- <%= link_to t('.posts.title'), '#',
13
- :class => 'page-copy-icon' %>
14
- </li>
15
- <li>
16
- <%= link_to t('.posts.manage'), admin_blog_posts_path,
17
- :class => 'page-icon' %>
18
- </li>
19
- <li>
20
- <%= link_to t('.posts.uncategorized'), uncategorized_admin_blog_posts_url,
21
- :class => 'page-icon' %>
22
- </li>
23
- <li>
24
- <%= link_to t('.posts.new'), new_admin_blog_post_url,
25
- :class => 'page-add-icon' %>
26
- </li>
27
- </ul>
28
-
29
-
30
- <ul class='collapsible-menu'>
31
- <li class='not-a-link'>
32
- <%= link_to t('.categories.title'), '#',
33
- :class => 'folder-icon' %>
34
- </li>
35
- <li>
36
- <%= link_to t('.categories.manage'), admin_blog_categories_url,
37
- :class => 'folder-edit-icon' %>
38
- </li>
39
- <li>
40
- <%= link_to t('.categories.new'), new_admin_blog_category_url,
41
- :class => 'folder-add-icon' %>
42
- </li>
43
- </ul>
44
-
45
- <% if BlogPost::CommentSetting.is_comments_allowed? %>
46
- <ul class='collapsible-menu'>
47
- <li class='not-a-link'>
8
+ <%= javascript_include_tag 'jquery','admin/blog/mcms-blog-submenu.js' %>
9
+ <div id="your-repos" class="repos">
10
+ <div class="top-bar">
11
+ <h2>Submenu Lists </h2>
12
+ <%= link_to t('.posts.new'), new_admin_blog_post_url, :class =>"button new-repo" %>
13
+ </div>
48
14
 
49
- <%= link_to 'Comments', '#',
50
- :class => 'comments-icon' %>
51
- </li>
52
- <li>
53
- <%= link_to t('.comments.new'), admin_blog_comments_path,
54
- :class => 'comment-icon' %>
15
+ <ul class="repo-list" id="repo-listing">
16
+ <li class="submenu">
17
+ <%= link_to t('.posts.title'), 'javascript:void(0);', :class=>"parent-menu-link owner" %>
18
+ <span class="arrow"></span>
19
+ <ul id="repo-listing-child">
20
+ <li class="child-menu">
21
+ <%= link_to t('.posts.manage'), admin_blog_posts_path, :class=>"owner"%>
22
+
23
+ </li>
24
+
25
+ <li class="child-menu">
26
+ <%= link_to t('.posts.uncategorized'), uncategorized_admin_blog_posts_url, :class=>"owner" %>
27
+
28
+ </li>
29
+
30
+ <li class="child-menu">
31
+ <%= link_to t('.posts.new'), new_admin_blog_post_url, :class=> 'owner' %>
32
+
33
+ </li>
34
+ </ul>
55
35
  </li>
56
- <li>
57
- <%= link_to t('.comments.approved'), approved_admin_blog_comments_path,
58
- :class => 'comment-tick-icon' %>
36
+
37
+
38
+
39
+ <li class="submenu">
40
+ <%= link_to t('.categories.title'), 'javascript:void(0);', :class => 'parent-menu-link folder-icon' %>
41
+ <span class="arrow"></span>
42
+ <ul>
43
+ <li class="child-menu">
44
+ <%= link_to t('.categories.manage'), admin_blog_categories_url, :class => 'folder-edit-icon' %>
45
+
46
+ </li>
47
+
48
+ <li class="child-menu">
49
+ <%= link_to t('.categories.new'), new_admin_blog_category_url, :class => 'folder-add-icon' %>
50
+
51
+ </li>
52
+ </ul>
53
+
59
54
  </li>
60
- <li>
61
- <%= link_to t('.comments.rejected'), rejected_admin_blog_comments_path,
62
- :class => 'comment-cross-icon' %>
55
+
56
+
57
+
58
+ <% if BlogPost::CommentSetting.is_comments_allowed? %>
59
+
60
+ <li class='submenu'>
61
+
62
+ <%= link_to 'Comments', 'javascript:void(0);', :class => 'parent-menu-link comments-icon' %>
63
+ <span class="arrow"></span>
64
+ <ul>
65
+ <li class='child-menu' >
66
+ <%= link_to t('.comments.new'), admin_blog_comments_path %>
67
+
68
+ </li>
69
+
70
+ <li class='child-menu' >
71
+ <%= link_to t('.comments.approved'), approved_admin_blog_comments_path %>
72
+
73
+ </li>
74
+
75
+ <li class='child-menu' >
76
+ <%= link_to t('.comments.rejected'), rejected_admin_blog_comments_path %>
77
+
78
+ </li>
79
+ </ul>
80
+ </li>
81
+
82
+
83
+
84
+ <% end %>
85
+
86
+ <li class="submenu">
87
+ <%= link_to t('.settings.title'), 'javascript:void(0);', :class => 'parent-menu-link settings-icon' %>
88
+ <span class="arrow"></span>
89
+ <ul>
90
+ <li class="child-menu">
91
+ <% @link_name = BlogPost::CommentSetting.is_comments_allowed? ? 'Comments allowed' : 'Comments not allowed' %>
92
+ <%= link_to @link_name, comments_admin_blog_settings_url, :class => "#{BlogPost::CommentSetting.is_comments_allowed? ? 'success' : 'failure'}-icon" %>
93
+
94
+ </li>
95
+
96
+ <li class="child-menu">
97
+ <% @link_name = BlogPost::CommentSetting.is_comments_moderated? ? 'Moderation allowed' : 'Moderation not allowed' %>
98
+ <%= link_to @link_name, moderation_admin_blog_settings_url, :class => "#{BlogPost::CommentSetting.is_comments_moderated? ? 'success' : 'failure'}-icon" %>
99
+
100
+ </li>
101
+
102
+ <li class="child-menu">
103
+ <%= link_to t('.settings.update_notified'),
104
+ notification_recipients_admin_blog_settings_url,
105
+ :class => 'user-comment-icon' %>
106
+
107
+ </li>
108
+ </ul>
109
+
63
110
  </li>
64
- </ul>
65
- <% end %>
66
-
67
- <ul class='collapsible-menu'>
68
- <li class='not-a-link'>
69
- <%= link_to t('.settings.title'), admin_blog_settings_path,
70
- :class => 'settings-icon' %>
71
- </li>
72
- <li>
73
- <%= link_to t('.settings.comments'), comments_admin_blog_settings_url,
74
- :class => "#{BlogPost::CommentSetting.is_comments_allowed? ? 'success' : 'failure'}-icon" %>
75
- </li>
76
- <li>
77
- <%= link_to t('.settings.moderation'), moderation_admin_blog_settings_url,
78
- :class => "#{BlogPost::CommentSetting.is_comments_moderated? ? 'success' : 'failure'}-icon" %>
79
- </li>
80
- <li>
81
- <%= link_to t('.settings.update_notified'),
82
- notification_recipients_admin_blog_settings_url,
83
- :class => 'user-comment-icon' %>
84
- </li>
85
- </ul>
86
-
87
- </nav>
88
111
 
112
+ </ul>
113
+ <div class="bottom-bar">
114
+ </div>
115
+ </div>
89
116
 
@@ -1,20 +1,30 @@
1
- <li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(category) -%>">
2
- <span class='title'>
3
- <%= category.title %>
4
- <span class="preview">&nbsp;</span>
5
- </span>
1
+ <!--
2
+ @Name: admin/blog/categories/_category.html.erb
3
+ @Use: This is a partial for showing post records
4
+ @Created date: 08-06-2012
5
+ @Modified Date: 13-07-2012
6
+ @Company: Mindfire Solutions
7
+ -->
6
8
 
7
- <span class='actions'>
9
+ <div class="alert issues-comment">
10
+ <div class="body">
11
+ <span class="mini-icon mini-icon-issue-comment"></span>
12
+ <span class='title'>
13
+ <%= category.title %>
14
+ <span class="preview">&nbsp;</span>
15
+ </span>
8
16
 
9
- <%= link_to image_tag("icons/application_edit.png"), edit_admin_blog_category_path(category),
10
- :title => 'Edit' %>
11
- <%= link_to image_tag("icons/delete.png"), admin_blog_category_path(category),
12
- :class => "cancel confirm-delete",
13
- :title => 'Delete',
14
- :method => :delete,
15
- :confirm => "Are you sure to delete ?" %>
16
- <%= link_to image_tag("icons/application_go.png"), blog_category_path(category),
17
- :title => 'Show' %>
18
- </span>
19
-
20
- </li>
17
+ <span class='actions'>
18
+ <%= link_to image_tag("icons/application_edit.png"), edit_admin_blog_category_path(category),
19
+ :title => 'Edit' %>
20
+ <%= link_to image_tag("icons/delete.png"), admin_blog_category_path(category),
21
+ :class => "cancel confirm-delete",
22
+ :title => 'Delete',
23
+ :method => :delete,
24
+ :confirm => "Are you sure to delete ?" %>
25
+ <%= link_to image_tag("icons/application_go.png"), blog_category_path(category),
26
+ :title => 'Show', :target => "_blank" %>
27
+ </span>
28
+
29
+ </div>
30
+ </div>
@@ -5,6 +5,7 @@
5
5
  @Modified Date: 05-07-2012
6
6
  @Company: Mindfire Solutions
7
7
  -->
8
+ <%= render :partial => "/shared/admin/includes" %>
8
9
  <%= form_for [:admin, @blog_category] do |f| %>
9
10
  <%= render :partial => "/shared/admin/error_messages",
10
11
  :locals => {
@@ -2,11 +2,11 @@
2
2
  @Name: admin/blog/categories/index.html.erb
3
3
  @Use: This is a page for displaying categories records
4
4
  @Created date: 13-06-2012
5
- @Modified Date: 13-06-2012
5
+ @Modified Date: 13-07-2012
6
6
  @Company: Mindfire Solutions
7
7
  -->
8
- <%=render :partial=>'/admin/blog/submenu' %>
9
- <div id='records'>
8
+
9
+ <div id='records' class="news">
10
10
  <% if @blog_categories.any? %>
11
11
  <%= will_paginate @blog_categories %>
12
12
 
@@ -21,3 +21,4 @@
21
21
  </p>
22
22
  <% end %>
23
23
  </div>
24
+ <%=render :partial=>'/admin/blog/submenu' %>
@@ -5,23 +5,26 @@
5
5
  @Modified Date: 19-06-2012
6
6
  @Company: Mindfire Solutions
7
7
  -->
8
- <li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= "comment-#{comment.to_param}" -%>">
9
- <span class='title'>
10
- <%= comment.name %>
11
- <span class="preview"> <%= truncate(comment.body, :length => 75) %></span>
12
- </span>
13
- <span class='actions'>
14
- <%= link_to image_tag("icons/application_go.png"),
15
- blog_post_url(comment.post, :anchor => "comment-#{comment.to_param}"),
16
- :title => t('.view_live_html'),
17
- :target => "_blank" unless comment.is_unmoderated? %>
18
- <%= link_to image_tag('icons/zoom.png'), admin_blog_comment_path(comment),
19
- :title => t('.read') %>
20
- <%= link_to image_tag("icons/cross.png"),
21
- rejected_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')),
22
- :title => t('.reject') unless comment.is_rejected? %>
23
- <%= link_to image_tag("icons/tick.png"),
24
- approved_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')),
25
- :title => t('.approve') unless comment.is_approved? %>
26
- </span>
27
- </li>
8
+ <div class="alert issues-comment">
9
+ <div class="body">
10
+ <span class="mini-icon mini-icon-issue-comment"></span>
11
+ <span class='title'>
12
+ <%= comment.name %>
13
+ <span class="preview"> <%= truncate(comment.body, :length => 75) %></span>
14
+ </span>
15
+ <span class='actions'>
16
+ <%= link_to image_tag("icons/application_go.png"),
17
+ blog_post_url(comment.post, :anchor => "comment-#{comment.to_param}"),
18
+ :title => t('.view_live_html'),
19
+ :target => "_blank" unless comment.is_unmoderated? %>
20
+ <%= link_to image_tag('icons/zoom.png'), admin_blog_comment_path(comment),
21
+ :title => t('.read') %>
22
+ <%= link_to image_tag("icons/cross.png"),
23
+ rejected_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')),
24
+ :title => t('.reject') unless comment.is_rejected? %>
25
+ <%= link_to image_tag("icons/tick.png"),
26
+ approved_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')),
27
+ :title => t('.approve') unless comment.is_approved? %>
28
+ </span>
29
+ </div>
30
+ </div>
@@ -1,5 +1,11 @@
1
- <%= render :partial => '/admin/blog/submenu' %>
2
- <div id='records'>
1
+ <!--
2
+ @Name: admin/blog/comments/index.html.erb
3
+ @Use: This is a page for displaying comments records
4
+ @Created date: 13-06-2012
5
+ @Modified Date: 13-07-2012
6
+ @Company: Mindfire Solutions
7
+ -->
8
+ <div id='records' class="news">
3
9
 
4
10
  <% if @blog_comments.any? %>
5
11
  <%= render :partial => "sortable_list" %>
@@ -10,3 +16,4 @@
10
16
  </h3>
11
17
  <% end %>
12
18
  </div>
19
+ <%= render :partial => '/admin/blog/submenu' %>