foliate 1.1.0 → 1.2.0

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: 1379d91804fb3050affdd4a02ff646f2365715ac
4
- data.tar.gz: ce950722db7f2aca60ee3cfa3bdd51fc738d6538
3
+ metadata.gz: 623f2bcd5507e824c335e58a1f784fbbfcf92bc8
4
+ data.tar.gz: fb3261438e55746a95fca86a8304de049b14d7d8
5
5
  SHA512:
6
- metadata.gz: f7aab7c69bd58aeafcb664fb318e358c41e1fa7df0705cc5c402d8f1b53bc0114998ea4555b2439143d1d9f0635ba1371a8dee1b8afcd0ade86c785b2be2e7e3
7
- data.tar.gz: efbb16cee1e2ec271223ddd8395f9ebbdae7e92e7b51e6fafb6b20321ea793c9dfd14781d31fec07f74be929f8cb57f658b0a1b6993547cdcc88bf17dc591e75
6
+ metadata.gz: 9adbdc17b6c8b3960e56664232a78737ad7e21cd6ab3e1d4e6133c6ed594804541f104a93c972cea4d584c77545cc5bf2ac6b4d74a89cda90baea559ae7a9636
7
+ data.tar.gz: 3dc543c00f892cef7abfa351907a5a492db3539bcd03a61ad8f55f9febee7a504a563b0852539859aa4d40662cb9043f4180981bc8e7d340dd64a5610bd4b408
data/README.md CHANGED
@@ -46,9 +46,24 @@ Do something with @posts here...
46
46
 
47
47
  The *foliate* installation generator creates
48
48
  "app/views/pagination/_pagination.html.erb" and
49
- "app/assets/stylesheets/pagination.css" in your project directory.
49
+ "app/assets/stylesheets/pagination.scss" in your project directory.
50
50
  These files can be freely edited to suit your needs.
51
51
 
52
+ The installation generator also supports a `--bootstrap` option which
53
+ causes the generated stylesheet to apply [Bootstrap 4] classes via Sass
54
+ `@extend` directives. This allows the pagination element to directly
55
+ blend in with a Bootstrap-styled site. For this generated stylesheet to
56
+ work, Bootstrap must be loaded into the *same* Sass scope. For example:
57
+
58
+ ```scss
59
+ // in application.scss
60
+ @import "bootstrap";
61
+ @import "pagination";
62
+ ```
63
+
64
+ [Bootstrap 4]: https://getbootstrap.com/
65
+
66
+
52
67
  ## Records per page
53
68
 
54
69
  By default, *foliate* allots `Foliate.config.default_per_page` records
@@ -1,3 +1,3 @@
1
1
  module Foliate
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -7,6 +7,9 @@ module Foliate
7
7
  class InstallGenerator < Rails::Generators::Base
8
8
  source_root File.join(__dir__, "templates")
9
9
 
10
+ class_option :bootstrap, type: :boolean, default: false,
11
+ desc: "Generate Bootstrap-based stylesheet"
12
+
10
13
  def copy_config
11
14
  template "config/initializer.rb.erb", "config/initializers/foliate.rb"
12
15
  copy_file "config/locales.yml", "config/locales/foliate.yml"
@@ -14,7 +17,7 @@ module Foliate
14
17
 
15
18
  def copy_view
16
19
  copy_file "views/page_input.html.erb", "app/views/pagination/_pagination.html.erb"
17
- copy_file "stylesheets/page_input.css", "app/assets/stylesheets/pagination.css"
20
+ template "stylesheets/page_input.scss.erb", "app/assets/stylesheets/pagination.scss"
18
21
  end
19
22
  end
20
23
  end
@@ -1,5 +1,9 @@
1
1
  .foliate-page-link {
2
+ <% if options[:bootstrap] -%>
3
+ @extend .text-muted;
4
+ <% else -%>
2
5
  color: rgba(0, 0, 0, 0.6);
6
+ <% end -%>
3
7
  }
4
8
 
5
9
  .foliate-i-of-n {
@@ -7,16 +11,26 @@
7
11
  }
8
12
 
9
13
  .foliate-form {
14
+ <% if options[:bootstrap] -%>
15
+ @extend .form-inline;
16
+ <% end -%>
10
17
  display: inline-block;
11
18
  margin: 0;
12
19
  }
13
20
 
14
21
  .foliate-page-input {
15
- font-size: 1em;
16
- width: 2.5em;
22
+ <% if options[:bootstrap] -%>
23
+ @extend .form-control;
24
+ padding-left: 0;
25
+ padding-right: 0;
26
+ width: 2.5em !important;
27
+ <% else -%>
28
+ line-height: 1.5em;
17
29
  border: 1px solid rgba(0, 0, 0, 0.5);
18
30
  border-radius: 2px;
19
- line-height: 1.5em;
31
+ width: 2.5em;
32
+ <% end -%>
33
+ font-size: 1em;
20
34
  text-align: center;
21
35
  font-family: monospace;
22
36
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foliate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Hefner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-18 00:00:00.000000000 Z
11
+ date: 2018-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -71,7 +71,7 @@ files:
71
71
  - lib/generators/foliate/install/install_generator.rb
72
72
  - lib/generators/foliate/install/templates/config/initializer.rb.erb
73
73
  - lib/generators/foliate/install/templates/config/locales.yml
74
- - lib/generators/foliate/install/templates/stylesheets/page_input.css
74
+ - lib/generators/foliate/install/templates/stylesheets/page_input.scss.erb
75
75
  - lib/generators/foliate/install/templates/views/page_input.html.erb
76
76
  homepage: https://github.com/jonathanhefner/foliate
77
77
  licenses: