tb_blog 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{Readme.markdown → Readme.md} +10 -17
- data/app/assets/javascripts/admin/blog/posts.js +1 -1
- data/app/controllers/admin/news_posts_controller.rb +5 -2
- data/app/models/spud_post.rb +1 -0
- data/app/views/admin/posts/_form.html.erb +1 -2
- data/db/migrate/20140406182651_add_primary_key_to_spud_post_categories_posts.rb +5 -0
- data/lib/spud_blog/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 802c108fe17335d97afc54c19b4f96b4290e5955
|
4
|
+
data.tar.gz: 3eac913036ca3b888fe64e5d487e0c6f946e0074
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34caa2105ac16c419d727376e74bcf6e2a4815c84ed303ec409555145c5b2c4352614fd221f0c4c9e7c930c0e6d8fbab32d53f395e0808a77c965051bdba3ee3
|
7
|
+
data.tar.gz: 8e2b6cd24220aeba585b4b1b7eb866be797c343353bca397bac469ff65d34ffb01009eb0060db8db27681a8f5b199712d52984d2e3186acf65531072a084770b
|
@@ -1,13 +1,7 @@
|
|
1
|
-
|
1
|
+
TB Blog
|
2
2
|
========
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
__NOTE:__ This project is still in its early infancy.
|
7
|
-
|
8
|
-
## Release Notes
|
9
|
-
|
10
|
-
* 0.8.15 - Increased Spam Protection and Akismet spam service support (Check further down in Readme for instructions)
|
4
|
+
TB Blog is a Blog Engine designed to be robust, easy to use, and light weight.
|
11
5
|
|
12
6
|
## Installation/Usage
|
13
7
|
|
@@ -19,14 +13,13 @@ __NOTE:__ This project is still in its early infancy.
|
|
19
13
|
2. Run bundle install
|
20
14
|
3. Copy in database migrations to your new rails project
|
21
15
|
|
22
|
-
|
23
|
-
rake db:migrate
|
16
|
+
rails g spud:setup
|
24
17
|
|
25
|
-
4. run a rails server instance and point your browser to /
|
18
|
+
4. run a rails server instance and point your browser to /admin
|
26
19
|
|
27
20
|
## Configuration
|
28
21
|
|
29
|
-
|
22
|
+
TB Blog current accepts the following configuration options.
|
30
23
|
|
31
24
|
Spud::Blog.configure do |config|
|
32
25
|
config.base_layout = 'blog'
|
@@ -47,11 +40,11 @@ A number of built-in views have been provided to help you get started with the f
|
|
47
40
|
|
48
41
|
rails generate spud:blog:views
|
49
42
|
|
50
|
-
__NOTE:__ The built-in views are likely to undergo changes as features are added to the blogging engine. If a new version of
|
43
|
+
__NOTE:__ The built-in views are likely to undergo changes as features are added to the blogging engine. If a new version of TB Blog does not play nicely with your customized views, try backing up your views to an alternate location and running the views generator again to see what has changed.
|
51
44
|
|
52
45
|
## Javascript Driver
|
53
46
|
|
54
|
-
|
47
|
+
TB Blog includes a small, unobtrusive javascript driver that adds functionality to the built-in views. Including the driver is optional, as all client-side views and controllers are designed to work whether you include it or not.
|
55
48
|
|
56
49
|
<%= javascript_include_tag 'spud/blog' %>
|
57
50
|
|
@@ -59,7 +52,7 @@ Spud Blog includes a small, unobtrusive javascript driver that adds functionalit
|
|
59
52
|
|
60
53
|
You may find that your blog requires a field that isn't included in the default `spud_post` model. Adding custom fields is easy.
|
61
54
|
|
62
|
-
1. Set `has_custom_fields` to true in your
|
55
|
+
1. Set `has_custom_fields` to true in your TB Blog configuration
|
63
56
|
2. Create a migration adding the necessary column(s) to your database
|
64
57
|
|
65
58
|
class AddCaptionToPosts < ActiveRecord::Migration
|
@@ -80,7 +73,7 @@ You may find that your blog requires a field that isn't included in the default
|
|
80
73
|
|
81
74
|
## Extending the Post Model
|
82
75
|
|
83
|
-
Rails engines allow you to extend or even completely override classes by adding them to your local application. Source files found in your local app's path will take precedence over those found within the
|
76
|
+
Rails engines allow you to extend or even completely override classes by adding them to your local application. Source files found in your local app's path will take precedence over those found within the TB Blog gem. Lets say you wanted to extend the SpudPost model.
|
84
77
|
|
85
78
|
1. Create a file at `app/models/spud_post.rb`
|
86
79
|
2. Add the following code:
|
@@ -98,7 +91,7 @@ Rails engines allow you to extend or even completely override classes by adding
|
|
98
91
|
|
99
92
|
## Akismet Support
|
100
93
|
|
101
|
-
|
94
|
+
TB Blog Engine now supports spam comment filtering using akismet. All you have to do is configure the rakismet gem and enable_rakismet in the spud_blog configuration. Add the following to your application.rb file
|
102
95
|
|
103
96
|
Spud::Blog.configure do |config|
|
104
97
|
config.enable_rakismet = true
|
@@ -3,7 +3,7 @@ spud.admin.posts = new function(){
|
|
3
3
|
var self = this;
|
4
4
|
|
5
5
|
this.edit = function(){
|
6
|
-
|
6
|
+
spud.admin.date_picker.init();
|
7
7
|
|
8
8
|
$('body').on('click', '.spud_post_add_category', self.clickedPostAddCategory);
|
9
9
|
$('body').on('click', '.save_post_category_button', self.submittedPostCategoryForm);
|
@@ -6,7 +6,7 @@ class Admin::NewsPostsController < Admin::ApplicationController
|
|
6
6
|
belongs_to_spud_app :news_posts
|
7
7
|
|
8
8
|
def index
|
9
|
-
@posts = SpudPost.where(:is_news => true).order('published_at desc').includes(:
|
9
|
+
@posts = SpudPost.where(:is_news => true).order('published_at desc').includes(:author).paginate(:page => params[:page], :per_page => 15)
|
10
10
|
respond_with @posts
|
11
11
|
end
|
12
12
|
|
@@ -34,6 +34,7 @@ class Admin::NewsPostsController < Admin::ApplicationController
|
|
34
34
|
@categories = SpudPostCategory.grouped
|
35
35
|
params[:spud_post][:spud_site_ids] ||= []
|
36
36
|
@post = SpudPost.new(post_params)
|
37
|
+
@post.is_news = true
|
37
38
|
if @post.save
|
38
39
|
flash[:notice] = 'News Post was successfully created.'
|
39
40
|
end
|
@@ -58,7 +59,9 @@ private
|
|
58
59
|
end
|
59
60
|
|
60
61
|
def post_params
|
61
|
-
params.require(:spud_post).permit(:published_at, :title, :content, :spud_user_id, :url_name, :visible, :comments_enabled, :meta_keywords, :meta_description, :content_format,
|
62
|
+
params.require(:spud_post).permit(:published_at, :title, :content, :spud_user_id, :url_name, :visible, :comments_enabled, :meta_keywords, :meta_description, :content_format,
|
63
|
+
:category_ids => [], :spud_site_ids => []
|
64
|
+
)
|
62
65
|
end
|
63
66
|
|
64
67
|
end
|
data/app/models/spud_post.rb
CHANGED
@@ -32,7 +32,7 @@
|
|
32
32
|
|
33
33
|
<div class="spud_post_form_row">
|
34
34
|
<%= f.label :published_at, 'Publish Date' %>
|
35
|
-
<%= f.text_field :published_at
|
35
|
+
<%= f.text_field :published_at, :value => f.object.published_at.strftime("%Y-%m-%d %H:%M"), :class => 'tb-form-date-picker' %>
|
36
36
|
<span class="time_select">
|
37
37
|
<%= f.time_select :published_at, :ignore_date => true,:ampm => true%>
|
38
38
|
</span>
|
@@ -106,7 +106,6 @@
|
|
106
106
|
</div>
|
107
107
|
|
108
108
|
</fieldset>
|
109
|
-
<%= f.hidden_field :is_news %>
|
110
109
|
|
111
110
|
<div class="form-actions">
|
112
111
|
<%=f.submit "Save Post", :class=>"btn btn-primary form-btn","data-loading-text"=>"Saving..."%> or <%=link_to "cancel",request.referer, :class => "btn"%>
|
data/lib/spud_blog/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tb_blog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Westlake Design
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -215,7 +215,7 @@ extra_rdoc_files: []
|
|
215
215
|
files:
|
216
216
|
- MIT-LICENSE
|
217
217
|
- Rakefile
|
218
|
-
- Readme.
|
218
|
+
- Readme.md
|
219
219
|
- app/assets/images/spud/admin/news_thumb.png
|
220
220
|
- app/assets/images/spud/admin/news_thumb@2x.png
|
221
221
|
- app/assets/images/spud/admin/posts_thumb.png
|
@@ -281,6 +281,7 @@ files:
|
|
281
281
|
- db/migrate/20121113135812_add_nested_set_to_post_categories.rb
|
282
282
|
- db/migrate/20130120151857_add_content_format_to_spud_posts.rb
|
283
283
|
- db/migrate/20130121130612_add_content_processed_to_spud_post.rb
|
284
|
+
- db/migrate/20140406182651_add_primary_key_to_spud_post_categories_posts.rb
|
284
285
|
- lib/generators/spud/blog/random_posts_generator.rb
|
285
286
|
- lib/generators/spud/blog/views_generator.rb
|
286
287
|
- lib/spud_blog/configuration.rb
|