gluttonberg-blog 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +3 -0
  4. data/Rakefile +38 -0
  5. data/app/assets/javascripts/blog/application.js +15 -0
  6. data/app/assets/stylesheets/blog/application.css +13 -0
  7. data/app/controllers/gluttonberg/admin/blog/application_controller.rb +6 -0
  8. data/app/controllers/gluttonberg/admin/blog/articles_controller.rb +168 -0
  9. data/app/controllers/gluttonberg/admin/blog/blogs_controller.rb +95 -0
  10. data/app/controllers/gluttonberg/admin/blog/comments_controller.rb +117 -0
  11. data/app/controllers/gluttonberg/public/blog/articles_controller.rb +88 -0
  12. data/app/controllers/gluttonberg/public/blog/blogs_controller.rb +47 -0
  13. data/app/controllers/gluttonberg/public/blog/comments_controller.rb +54 -0
  14. data/app/helpers/gluttonberg/blog/application_helper.rb +6 -0
  15. data/app/mailers/blog_notifier.rb +26 -0
  16. data/app/models/gluttonberg/blog/article.rb +120 -0
  17. data/app/models/gluttonberg/blog/comment.rb +152 -0
  18. data/app/models/gluttonberg/blog/comment_subscription.rb +31 -0
  19. data/app/models/gluttonberg/blog/weblog.rb +25 -0
  20. data/app/views/blog_notifier/comment_notification.html.haml +17 -0
  21. data/app/views/blog_notifier/comment_notification_for_admin.html.haml +19 -0
  22. data/app/views/gluttonberg/admin/blog/articles/_form.html.haml +106 -0
  23. data/app/views/gluttonberg/admin/blog/articles/edit.html.haml +12 -0
  24. data/app/views/gluttonberg/admin/blog/articles/import.html.haml +36 -0
  25. data/app/views/gluttonberg/admin/blog/articles/index.html.haml +82 -0
  26. data/app/views/gluttonberg/admin/blog/articles/new.html.haml +11 -0
  27. data/app/views/gluttonberg/admin/blog/blogs/_form.html.haml +53 -0
  28. data/app/views/gluttonberg/admin/blog/blogs/edit.html.haml +10 -0
  29. data/app/views/gluttonberg/admin/blog/blogs/index.html.haml +35 -0
  30. data/app/views/gluttonberg/admin/blog/blogs/new.html.haml +10 -0
  31. data/app/views/gluttonberg/admin/blog/comments/index.html.haml +66 -0
  32. data/app/views/gluttonberg/public/blog/articles/index.rss.builder +21 -0
  33. data/app/views/gluttonberg/public/blog/blogs/show.rss.builder +21 -0
  34. data/app/views/layouts/blog/application.html.erb +14 -0
  35. data/config/routes.rb +53 -0
  36. data/lib/generators/gluttonberg/blog/blog_generator.rb +42 -0
  37. data/lib/generators/gluttonberg/blog/templates/articles_index.html.haml +18 -0
  38. data/lib/generators/gluttonberg/blog/templates/articles_show.html.haml +63 -0
  39. data/lib/generators/gluttonberg/blog/templates/articles_tag.html.haml +25 -0
  40. data/lib/generators/gluttonberg/blog/templates/blog_migration.rb +94 -0
  41. data/lib/generators/gluttonberg/blog/templates/blogs_index.html.haml +15 -0
  42. data/lib/generators/gluttonberg/blog/templates/blogs_show.html.haml +26 -0
  43. data/lib/gluttonberg/blog.rb +9 -0
  44. data/lib/gluttonberg/blog/engine.rb +22 -0
  45. data/lib/gluttonberg/blog/tasks/blog_tasks.rake +12 -0
  46. data/lib/gluttonberg/blog/version.rb +5 -0
  47. data/spec/dummy/README.rdoc +261 -0
  48. data/spec/dummy/Rakefile +7 -0
  49. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  50. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  51. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  52. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  53. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  54. data/spec/dummy/config.ru +4 -0
  55. data/spec/dummy/config/application.rb +59 -0
  56. data/spec/dummy/config/boot.rb +10 -0
  57. data/spec/dummy/config/database.yml +8 -0
  58. data/spec/dummy/config/environment.rb +5 -0
  59. data/spec/dummy/config/environments/development.rb +37 -0
  60. data/spec/dummy/config/environments/production.rb +67 -0
  61. data/spec/dummy/config/environments/test.rb +37 -0
  62. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  63. data/spec/dummy/config/initializers/inflections.rb +15 -0
  64. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  65. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  66. data/spec/dummy/config/initializers/session_store.rb +8 -0
  67. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  68. data/spec/dummy/config/locales/en.yml +5 -0
  69. data/spec/dummy/config/routes.rb +3 -0
  70. data/spec/dummy/db/schema.rb +476 -0
  71. data/spec/dummy/public/404.html +26 -0
  72. data/spec/dummy/public/422.html +26 -0
  73. data/spec/dummy/public/500.html +25 -0
  74. data/spec/dummy/public/favicon.ico +0 -0
  75. data/spec/dummy/script/rails +6 -0
  76. data/spec/fixtures/assets/gb_banner.jpg +0 -0
  77. data/spec/fixtures/assets/gb_logo.png +0 -0
  78. data/spec/fixtures/assets/high_res_photo.jpg +0 -0
  79. data/spec/fixtures/assets/untitled +0 -0
  80. data/spec/fixtures/members.csv +5 -0
  81. data/spec/fixtures/staff_profiles.csv +4 -0
  82. data/spec/helpers/page_info_spec.rb +213 -0
  83. data/spec/mailers/blog_notifier_spec.rb +127 -0
  84. data/spec/models/article_spec.rb +213 -0
  85. data/spec/spec_helper.rb +67 -0
  86. metadata +203 -0
