activeadmin-mongoid-blog 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -39,6 +39,8 @@ Install blog models, admin files, routes and blog controller, replace `blog` val
39
39
 
40
40
  $ rails g active_admin:blog:install blog
41
41
 
42
+ Run `bundle` to install new gems.
43
+
42
44
  As blog post editor `redactor.js` is used. It comes with a image uploading featured supported by **carrierwave**, install `Picture` model with command:
43
45
 
44
46
  $ rails generate redactor:install
@@ -55,6 +57,6 @@ Add to your `active_admin.css.scss`:
55
57
 
56
58
  Install default views templates to `/app/views/blog`:
57
59
 
58
- $ rails g active_admin:blog:views
60
+ $ rails g active_admin:blog:views blog
59
61
 
60
62
  ### The End
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = 'activeadmin-mongoid-blog'
6
- gem.version = '0.3.0'
6
+ gem.version = '0.3.1'
7
7
  gem.summary = 'Blog app on the top of activeadmin and mongoid, using redactor and select2 plugins.'
8
8
  gem.description = ''
9
9
  gem.license = 'MIT'
@@ -7,7 +7,12 @@
7
7
 
8
8
  <!-- CATEGORIES -->
9
9
  <% if post.categories.size > 0 %>
10
- <span>Posted in: <%= post.category_links_string %></span>
10
+ <span>Posted in:</span>
11
+ <ul>
12
+ <% post.categories.each do |c| %>
13
+ <li><a href='<% blog_path() + "?category=#{c.name}"%>' title="<%= c.name %>"><%= c.name %></a></li>
14
+ <% end %>
15
+ </ul>
11
16
  <% end %>
12
17
 
13
18
  <!-- FEATURED IMAGE LINK --!>
@@ -9,7 +9,12 @@
9
9
 
10
10
  <!-- CATEGORIES -->
11
11
  <% if @post.categories.size > 0 %>
12
- <span>Posted in: <%= post.category_links_string %></span>
12
+ <span>Posted in:</span>
13
+ <ul>
14
+ <% @post.categories.each do |c| %>
15
+ <li><a href='<% blog_path() + "?category=#{c.name}"%>' title="<%= c.name %>"><%= c.name %></a></li>
16
+ <% end %>
17
+ </ul>
13
18
  <% end %>
14
19
 
15
20
  <!-- CONTENT -->
@@ -38,10 +38,6 @@ class BlogPost
38
38
  false
39
39
  end
40
40
 
41
- def category_links_string
42
- categories.collect{|c| link_to(c.name, admin_category_path(c))}.join(", ")
43
- end
44
-
45
41
  def excerpt
46
42
  html = Nokogiri::HTML(content)
47
43
  begin
@@ -56,7 +52,7 @@ class BlogPost
56
52
  end
57
53
 
58
54
  # Class methods
59
- def published_in_category(category_slug)
55
+ def self.published_in_category(category_slug)
60
56
  category = BlogCategory.find_by_permalink!(category_slug)
61
57
  category.blog_posts.published
62
58
  end
@@ -1,7 +1,7 @@
1
1
  //= require select2
2
2
  //= require redactor-rails
3
3
 
4
- #edit_post {
4
+ #edit_post, #new_post {
5
5
  #post_content_input label { display:none; }
6
6
  #post_title_input label { display:none; }
7
7
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin-mongoid-blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: