rails-theme-helper 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2d0d49950455a4edf8f9e8a589b5cba77c6ebca
4
- data.tar.gz: b7b410d215413b1facc06640a89455df6e7a6e9d
3
+ metadata.gz: a9aff299414baf2daf57cb77406923e59f793b0c
4
+ data.tar.gz: e6d6944dc95607c5e1ddc724a2ecc65ab669e28e
5
5
  SHA512:
6
- metadata.gz: 82b2c4f7105201bc05f22446128d3cb08068ee8f1e70084b797faa695fbd6a5f96409389c0eec6815e71e3c2e4da69e6016b730e1e52c8afcafaaa03df129e0c
7
- data.tar.gz: 3882856228868b6accb4c13b259ffab48fa3545fe2c5a56fd046d3188ea209b2c7cbd083febb44c0ca7b748e7dbb244f2e421f7434ec6c20968fc549276efb05
6
+ metadata.gz: 71164e1849d575f1e22531db1e6f18644756f245ee77a3e4aa8ef7311971862efd1a223476db4a76a0d201c6e758845fb69910483e38df99fd8525dabc052b84
7
+ data.tar.gz: 4ed526d34197635375ccd6cca66451622b12bf65be68fdfd6c996dcf46f586c386104a3315df01ab1807a4ad72598b300ed8990c3bac4b03c612fb018b87105b
@@ -0,0 +1,28 @@
1
+ require 'active_support/concern'
2
+
3
+ module RailsTheme
4
+ module Pagination
5
+ extend ActiveSupport::Concern
6
+ included do
7
+ before_action :clear_pagination_options
8
+ end
9
+
10
+ module ClassMethods
11
+ end
12
+
13
+ protected
14
+
15
+ def clear_pagination_options
16
+ RailsTheme::Bootstrap::LinkRenderer.link_options = nil
17
+ end
18
+
19
+ def set_ajax_tab_pagination_render_options tab_name
20
+ RailsTheme::Bootstrap::LinkRenderer.link_options = {
21
+ 'data-remote' => true,
22
+ 'data-type' => :html,
23
+ 'data-toggle' => 'tab',
24
+ 'data-target' => "##{tab_name}"
25
+ }
26
+ end
27
+ end
28
+ end
@@ -27,7 +27,7 @@ module RailsTheme
27
27
  end
28
28
 
29
29
  def flash_box key, value
30
- alert_class = case key
30
+ alert_class = case key.to_sym
31
31
  when :notice
32
32
  'alert-warning'
33
33
  when :error
@@ -4,5 +4,6 @@
4
4
  outer_window: 0,
5
5
  class: 'pagination',
6
6
  previous_label: t('.previous_label'),
7
- next_label: t('.next_label')
7
+ next_label: t('.next_label'),
8
+ params: params || {}
8
9
  }) %>
@@ -1,3 +1,3 @@
1
1
  module RailsThemeHelper
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -30,7 +30,7 @@ module RailsTheme
30
30
  protected
31
31
 
32
32
  def html_container(html)
33
- tag :div, tag(:ul, html), container_attributes
33
+ tag :ul, html, container_attributes
34
34
  end
35
35
 
36
36
  def page_number(page)
@@ -39,12 +39,12 @@ module RailsTheme
39
39
  unless page == current_page
40
40
  tag :li, link(page, page, options)
41
41
  else
42
- tag :li, link(page, '#', options), class: 'active'
42
+ tag :li, link(page, nil, {}), class: 'active'
43
43
  end
44
44
  end
45
45
 
46
46
  def gap
47
- tag :li, link(super, '#'), class: 'disabled'
47
+ tag :li, link(super, nil), class: 'disabled'
48
48
  end
49
49
 
50
50
  def previous_or_next_page(page, text, class_name)
@@ -55,9 +55,9 @@ module RailsTheme
55
55
  if page
56
56
  tag :li, link(text, page, options), class: class_name
57
57
  else
58
- tag :li, link(text, "#", options), class: class_name + ' disabled'
58
+ tag :li, link(text, nil, {}), class: class_name + ' disabled'
59
59
  end
60
60
  end
61
- end
61
+ end
62
62
  end
63
63
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-theme-helper
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
  - Tse-Ching Ho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-17 00:00:00.000000000 Z
11
+ date: 2014-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -65,6 +65,7 @@ files:
65
65
  - README.md
66
66
  - Rakefile
67
67
  - app/assets/stylesheets/rails_theme/simple_layout.css.sass
68
+ - app/controllers/concerns/rails_theme/pagination.rb
68
69
  - app/helpers/rails_theme/bootstrap/button_helper.rb
69
70
  - app/helpers/rails_theme/bootstrap/dropdown_helper.rb
70
71
  - app/helpers/rails_theme/bootstrap/form_helper.rb