@@ -0,0 +1,31 @@
1
+ module Gluttonberg
2
+ module Blog
3
+ class CommentSubscription < ActiveRecord::Base
4
+ self.table_name = "gb_comment_subscriptions"
5
+
6
+ before_save :generate_reference_hash
7
+ belongs_to :article
8
+
9
+ attr_accessible :article_id , :author_email , :author_name
10
+ MixinManager.load_mixins(self)
11
+
12
+ def self.notify_subscribers_of(article , comment)
13
+ subscribers = self.where(:article_id => article.id).all
14
+ subscribers.each do |subscriber|
15
+ unless subscriber.author_email == comment.writer_email
16
+ BlogNotifier.delay.comment_notification(subscriber , article , comment )
17
+ comment.notification_sent_at = Time.now
18
+ comment.save
19
+ end
20
+ end
21
+ end
22
+
23
+ def generate_reference_hash
24
+ unless self.reference_hash
25
+ self.reference_hash = Digest::SHA1.hexdigest(Time.now.to_s + self.author_email + self.article_id.to_s)
26
+ end
27
+ end
28
+
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,25 @@
1
+ module Gluttonberg
2
+ module Blog
3
+ class Weblog < ActiveRecord::Base
4
+ self.table_name = "gb_weblogs"
5
+ include Content::Publishable
6
+ include Content::SlugManagement
7
+ MixinManager.load_mixins(self)
8
+
9
+ belongs_to :user
10
+ has_many :articles, :dependent => :destroy, :foreign_key => 'blog_id'
11
+ belongs_to :fb_icon , :class_name => "Gluttonberg::Asset" , :foreign_key => "fb_icon_id"
12
+
13
+ validates_presence_of :name, :user_id
14
+
15
+ is_versioned :non_versioned_columns => ['state' ,'published_at' , 'moderation_required' ]
16
+
17
+ acts_as_taggable_on :tag
18
+ clean_html [:description]
19
+ attr_accessible :user_id, :name, :slug, :description, :moderation_required
20
+ attr_accessible :user
21
+ attr_accessible :seo_title, :seo_keywords, :seo_description, :fb_icon_id, :state, :published_at
22
+
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,17 @@
1
+ %p= "Hi #{@subscriber.author_name}"
2
+
3
+
4
+ %p= "#{@comment.writer_name} commented on \"#{@article.title}\""
5
+
6
+ %p= "#{@comment.writer_name} wrote \"#{@article.body}\""
7
+
8
+ %p= link_to "Click here to see the full thread" , @article_url
9
+
10
+ %p
11
+ Thanks,
12
+ %br
13
+ = "The #{@website_title} Team"
14
+
15
+ %p
16
+ If you don't want to receive notification emails about this article, you can
17
+ = link_to "unsubscribe" , @unsubscribe_url
@@ -0,0 +1,19 @@
1
+ %p= "Hi #{@admin.full_name}"
2
+
3
+
4
+ %p= "#{@comment.writer_name} commented on \"#{@article.title}\""
5
+
6
+ %p= "#{@comment.writer_name} wrote \"#{@article.body}\""
7
+
8
+ %p= link_to "Click here to see the full thread" , @article_url
9
+
10
+ - if @comment.moderation_required
11
+ %p
12
+ = link_to "Click here to approve the comment", admin_comments_moderation_url(@comment.id, :moderation => "approve")
13
+ %p
14
+ = link_to "Click here to disapprove the comment", admin_comments_moderation_url(@comment.id, :moderation => "disapprove")
15
+
16
+ %p
17
+ Thanks,
18
+ %br
19
+ = "The #{@website_title} Team"
@@ -0,0 +1,106 @@
1
+ - unless @article_localization.blank?
2
+ = version_alerts(@article_localization.versions , @article_localization.version, can?(:publish , Gluttonberg::Blog::Article) )
3
+ = version_listing(@article_localization.versions , @article_localization.version)
4
+
5
+ = form_for(@article_localization, :url => url , :html => {:class => "validation auto_save"}) do |f|
6
+ = gb_error_messages_for(@article_localization)
7
+ .span5
8
+ .tabbable
9
+ .versions.page_content_form
10
+ - unless action_name == "new" || action_name == "create"
11
+ - if Gluttonberg.localized? && Gluttonberg::Locale.all.length > 1
12
+ .btn-group
13
+ %a{ :class => "btn dropdown-toggle" , "data-toggle" => "dropdown", :href => "#"}
14
+ Editing #{@article_localization.locale.name} Content
15
+ %span.caret
16
+ %ul.dropdown-menu
17
+ - for locale in Gluttonberg::Locale.all
18
+ - localization = Gluttonberg::Blog::ArticleLocalization.where({ :article_id => @article.id , :locale_id => locale.id }).first
19
+ %li
20
+ %a{:href => edit_admin_blog_article_path(@blog, @article , :localization_id => localization.id) ,:id=>"edit_content_tab",:class=>"button"}
21
+ = "Edit #{localization.locale.name}"
22
+
23
+ %ul.nav.nav-tabs
24
+ %li.active
25
+ %a{:href => "#content", "data-toggle" => "tab" }
26
+ Content
27
+ %li
28
+ %a{:href => "#seo", "data-toggle" => "tab" }
29
+ SEO
30
+ .tab-content
31
+ .tab-pane.active#content
32
+ .pad
33
+ %p
34
+ = f.fields_for :article , @article do |article_form|
35
+ %p
36
+ = article_form.hidden_field(:user_id, :value => current_user.id) if @article.user_id.blank?
37
+ = article_form.hidden_field(:blog_id, :value => @blog.id) if @article.blog_id.blank?
38
+ %p
39
+ = f.label :title
40
+ = f.text_field(:title, :id => "page_title" , :class => "required")
41
+
42
+ %p
43
+ #page_slug_holder
44
+ #{current_domain}#{@article.slug}
45
+ - unless @article.new_record?
46
+ = link_to("Preview", "Javascript:;", :class => "btn btn-mini preview-page", :target => "_blank", "data-url" => "#{blog_article_path(@article_localization.locale.slug ,@blog.slug, @article.slug)}?preview=true")
47
+ .clear
48
+
49
+
50
+ = f.fields_for :article , @article do |article_form|
51
+ %p
52
+ = article_form.label :author
53
+ = article_form.select("author_id" , @authors.collect{|a| [a.email , a.id] } , :class => "required" )
54
+ %p
55
+ = f.label :featured_image_id
56
+ = f.asset_browser( :featured_image_id , opts = { :filter => "image" } )
57
+
58
+ %p
59
+ = f.label :excerpt
60
+ = f.text_area(:excerpt , :class => "jwysiwyg" )
61
+ %p
62
+ = f.label :body, "Content"
63
+ = f.text_area(:body , :class => "jwysiwyg" )
64
+
65
+ .tab-pane#seo
66
+ .pad
67
+ = f.fields_for :article , @article do |article_form|
68
+ .seo_body
69
+ %p
70
+ = article_form.label :slug
71
+ = article_form.text_field(:slug, :id => 'page_slug' , :donotmodify => (action_name == "edit" || action_name == "update"))
72
+ %p
73
+ = f.label :seo_title
74
+ = f.text_field :seo_title , :class => "span4 "
75
+ %p
76
+ = f.label :seo_keywords , "Keywords"
77
+ = f.text_area :seo_keywords , :class => "span4 " , :rows => 3
78
+ %p
79
+ = f.label :seo_description , "Description"
80
+ = f.text_area :seo_description , :class => "span4 " , :rows => 3
81
+ %p
82
+ = f.label :fb_icon_id , "Facebook Icon"
83
+ = f.asset_browser :fb_icon_id , :class => "" , :filter => "image"
84
+
85
+
86
+ .span4
87
+
88
+ = f.fields_for :article , @article do |article_form|
89
+ %legend Categories & Tags
90
+ %p
91
+ = article_form.label :article_category_list , "Categories"
92
+ = article_form.text_field(:article_category_list, :class => "tags" , :rel => tags_string("article_category") )
93
+ %p
94
+ = article_form.label :tag_list , "Tags"
95
+ = article_form.text_field(:tag_list, :class => "tags" , :rel => tags_string("tag") )
96
+ %p
97
+ %em seperate categories & tags with a comma
98
+
99
+ %legend Comments
100
+ %p
101
+ = article_form.label :disable_comments
102
+ = article_form.check_box(:disable_comments)
103
+
104
+ = submit_and_publish_controls(article_form, @article, can?(:publish , Gluttonberg::Blog::Article))
105
+
106
+ = enable_redactor("jwysiwyg")
@@ -0,0 +1,12 @@
1
+ - @page_title = "#{link_to @blog.name, admin_blog_articles_path(@blog)} > Edit #{@article.title}"
2
+
3
+ .row-fluid
4
+ = render :partial => "/gluttonberg/admin/content/main/sidebar"
5
+ .span9
6
+ .row-fluid
7
+ .page-header
8
+ %h1
9
+ = @page_title.html_safe
10
+
11
+ = auto_save(@article.current_localization)
12
+ = render :partial => "form", :locals => {:url => admin_blog_article_path(@blog, @article , :localization_id => params[:localization_id])}
@@ -0,0 +1,36 @@
1
+ - @page_title = "#{link_to "Blogs", admin_blogs_path} > #{@blog.name}".html_safe
2
+
3
+ .row-fluid
4
+ = render :partial => "/gluttonberg/admin/content/main/sidebar"
5
+ .span9
6
+ .page-header
7
+ %h1
8
+ = @page_title.html_safe
9
+
10
+ .row-fluid
11
+ = form_tag(import_admin_blog_articles_path(@blog.id) , :multipart => true) do |f|
12
+ - if !@feedback.blank? && @feedback != true
13
+ .error.model-error.alert.alert-block.alert-error
14
+ %h4 Sorry, There was an error importing the CSV file.
15
+ %p
16
+ No records were imported, Please fix following errors and re-import the CSV file.
17
+ %ul
18
+ - @feedback.each_with_index do |feed , index|
19
+ - unless feed == true
20
+ %li
21
+ Row #{index+2}
22
+ %ul
23
+ - feed.full_messages.each do |msg|
24
+ %li= msg
25
+ .span5
26
+ %legend CSV Content
27
+ %p
28
+ = label_tag "Select CSV File"
29
+ = file_field_tag :csv
30
+ %p
31
+ The CSV file must have a header row. The column titles are supplied below. The columns can be in any order. The CSV must contain the required columns.
32
+
33
+ %ul
34
+ - Gluttonberg::Blog::Article.import_export_columns.each do |column|
35
+ %li= column
36
+ = form_controls(admin_contacts_path)
@@ -0,0 +1,82 @@
1
+ - @page_title = "#{link_to "Blogs", admin_blogs_path} > #{@blog.name}".html_safe
2
+
3
+ .row-fluid
4
+ = render :partial => "/gluttonberg/admin/content/main/sidebar"
5
+ .span9
6
+ .row-fluid
7
+ .page-header
8
+ %h1
9
+ = @page_title
10
+ .subnav
11
+ = sub_nav do
12
+ = nav_link('Add New Post', new_admin_blog_article_path)
13
+ = nav_link('Import', import_admin_blog_articles_path(@blog.id))
14
+ = nav_link('Export', export_admin_blog_articles_path(@blog.id))
15
+
16
+ - if @articles.empty?
17
+ %p.empty No Articles
18
+ - else
19
+ %table{:cellpadding => 0, :cellspacing => 0, :summary => "Articles" , :class => "table table-bordered "}
20
+ %thead
21
+ %tr
22
+ %th
23
+ Article
24
+ %th
25
+ Comments
26
+ %th
27
+ Author
28
+ %th
29
+ Created By
30
+ %th.controls
31
+
32
+ %tbody
33
+ - @articles.each do |article|
34
+ %tr{ :class => "#{cycle("even", "odd")}"}
35
+ %td{:style => "width:40%;"}
36
+ = link_to "#{article.title}", edit_admin_blog_article_path(@blog, article)
37
+ %td{:style => "width:15%;"}
38
+ = link_to(pluralize(article.comments.size, "comment"), admin_blog_article_comments_path(@blog, article))
39
+ %td{:style => "width:10%"}
40
+ = article.author.full_name
41
+ %td{:style => "width:15%"}
42
+ = article.publishing_status
43
+ - unless article.published_at.blank?
44
+ %br
45
+ %span.date
46
+ = article.published_at.strftime("%d/%m/%Y")
47
+ %td.controls{:style => "width:30%"}
48
+ .btn-group
49
+ %a{ :class => "btn dropdown-toggle" , "data-toggle" => "dropdown" , :href => "#"}
50
+ Actions
51
+ %span.caret
52
+ %ul.dropdown-menu
53
+
54
+ - if Gluttonberg.localized? && article.localizations.length > 1
55
+ - Gluttonberg::Locale.all.each_with_index do |locale, index|
56
+ - if index > 0
57
+ %li.divider
58
+ - localization = Gluttonberg::Blog::ArticleLocalization.where({ :article_id => article.id , :locale_id => locale.id }).first
59
+ %li.menu-section-title
60
+ = locale.name
61
+ %li
62
+ %a{:href => edit_admin_blog_article_path(@blog, article , :localization_id => localization.id) ,:id=>"edit_content_tab",:class=>"button"}
63
+ = "Edit Post"
64
+ %li
65
+ = link_to("View Post", blog_article_path(current_localization_slug ,@blog.slug, article.slug), :class => "", :target => "_blank")
66
+ - else
67
+ %li
68
+ = link_to "Edit Post", edit_admin_blog_article_path(@blog, article) , :class => " "
69
+ %li
70
+ = link_to("View Post", blog_article_path(:blog_id => @blog.slug, :id => article.slug), :class => "", :target => "_blank")
71
+
72
+
73
+ %li.divider
74
+ %li= link_to("Duplicate", duplicate_admin_blog_article_path( @blog, article), :class => "")
75
+
76
+ - if can? :destroy , Gluttonberg::Blog::Article
77
+ %li.divider
78
+ %li.danger
79
+ = link_to "Delete", delete_admin_blog_article_path(@blog, article) , :class => ""
80
+
81
+
82
+ = will_paginate(@articles)
@@ -0,0 +1,11 @@
1
+ - @page_title = "#{link_to @blog.name, admin_blog_articles_path(@blog)} > Add New Post"
2
+
3
+ .row-fluid
4
+ = render :partial => "/gluttonberg/admin/content/main/sidebar"
5
+ .span9
6
+ .row-fluid
7
+ .page-header
8
+ %h1
9
+ = @page_title.html_safe
10
+ = render :partial => "form", :locals => {:url => admin_blog_articles_path}
11
+
@@ -0,0 +1,53 @@
1
+ - unless @blog.blank?
2
+ = version_listing(@blog.versions , @blog.version )
3
+
4
+ = form_for(@blog, :url => url , :html => {:class => "validation"}) do |f|
5
+ = gb_error_messages_for(@blog)
6
+ = f.hidden_field(:user_id, :value => current_user.id) if @blog.user_id.blank?
7
+
8
+ .span5
9
+ .tabbable
10
+
11
+ %ul.nav.nav-tabs
12
+ %li.active
13
+ %a{:href => "#blog", "data-toggle" => "tab" }
14
+ Blog
15
+ %li
16
+ %a{:href => "#seo", "data-toggle" => "tab" }
17
+ SEO
18
+ .tab-content
19
+ .tab-pane.active#blog
20
+ .pad
21
+ %p
22
+ = f.label :name
23
+ = f.text_field(:name, :id => "page_title" , :class => "required")
24
+ %p
25
+ = f.label :slug
26
+ = f.text_field(:slug, :id => 'page_slug' , :donotmodify => (action_name == "edit" || action_name == "update"))
27
+ %p
28
+ = f.label :description,:class =>"block_label"
29
+ = f.text_area(:description , :class => "jwysiwyg", :width => "490", :height => "200")
30
+ %p
31
+ = f.label :moderation_required , "Moderation required?"
32
+ = f.check_box :moderation_required
33
+ .tab-pane#seo
34
+ .pad
35
+ %p
36
+ = f.label :seo_title
37
+ = f.text_field :seo_title , :class => "span4 "
38
+ %p
39
+ = f.label :seo_keywords , "Keywords"
40
+ = f.text_area :seo_keywords , :class => "span5 " , :rows => 3
41
+ %p
42
+ = f.label :seo_description , "Description"
43
+ = f.text_area :seo_description , :class => "span5 " , :rows => 3
44
+ %p
45
+ = f.label :fb_icon_id , "Facebook Icon"
46
+ = f.asset_browser :fb_icon_id , :class => "" , :filter => "image"
47
+
48
+
49
+ .span4
50
+ = submit_and_publish_controls(f, @blog, can?(:publish , Gluttonberg::Blog::Weblog))
51
+
52
+
53
+ = enable_redactor("jwysiwyg")
@@ -0,0 +1,10 @@
1
+ - @page_title = "#{link_to "Blogs", admin_blogs_path} > Edit #{@blog.name}"
2
+
3
+ .row-fluid
4
+ = render :partial => "/gluttonberg/admin/content/main/sidebar"
5
+
6
+ .span9
7
+ .page-header
8
+ %h1
9
+ = @page_title.html_safe
10
+ = render :partial => "form", :locals => {:url => admin_blog_path(@blog)}
@@ -0,0 +1,35 @@
1
+ - @page_title = "Blogs".html_safe
2
+
3
+ .row-fluid
4
+ = render :partial => "/gluttonberg/admin/content/main/sidebar"
5
+ .span9
6
+ .row-fluid
7
+ .page-header
8
+ %h1
9
+ = @page_title
10
+ .subnav
11
+ = sub_nav do
12
+ - if current_user.super_admin?
13
+ = nav_link('Add New Blog', new_admin_blog_path)
14
+
15
+ - if @blogs.empty?
16
+ %p.empty No Blogs
17
+ - else
18
+ %table{:cellpadding => 0, :cellspacing => 0, :summary => "Blogs" , :class => "table table-bordered "}
19
+ %thead
20
+ %tr
21
+ %th Blog
22
+ %th.controls
23
+
24
+ %tbody
25
+ - @blogs.each do |blog|
26
+ %tr
27
+ %td
28
+ = link_to "#{blog.name}", admin_blog_articles_path(blog)
29
+ %td.controls{:width => 200}
30
+ = link_to "View Posts", admin_blog_articles_path(blog) , :class => "btn btn-primary"
31
+ - if current_user.super_admin?
32
+ = link_to "Edit", edit_admin_blog_path(blog) , :class => "btn"
33
+ - if can? :destroy , Gluttonberg::Blog::Weblog
34
+ = link_to "Delete", delete_admin_blog_path(blog) , :class => "btn btn-danger"
35
+ = will_paginate(@blogs)