blog-gem 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cef6e4b266765034e04aa5c3dc0650c33bf95ef3
4
- data.tar.gz: 7a6b02293f613b3fafaa99656f669d60ac38a6f1
3
+ metadata.gz: 10fd88dda8a6a69c6cdb2af0389107eb0f4991f9
4
+ data.tar.gz: 139ab0349259d7cde9187f34c73bd4606f0e7655
5
5
  SHA512:
6
- metadata.gz: 8a14ac003f9f58ef7ac8e3bf621090016ebe6df446c2acbb2c486fe01679a2b237597167d673899169acd8387ab22f41c6768fa640b029beb546f73e12315f89
7
- data.tar.gz: 36bf48da51a6d0fbdec9e562bbf0a2bef6ffde0b9a2854b59da7ae6c31ace1991505fce90881cfc2cd68dd5b5539556df11f3f2093de17e71f4fbb95aeb7c75b
6
+ metadata.gz: e3c724e9bf192a3fd6fc8de6c0dcefcf0c6acdb71bcc6ef90d35091127b00621582c9bcaedd02bf081cef2a56dfb12b7200fdcfa0a34ade90f587d5bae0066cc
7
+ data.tar.gz: bd23856d556caa64b968eec1054cdebe86f16422a9e92f239875623cfd8087b3df3459a7c61a55b786616652ab12ef7b4d694f0cc8e478bd356d7f10c48e6a57
@@ -39,7 +39,8 @@ class Blog::Gem::BlogController < Blog::Gem::ApplicationController
39
39
  render json: @posts.map{|x| {title: x.title, teaser: x.teaser, url: x.url, tags: x.tags, category: x.category, author: x.author_name, thumbnail: x.thumbnail.url(:medium)}}
40
40
  end
41
41
  format.html do
42
- @posts = posts.published.paginate(:page => params[:page], :per_page => 30)
42
+ @current_path = blogs_path
43
+ @posts = posts.published.paginate(page: params[:page], per_page: Blog::Gem.per_page)
43
44
  end
44
45
  end
45
46
  end
@@ -40,7 +40,7 @@
40
40
  p = raw post.teaser
41
41
  = link_to "#{t("blog.read_more")} #{icon("angle-right")}".html_safe, post.to_path, class: "btn btn-link"
42
42
  .gap
43
- = will_paginate @posts
43
+ = will_paginate @posts, renderer: BootstrapPagination::Rails
44
44
  - else
45
45
  h2 = t("blog.not_found.heading")
46
46
  h5 = t("blog.not_found.lead")
@@ -6,6 +6,7 @@ require "stringex"
6
6
  require "gravtastic"
7
7
  require "bcrypt"
8
8
  require "will_paginate"
9
+ require "will_paginate-bootstrap"
9
10
  require "simple_form"
10
11
  require "nokogiri"
11
12
  require "blog/gem/engine"
@@ -22,15 +23,17 @@ module Blog
22
23
  mattr_accessor :url
23
24
  mattr_accessor :image_path
24
25
  mattr_accessor :title_enable
26
+ mattr_accessor :per_page
25
27
 
26
28
  self.archive_count = 13
27
- self.home_posts_count = 6
29
+ self.home_posts_count = 8
28
30
  self.tags_count = 24
29
31
  self.widget_posts_count = 6
30
32
  self.categories = {}
31
33
  self.path = "/blog"
32
34
  self.image_path = "/uploads"
33
35
  self.title_enable = true
36
+ self.per_page = 5
34
37
  end
35
38
 
36
39
  def self.setup(&block)
@@ -1,5 +1,5 @@
1
1
  module Blog
2
2
  module Gem
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blog-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Thelang
@@ -137,6 +137,20 @@ dependencies:
137
137
  - - ">="
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
+ - !ruby/object:Gem::Dependency
141
+ name: will_paginate-bootstrap
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ type: :runtime
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
140
154
  - !ruby/object:Gem::Dependency
141
155
  name: simple_form
142
156
  requirement: !ruby/object:Gem::Requirement