refinerycms-blog 1.8.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +54 -0
- data/.rspec +3 -0
- data/.travis.yml +18 -0
- data/Gemfile +68 -5
- data/Guardfile +20 -0
- data/Rakefile +21 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/cog.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/comment.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/comment_cross.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/comment_tick.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/comments.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/down.gif +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/folder.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/folder_add.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/folder_edit.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/page.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/page_add.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/page_copy.png +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/icons/up.gif +0 -0
- data/{public/images/refinerycms-blog → app/assets/images/refinery/blog}/rss-feed.png +0 -0
- data/app/assets/images/refinerycms-blog/.gitkeep +0 -0
- data/{public/javascripts/refinery/refinerycms-blog.js → app/assets/javascripts/refinery/blog/backend.js} +66 -1
- data/{public/javascripts/refinerycms-blog.js → app/assets/javascripts/refinery/blog/frontend.js} +0 -0
- data/app/assets/javascripts/refinerycms-blog/.gitkeep +0 -0
- data/app/assets/stylesheets/refinery/blog/backend.css.scss +73 -0
- data/{public/stylesheets/refinerycms-blog.css → app/assets/stylesheets/refinery/blog/frontend.css.scss} +3 -3
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/{public/stylesheets → app/assets/stylesheets/refinery/blog}/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/{public/stylesheets/ui-lightness/jquery-ui-1.8.13.custom.css → app/assets/stylesheets/refinery/blog/ui-lightness/jquery-ui-1.8.13.custom.css.scss} +0 -0
- data/app/assets/stylesheets/refinerycms-blog/.gitkeep +0 -0
- data/app/controllers/.gitkeep +0 -0
- data/app/controllers/refinery/blog/admin/categories_controller.rb +12 -0
- data/app/controllers/refinery/blog/admin/comments_controller.rb +49 -0
- data/app/controllers/refinery/blog/admin/posts_controller.rb +90 -0
- data/app/controllers/refinery/blog/admin/settings_controller.rb +55 -0
- data/app/controllers/refinery/blog/blog_controller.rb +17 -0
- data/app/controllers/refinery/blog/categories_controller.rb +12 -0
- data/app/controllers/refinery/blog/posts_controller.rb +84 -0
- data/app/helpers/.gitkeep +0 -0
- data/app/helpers/refinery/blog/controller_helper.rb +29 -0
- data/app/helpers/refinery/blog/posts_helper.rb +72 -0
- data/app/mailers/refinery/blog/comment_mailer.rb +14 -0
- data/app/models/.gitkeep +0 -0
- data/app/models/refinery/blog/category.rb +23 -0
- data/app/models/refinery/blog/comment.rb +135 -0
- data/app/models/refinery/blog/comment_mailer.rb +1 -0
- data/app/models/refinery/blog/post.rb +115 -0
- data/app/models/refinery/categorization.rb +9 -0
- data/app/sweepers/refinery/blog_sweeper.rb +26 -0
- data/app/views/.gitkeep +0 -0
- data/app/views/{admin/blog → refinery/blog/admin}/_submenu.html.erb +21 -21
- data/app/views/{admin/blog → refinery/blog/admin}/categories/_category.html.erb +3 -3
- data/app/views/{admin/blog → refinery/blog/admin}/categories/_form.html.erb +4 -4
- data/app/views/{admin/blog/comments → refinery/blog/admin/categories}/_sortable_list.html.erb +2 -2
- data/app/views/{admin/blog → refinery/blog/admin}/categories/edit.html.erb +0 -0
- data/app/views/refinery/blog/admin/categories/index.html.erb +27 -0
- data/app/views/{admin/blog → refinery/blog/admin}/categories/new.html.erb +0 -0
- data/app/views/{admin/blog → refinery/blog/admin}/comments/_comment.html.erb +4 -4
- data/app/views/{admin/blog/categories → refinery/blog/admin/comments}/_sortable_list.html.erb +2 -2
- data/app/views/refinery/blog/admin/comments/index.html.erb +30 -0
- data/app/views/refinery/blog/admin/comments/show.html.erb +63 -0
- data/app/views/{admin/blog → refinery/blog/admin}/posts/_form.html.erb +53 -39
- data/app/views/{admin/blog → refinery/blog/admin}/posts/_form_part.html.erb +0 -0
- data/app/views/{admin/blog → refinery/blog/admin}/posts/_post.html.erb +4 -7
- data/app/views/{admin/blog → refinery/blog/admin}/posts/_sortable_list.html.erb +2 -2
- data/app/views/{admin/blog → refinery/blog/admin}/posts/_teaser_part.html.erb +2 -2
- data/app/views/{admin/blog → refinery/blog/admin}/posts/edit.html.erb +0 -0
- data/app/views/refinery/blog/admin/posts/index.html.erb +27 -0
- data/app/views/{admin/blog → refinery/blog/admin}/posts/new.html.erb +0 -0
- data/app/views/refinery/blog/admin/posts/uncategorized.html.erb +27 -0
- data/app/views/{admin/blog → refinery/blog/admin}/settings/notification_recipients.html.erb +3 -3
- data/app/views/refinery/blog/categories/show.html.erb +21 -0
- data/app/views/{blog → refinery/blog}/comment_mailer/notification.html.erb +1 -1
- data/app/views/{blog → refinery/blog}/posts/_comment.html.erb +2 -2
- data/app/views/refinery/blog/posts/_comments.html.erb +40 -0
- data/app/views/refinery/blog/posts/_nav.html.erb +17 -0
- data/app/views/refinery/blog/posts/_post.html.erb +37 -0
- data/app/views/refinery/blog/posts/archive.html.erb +17 -0
- data/app/views/refinery/blog/posts/index.html.erb +20 -0
- data/app/views/refinery/blog/posts/index.rss.builder +17 -0
- data/app/views/refinery/blog/posts/show.html.erb +21 -0
- data/app/views/refinery/blog/posts/tagged.html.erb +19 -0
- data/app/views/refinery/blog/shared/_body_content_right.html.erb +9 -0
- data/app/views/{blog → refinery/blog}/shared/_categories.html.erb +3 -3
- data/app/views/{blog → refinery/blog}/shared/_post.html.erb +11 -11
- data/app/views/refinery/blog/shared/_posts.html.erb +10 -0
- data/app/views/refinery/blog/shared/_rss_feed.html.erb +2 -0
- data/app/views/{blog → refinery/blog}/shared/_tags.html.erb +1 -1
- data/app/views/refinery/blog/widgets/_blog_archive.html.erb +10 -0
- data/app/views/refinery/shared/admin/_autocomplete.html.erb +5 -0
- data/changelog.md +2 -18
- data/config/initializers/url_validator.rb +84 -0
- data/config/locales/bg.yml +139 -139
- data/config/locales/cs.yml +119 -119
- data/config/locales/de.yml +121 -121
- data/config/locales/en.yml +147 -140
- data/config/locales/es.yml +119 -150
- data/config/locales/fr.yml +136 -136
- data/config/locales/it.yml +139 -139
- data/config/locales/ja.yml +2 -3
- data/config/locales/nb.yml +28 -27
- data/config/locales/nl.yml +125 -125
- data/config/locales/pl.yml +125 -125
- data/config/locales/pt-BR.yml +129 -134
- data/config/locales/ru.yml +119 -126
- data/config/locales/sk.yml +119 -119
- data/config/locales/zh-CN.yml +119 -119
- data/config/routes.rb +37 -33
- data/db/migrate/20110803223522_create_blog_structure.rb +52 -0
- data/db/migrate/20110803223523_add_user_id_to_blog_posts.rb +7 -0
- data/db/migrate/{3_acts_as_taggable_on_migration.rb → 20110803223524_acts_as_taggable_on_migration.rb} +2 -2
- data/db/migrate/20110803223526_add_cached_slugs.rb +6 -0
- data/db/migrate/20110803223527_add_custom_url_field_to_blog_posts.rb +5 -0
- data/db/migrate/20110803223528_add_custom_teaser_field_to_blog_posts.rb +6 -0
- data/db/migrate/20110803223529_add_primary_key_to_categorizations.rb +14 -0
- data/db/migrate/20120103055909_add_source_url_to_blog_posts.rb +7 -0
- data/db/migrate/20120223022021_add_access_count_to_posts.rb +8 -0
- data/db/migrate/20120227022021_add_slug_to_posts_and_categories.rb +9 -0
- data/db/{seeds/refinerycms_blog.rb → seeds.rb} +6 -7
- data/lib/generators/refinery/blog/blog_generator.rb +27 -0
- data/lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb +11 -0
- data/lib/refinery/blog.rb +37 -0
- data/lib/refinery/blog/configuration.rb +14 -0
- data/lib/refinery/blog/engine.rb +25 -0
- data/lib/refinery/blog/tabs.rb +5 -11
- data/lib/refinery/blog/version.rb +3 -3
- data/lib/refinerycms-blog.rb +1 -41
- data/readme.md +24 -15
- data/refinerycms-blog.gemspec +19 -196
- data/script/rails +6 -0
- data/spec/factories/blog_categories.rb +5 -0
- data/spec/factories/blog_comments.rb +19 -0
- data/spec/factories/blog_posts.rb +13 -0
- data/spec/helpers/refinery/blog/posts_helper_spec.rb +71 -0
- data/spec/lib/refinery/blog/engine_spec.rb +26 -0
- data/spec/models/refinery/blog/category_spec.rb +42 -0
- data/spec/models/refinery/blog/comment_spec.rb +19 -0
- data/spec/models/refinery/blog/post_spec.rb +233 -0
- data/spec/requests/refinery/blog/admin/categories_spec.rb +20 -0
- data/spec/requests/refinery/blog/admin/comments_spec.rb +121 -0
- data/spec/requests/refinery/blog/admin/menu_spec.rb +13 -0
- data/spec/requests/refinery/blog/admin/posts_spec.rb +175 -0
- data/spec/requests/refinery/blog/categories_spec.rb +24 -0
- data/spec/requests/refinery/blog/posts_spec.rb +160 -0
- data/spec/spec_helper.rb +56 -0
- data/tasks/rspec.rake +4 -0
- data/tasks/testing.rake +9 -0
- metadata +281 -170
- data/app/controllers/admin/blog/categories_controller.rb +0 -11
- data/app/controllers/admin/blog/comments_controller.rb +0 -40
- data/app/controllers/admin/blog/posts_controller.rb +0 -97
- data/app/controllers/admin/blog/settings_controller.rb +0 -53
- data/app/controllers/blog/categories_controller.rb +0 -13
- data/app/controllers/blog/posts_controller.rb +0 -109
- data/app/controllers/blog_controller.rb +0 -16
- data/app/helpers/blog_posts_helper.rb +0 -56
- data/app/mailers/blog/comment_mailer.rb +0 -13
- data/app/models/blog/comment_mailer.rb +0 -1
- data/app/models/blog_category.rb +0 -19
- data/app/models/blog_comment.rb +0 -137
- data/app/models/blog_post.rb +0 -114
- data/app/models/categorization.rb +0 -7
- data/app/views/admin/blog/categories/index.html.erb +0 -26
- data/app/views/admin/blog/comments/index.html.erb +0 -35
- data/app/views/admin/blog/comments/show.html.erb +0 -63
- data/app/views/admin/blog/posts/_form.css.erb +0 -20
- data/app/views/admin/blog/posts/_form.js.erb +0 -23
- data/app/views/admin/blog/posts/index.html.erb +0 -28
- data/app/views/admin/blog/posts/uncategorized.html.erb +0 -26
- data/app/views/blog/categories/show.html.erb +0 -21
- data/app/views/blog/posts/_nav.html.erb +0 -11
- data/app/views/blog/posts/archive.html.erb +0 -20
- data/app/views/blog/posts/index.html.erb +0 -24
- data/app/views/blog/posts/index.rss.builder +0 -17
- data/app/views/blog/posts/show.html.erb +0 -98
- data/app/views/blog/posts/tagged.html.erb +0 -22
- data/app/views/blog/shared/_archive_list.html.erb +0 -9
- data/app/views/blog/shared/_related_posts.html.erb +0 -10
- data/app/views/blog/shared/_rss_feed.html.erb +0 -2
- data/app/views/shared/admin/_autocomplete.html.erb +0 -55
- data/db/migrate/1_create_blog_structure.rb +0 -54
- data/db/migrate/2_add_user_id_to_blog_posts.rb +0 -11
- data/db/migrate/4_create_seo_meta_for_blog.rb +0 -25
- data/db/migrate/5_add_cached_slugs.rb +0 -11
- data/db/migrate/6_add_custom_url_field_to_blog_posts.rb +0 -9
- data/db/migrate/7_add_custom_teaser_field_to_blog_posts.rb +0 -10
- data/db/migrate/8_add_primary_key_to_categorizations.rb +0 -12
- data/features/authors.feature +0 -15
- data/features/category.feature +0 -23
- data/features/support/factories/blog_categories.rb +0 -5
- data/features/support/factories/blog_comments.rb +0 -8
- data/features/support/factories/blog_posts.rb +0 -9
- data/features/support/paths.rb +0 -24
- data/features/support/step_definitions/authors_steps.rb +0 -7
- data/features/support/step_definitions/category_steps.rb +0 -11
- data/features/support/step_definitions/tags_steps.rb +0 -13
- data/features/tags.feature +0 -26
- data/lib/gemspec.rb +0 -37
- data/lib/generators/refinerycms_blog_generator.rb +0 -8
- data/public/stylesheets/refinery/refinerycms-blog.css +0 -55
- data/spec/models/blog_category_spec.rb +0 -41
- data/spec/models/blog_comment_spec.rb +0 -21
- data/spec/models/blog_post_spec.rb +0 -217
@@ -1,98 +0,0 @@
|
|
1
|
-
<% content_for :body_content_left do %>
|
2
|
-
<div id="show_blog_post">
|
3
|
-
<% flash.each do |key, value| %>
|
4
|
-
<div id='flash' class="flash flash_<%= key %>">
|
5
|
-
<%= value %>
|
6
|
-
</div>
|
7
|
-
<% end %>
|
8
|
-
<article id="blog_post">
|
9
|
-
<header>
|
10
|
-
<h1><%= @blog_post.title %></h1>
|
11
|
-
<section class='details'>
|
12
|
-
<time datetime="<%=l @blog_post.published_at.to_date, :format => :default %>" class='posted_at'>
|
13
|
-
<%= t('created_at', :scope => 'blog.shared.posts', :when => l(@blog_post.published_at.to_date, :format => :short)) %>
|
14
|
-
</time>
|
15
|
-
<%= "#{t('by', :scope => 'blog.posts.show')} #{@blog_post.author.username}" if @blog_post.author.present? %>.
|
16
|
-
<% if (categories = @blog_post.categories).any? %>
|
17
|
-
<aside class='filed_in'>
|
18
|
-
<%= t('filed_in', :scope => 'blog.posts.show') %>
|
19
|
-
<% categories.each_with_index do |category, index| %>
|
20
|
-
<%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %>
|
21
|
-
<% end %>
|
22
|
-
</aside>
|
23
|
-
<% end %>
|
24
|
-
</section>
|
25
|
-
</header>
|
26
|
-
<%= @blog_post.body.html_safe %>
|
27
|
-
|
28
|
-
<% if BlogPost::ShareThis.enabled? %>
|
29
|
-
<span class="st_sharethis" displayText="ShareThis"></span>
|
30
|
-
<% end %>
|
31
|
-
</article>
|
32
|
-
<%= render :partial => '/shared/draft_page_message' unless @blog_post.nil? or @blog_post.live? -%>
|
33
|
-
<%= render 'nav' if next_or_previous?(@blog_post) %>
|
34
|
-
|
35
|
-
</div>
|
36
|
-
|
37
|
-
<% if BlogPost.comments_allowed? %>
|
38
|
-
<aside id="comments">
|
39
|
-
<h2><%= t('.comments.title') %></h2>
|
40
|
-
<% if (comments = @blog_post.comments.approved).any? %>
|
41
|
-
<%= render :partial => "comment", :collection => comments %>
|
42
|
-
<% else %>
|
43
|
-
<p>
|
44
|
-
<%= t('none', :scope => 'blog.shared.comments') %>.
|
45
|
-
</p>
|
46
|
-
<% end %>
|
47
|
-
|
48
|
-
<% flash.each do |key, value| %>
|
49
|
-
<div id='flash' class="flash flash_<%= key %>">
|
50
|
-
<%= value %>
|
51
|
-
</div>
|
52
|
-
<% end %>
|
53
|
-
|
54
|
-
<h2><%= t('.comments.add') %></h2>
|
55
|
-
<%= form_for [:blog_post, @blog_comment] do |f| %>
|
56
|
-
<%= render :partial => "/shared/admin/error_messages",
|
57
|
-
:locals => {
|
58
|
-
:object => f.object,
|
59
|
-
:include_object_name => true
|
60
|
-
} %>
|
61
|
-
<div class='field'>
|
62
|
-
<%= f.label :name %>
|
63
|
-
<%= f.text_field :name %>
|
64
|
-
</div>
|
65
|
-
<div class='field'>
|
66
|
-
<%= f.label :email %>
|
67
|
-
<%= f.email_field :email %>
|
68
|
-
</div>
|
69
|
-
<div class='field message_field'>
|
70
|
-
<%= f.label :message %>
|
71
|
-
<%= f.text_area :message, :rows => 6 %>
|
72
|
-
</div>
|
73
|
-
<div class='field form-actions'>
|
74
|
-
<%= f.submit t('.submit') %>
|
75
|
-
</div>
|
76
|
-
<% end %>
|
77
|
-
</aside>
|
78
|
-
<% end %>
|
79
|
-
<% end %>
|
80
|
-
|
81
|
-
<% content_for :body_content_right do %>
|
82
|
-
<%= render :partial => "/blog/shared/categories" %>
|
83
|
-
<%= render :partial => "/blog/shared/tags" %>
|
84
|
-
<%= render :partial => "/blog/shared/related_posts" %>
|
85
|
-
<%= render :partial => "/blog/shared/rss_feed" %>
|
86
|
-
<%= render :partial => "/blog/shared/archive_list" %>
|
87
|
-
<% end %>
|
88
|
-
|
89
|
-
<%= render :partial => "/shared/content_page", :locals => { :remove_automatic_sections => true } %>
|
90
|
-
|
91
|
-
<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
|
92
|
-
<% content_for :before_javascript_libraries, jquery_include_tags(:jquery_ui => false) %>
|
93
|
-
<% content_for :javascripts do %>
|
94
|
-
<%# enable AJAX'd post nav at your own risk until html5 history API implemented. %>
|
95
|
-
<%#= javascript_include_tag('refinerycms-blog') %>
|
96
|
-
<script src="http://w.sharethis.com/button/buttons.js"></script>
|
97
|
-
<script>stLight.options({publisher:'<%= BlogPost::ShareThis.key %>'});</script>
|
98
|
-
<% end if BlogPost::ShareThis.enabled? %>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<% content_for :body_content_title, "#{t('.posts_tagged')} “#{@tag_name.titleize}”".html_safe -%>
|
2
|
-
|
3
|
-
<% content_for :body_content_left do %>
|
4
|
-
<% if @blog_posts.any? %>
|
5
|
-
<section id="blog_posts">
|
6
|
-
<%= render :partial => "/blog/shared/post", :collection => @blog_posts %>
|
7
|
-
<%= will_paginate @blog_posts %>
|
8
|
-
</section>
|
9
|
-
<% else %>
|
10
|
-
<p><%= t('.no_blog_articles_yet') %></p>
|
11
|
-
<% end %>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<% content_for :body_content_right do %>
|
15
|
-
<%= render :partial => "/blog/shared/categories" %>
|
16
|
-
<%= render :partial => "/blog/shared/tags" %>
|
17
|
-
<%= render :partial => "/blog/shared/rss_feed" %>
|
18
|
-
<%= render :partial => "/blog/shared/archive_list" %>
|
19
|
-
<% end %>
|
20
|
-
|
21
|
-
<%= render :partial => "/shared/content_page" %>
|
22
|
-
<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
|
@@ -1,55 +0,0 @@
|
|
1
|
-
<% content_for :stylesheets, stylesheet_link_tag("ui-lightness/jquery-ui-1.8.13.custom.css") -%>
|
2
|
-
|
3
|
-
<% content_for :javascripts do %>
|
4
|
-
<%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js" %>
|
5
|
-
<script>
|
6
|
-
function split( val ) {
|
7
|
-
return val.split( /,\s*/ );
|
8
|
-
}
|
9
|
-
function extractLast( term ) {
|
10
|
-
return split( term ).pop();
|
11
|
-
}
|
12
|
-
|
13
|
-
|
14
|
-
$(document).ready(function(){
|
15
|
-
page_options.init(false, '', '')
|
16
|
-
|
17
|
-
$('<%= dom_id %>')
|
18
|
-
.bind( "keydown", function( event ) {
|
19
|
-
if ( event.keyCode === $.ui.keyCode.TAB &&
|
20
|
-
$( this ).data( "autocomplete" ).menu.active ) {
|
21
|
-
event.preventDefault()
|
22
|
-
}
|
23
|
-
})
|
24
|
-
.autocomplete({
|
25
|
-
source: function( request, response ) {
|
26
|
-
$.getJSON( "<%= url %>", {
|
27
|
-
term: extractLast( request.term )
|
28
|
-
}, response );
|
29
|
-
},
|
30
|
-
search: function() {
|
31
|
-
// custom minLength
|
32
|
-
var term = extractLast( this.value );
|
33
|
-
if ( term.length < 2 ) {
|
34
|
-
return false;
|
35
|
-
}
|
36
|
-
},
|
37
|
-
focus: function() {
|
38
|
-
// prevent value inserted on focus
|
39
|
-
return false;
|
40
|
-
},
|
41
|
-
select: function( event, ui ) {
|
42
|
-
var terms = split( this.value );
|
43
|
-
// remove the current input
|
44
|
-
terms.pop();
|
45
|
-
// add the selected item
|
46
|
-
terms.push( ui.item.value );
|
47
|
-
// add placeholder to get the comma-and-space at the end
|
48
|
-
terms.push( "" );
|
49
|
-
this.value = terms.join( ", " );
|
50
|
-
return false;
|
51
|
-
}
|
52
|
-
})
|
53
|
-
});
|
54
|
-
</script>
|
55
|
-
<% end %>
|
@@ -1,54 +0,0 @@
|
|
1
|
-
class CreateBlogStructure < ActiveRecord::Migration
|
2
|
-
|
3
|
-
def self.up
|
4
|
-
create_table :blog_posts, :id => true do |t|
|
5
|
-
t.string :title
|
6
|
-
t.text :body
|
7
|
-
t.boolean :draft
|
8
|
-
t.datetime :published_at
|
9
|
-
t.timestamps
|
10
|
-
end
|
11
|
-
|
12
|
-
add_index :blog_posts, :id
|
13
|
-
|
14
|
-
create_table :blog_comments, :id => true do |t|
|
15
|
-
t.integer :blog_post_id
|
16
|
-
t.boolean :spam
|
17
|
-
t.string :name
|
18
|
-
t.string :email
|
19
|
-
t.text :body
|
20
|
-
t.string :state
|
21
|
-
t.timestamps
|
22
|
-
end
|
23
|
-
|
24
|
-
add_index :blog_comments, :id
|
25
|
-
|
26
|
-
create_table :blog_categories, :id => true do |t|
|
27
|
-
t.string :title
|
28
|
-
t.timestamps
|
29
|
-
end
|
30
|
-
|
31
|
-
add_index :blog_categories, :id
|
32
|
-
|
33
|
-
create_table :blog_categories_blog_posts, :id => false do |t|
|
34
|
-
t.integer :blog_category_id
|
35
|
-
t.integer :blog_post_id
|
36
|
-
end
|
37
|
-
|
38
|
-
add_index :blog_categories_blog_posts, [:blog_category_id, :blog_post_id], :name => 'index_blog_categories_blog_posts_on_bc_and_bp'
|
39
|
-
|
40
|
-
load(Rails.root.join('db', 'seeds', 'refinerycms_blog.rb').to_s)
|
41
|
-
end
|
42
|
-
|
43
|
-
def self.down
|
44
|
-
UserPlugin.destroy_all({:name => "refinerycms_blog"})
|
45
|
-
|
46
|
-
Page.delete_all({:link_url => "/blog"})
|
47
|
-
|
48
|
-
drop_table :blog_posts
|
49
|
-
drop_table :blog_comments
|
50
|
-
drop_table :blog_categories
|
51
|
-
drop_table :blog_categories_blog_posts
|
52
|
-
end
|
53
|
-
|
54
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
class CreateSeoMetaForBlog < ActiveRecord::Migration
|
2
|
-
|
3
|
-
def self.up
|
4
|
-
unless ::SeoMetum.table_exists?
|
5
|
-
create_table ::SeoMetum.table_name do |t|
|
6
|
-
t.integer :seo_meta_id
|
7
|
-
t.string :seo_meta_type
|
8
|
-
|
9
|
-
t.string :browser_title
|
10
|
-
t.string :meta_keywords
|
11
|
-
t.text :meta_description
|
12
|
-
|
13
|
-
t.timestamps
|
14
|
-
end
|
15
|
-
|
16
|
-
add_index ::SeoMetum.table_name, :id
|
17
|
-
add_index ::SeoMetum.table_name, [:seo_meta_id, :seo_meta_type]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.down
|
22
|
-
# can't drop the table because someone else might be using it.
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
class AddCachedSlugs < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
add_column :blog_categories, :cached_slug, :string
|
4
|
-
add_column :blog_posts, :cached_slug, :string
|
5
|
-
end
|
6
|
-
|
7
|
-
def self.down
|
8
|
-
remove_column :blog_categories, :cached_slug
|
9
|
-
remove_column :blog_posts, :cached_slug
|
10
|
-
end
|
11
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
class AddPrimaryKeyToCategorizations < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
unless ::Categorization.column_names.include?("id")
|
4
|
-
add_column :blog_categories_blog_posts, :id, :primary_key
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.down
|
9
|
-
remove_column :blog_categories_blog_posts, :id
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
data/features/authors.feature
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
@blog @blog_authors
|
2
|
-
Feature: Blog Post Authors
|
3
|
-
Blog posts can be assigned authors through the given user model
|
4
|
-
current_user is assumed through admin screens
|
5
|
-
|
6
|
-
Scenario: Saving a blog post in blog_posts#new associates the current_user as the author
|
7
|
-
Given I am a logged in refinery user
|
8
|
-
|
9
|
-
When I am on the new blog post form
|
10
|
-
And I fill in "Title" with "This is my blog post"
|
11
|
-
And I fill in "blog_post_body" with "And I love it"
|
12
|
-
And I press "Save"
|
13
|
-
|
14
|
-
Then there should be 1 blog post
|
15
|
-
And the blog post should belong to me
|
data/features/category.feature
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
@blog @blog_categories
|
2
|
-
Feature: Blog Post Categories
|
3
|
-
Blog posts can be assigned categories
|
4
|
-
|
5
|
-
Background:
|
6
|
-
Given I am a logged in refinery user
|
7
|
-
Given there is a category titled "Videos"
|
8
|
-
|
9
|
-
Scenario: The blog post new/edit form has category_list
|
10
|
-
When I am on the new blog post form
|
11
|
-
Then I should see "Tags"
|
12
|
-
Then I should see "Videos"
|
13
|
-
|
14
|
-
Scenario: The blog post new/edit form saves categories
|
15
|
-
When I am on the new blog post form
|
16
|
-
And I fill in "Title" with "This is my blog post"
|
17
|
-
And I fill in "blog_post_body" with "And I love it"
|
18
|
-
And I check "Videos"
|
19
|
-
And I press "Save"
|
20
|
-
|
21
|
-
Then there should be 1 blog post
|
22
|
-
And the blog post should have 1 category
|
23
|
-
And the blog post should have the category "Videos"
|
@@ -1,9 +0,0 @@
|
|
1
|
-
require 'factory_girl'
|
2
|
-
|
3
|
-
Factory.define(:blog_post, :class => BlogPost) do |f|
|
4
|
-
f.sequence(:title) { |n| "Top #{n} Shopping Centers in Chicago" }
|
5
|
-
f.body "These are the top ten shopping centers in Chicago. You're going to read a long blog post about them. Come to peace with it."
|
6
|
-
f.draft false
|
7
|
-
f.tag_list "chicago, shopping, fun times"
|
8
|
-
f.published_at Time.now
|
9
|
-
end
|
data/features/support/paths.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
module NavigationHelpers
|
2
|
-
module Refinery
|
3
|
-
module Blog
|
4
|
-
def path_to(page_name)
|
5
|
-
case page_name
|
6
|
-
when /the list of blog posts/
|
7
|
-
admin_blog_posts_path
|
8
|
-
when /the new blog posts? form/
|
9
|
-
new_admin_blog_post_path
|
10
|
-
else
|
11
|
-
begin
|
12
|
-
if page_name =~ /the blog post titled "?([^\"]*)"?/ and (page = BlogPost.find_by_title($1)).present?
|
13
|
-
self.url_for(page.url)
|
14
|
-
else
|
15
|
-
nil
|
16
|
-
end
|
17
|
-
rescue
|
18
|
-
nil
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|