ui_bibz 1.2.2 → 1.2.3

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.
Files changed (85) hide show
  1. checksums.yaml +5 -13
  2. data/.yardoc/checksums +19 -19
  3. data/.yardoc/object_types +0 -0
  4. data/.yardoc/objects/root.dat +0 -0
  5. data/Gemfile.lock +4 -1
  6. data/README.md +46 -45
  7. data/doc/UiBibz/Concerns/Models/Searchable/ClassMethods.html +2 -2
  8. data/doc/UiBibz/Concerns/Models/Searchable.html +2 -2
  9. data/doc/UiBibz/Concerns/Models.html +2 -2
  10. data/doc/UiBibz/Concerns.html +2 -2
  11. data/doc/UiBibz/Helpers/MetaHelper.html +7 -6
  12. data/doc/UiBibz/Helpers/UiCoreHelper.html +14 -14
  13. data/doc/UiBibz/Helpers/UiUxHelper.html +4 -4
  14. data/doc/UiBibz/Helpers/UtilsHelper.html +2 -2
  15. data/doc/UiBibz/Helpers.html +2 -2
  16. data/doc/UiBibz/Rails/Engine.html +2 -2
  17. data/doc/UiBibz/Rails.html +2 -2
  18. data/doc/UiBibz/Ui/Base.html +2 -2
  19. data/doc/UiBibz/Ui/Core/Alert.html +26 -23
  20. data/doc/UiBibz/Ui/Core/Bar.html +21 -18
  21. data/doc/UiBibz/Ui/Core/Breadcrumb.html +22 -20
  22. data/doc/UiBibz/Ui/Core/BreadcrumbLink.html +23 -21
  23. data/doc/UiBibz/Ui/Core/Button.html +28 -24
  24. data/doc/UiBibz/Ui/Core/ButtonDropdown.html +29 -26
  25. data/doc/UiBibz/Ui/Core/ButtonGroup.html +27 -24
  26. data/doc/UiBibz/Ui/Core/ButtonLink.html +29 -25
  27. data/doc/UiBibz/Ui/Core/ButtonSplitDropdown.html +29 -26
  28. data/doc/UiBibz/Ui/Core/Col.html +23 -20
  29. data/doc/UiBibz/Ui/Core/Component.html +30 -28
  30. data/doc/UiBibz/Ui/Core/Dropdown.html +27 -24
  31. data/doc/UiBibz/Ui/Core/DropdownDivider.html +3 -3
  32. data/doc/UiBibz/Ui/Core/DropdownHeader.html +20 -18
  33. data/doc/UiBibz/Ui/Core/DropdownLink.html +27 -24
  34. data/doc/UiBibz/Ui/Core/Glyph.html +26 -23
  35. data/doc/UiBibz/Ui/Core/Jumbotron.html +21 -18
  36. data/doc/UiBibz/Ui/Core/Label.html +27 -23
  37. data/doc/UiBibz/Ui/Core/List.html +31 -28
  38. data/doc/UiBibz/Ui/Core/ListGroup.html +24 -22
  39. data/doc/UiBibz/Ui/Core/Modal.html +26 -24
  40. data/doc/UiBibz/Ui/Core/ModalBody.html +16 -14
  41. data/doc/UiBibz/Ui/Core/ModalFooter.html +16 -14
  42. data/doc/UiBibz/Ui/Core/ModalHeader.html +17 -15
  43. data/doc/UiBibz/Ui/Core/Nav.html +20 -18
  44. data/doc/UiBibz/Ui/Core/NavDropdown.html +23 -21
  45. data/doc/UiBibz/Ui/Core/NavLink.html +22 -20
  46. data/doc/UiBibz/Ui/Core/Navbar.html +29 -27
  47. data/doc/UiBibz/Ui/Core/NavbarForm.html +22 -19
  48. data/doc/UiBibz/Ui/Core/NavbarNav.html +17 -16
  49. data/doc/UiBibz/Ui/Core/NavbarText.html +16 -15
  50. data/doc/UiBibz/Ui/Core/Panel.html +27 -23
  51. data/doc/UiBibz/Ui/Core/ProgressBar.html +23 -20
  52. data/doc/UiBibz/Ui/Core/Row.html +13 -11
  53. data/doc/UiBibz/Ui/Core/Stars.html +23 -19
  54. data/doc/UiBibz/Ui/Core.html +3 -3
  55. data/doc/UiBibz/Ui/Ux/Actionable.html +6 -6
  56. data/doc/UiBibz/Ui/Ux/Actions.html +2 -2
  57. data/doc/UiBibz/Ui/Ux/Column.html +2 -2
  58. data/doc/UiBibz/Ui/Ux/Columns.html +2 -2
  59. data/doc/UiBibz/Ui/Ux/Grid.html +23 -21
  60. data/doc/UiBibz/Ui/Ux/Paginable.html +5 -5
  61. data/doc/UiBibz/Ui/Ux/Searchable.html +4 -4
  62. data/doc/UiBibz/Ui/Ux/Sortable.html +2 -2
  63. data/doc/UiBibz/Ui/Ux/Store.html +2 -2
  64. data/doc/UiBibz/Ui/Ux/Table.html +36 -34
  65. data/doc/UiBibz/Ui/Ux/TablePagination.html +22 -16
  66. data/doc/UiBibz/Ui/Ux/TablePaginationPerPage.html +17 -15
  67. data/doc/UiBibz/Ui/Ux/TablePanel.html +58 -50
  68. data/doc/UiBibz/Ui/Ux/TableSearchField.html +4 -4
  69. data/doc/UiBibz/Ui/Ux.html +3 -3
  70. data/doc/UiBibz/Ui.html +2 -2
  71. data/doc/UiBibz/Utils/Internationalization.html +2 -2
  72. data/doc/UiBibz/Utils.html +2 -2
  73. data/doc/UiBibz.html +3 -3
  74. data/doc/_index.html +6 -6
  75. data/doc/file.README.html +734 -623
  76. data/doc/index.html +734 -623
  77. data/doc/method_list.html +227 -227
  78. data/doc/top-level-namespace.html +2 -2
  79. data/lib/ui_bibz/ui/ux/table/extensions/paginable.rb +2 -2
  80. data/lib/ui_bibz/ui/ux/table/table_pagination.rb +3 -1
  81. data/lib/ui_bibz/ui/ux/table/table_pagination_per_page.rb +10 -2
  82. data/lib/ui_bibz/ui/ux/table/table_panel.rb +24 -6
  83. data/lib/ui_bibz/ui/ux/table/table_search_field.rb +9 -1
  84. data/lib/ui_bibz/version.rb +1 -1
  85. metadata +39 -39
@@ -103,9 +103,9 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Fri Oct 2 15:02:51 2015 by
106
+ Generated on Mon Oct 19 15:25:14 2015 by
107
107
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108
- 0.8.7.6 (ruby-1.9.3).
108
+ 0.8.7.6 (ruby-2.2.3).
109
109
  </div>
110
110
 
111
111
  </body>
@@ -10,8 +10,8 @@ module UiBibz::Ui::Ux
10
10
  # Render html tag
11
11
  def render
12
12
  content_tag :div do
13
- concat UiBibz::Ui::Ux::TablePagination.new(store: @store).render
14
- concat UiBibz::Ui::Ux::TablePaginationPerPage.new(store: @store).render
13
+ concat UiBibz::Ui::Ux::TablePagination.new(@options.merge({ store: @store })).render
14
+ concat UiBibz::Ui::Ux::TablePaginationPerPage.new(@options.merge({ store: @store })).render
15
15
  concat tag(:br, class: 'ui-bibz-clear')
16
16
  end
17
17
  end
@@ -35,7 +35,9 @@ module UiBibz::Ui::Ux
35
35
 
36
36
  # Render html tag with boostrap pagination theme
37
37
  def render
38
- paginate_parameters = { controller: store.controller }.merge(store.parameters)
38
+ paginate_parameters = { controller: store.controller }
39
+ paginate_parameters = paginate_parameters.merge({ store_id: store.id }) unless store.id.nil?
40
+ paginate_parameters = paginate_parameters.merge(store.parameters)
39
41
  will_paginate(store.records, params: paginate_parameters, renderer: BootstrapPagination::Rails)
40
42
  end
41
43
 
@@ -35,7 +35,7 @@ module UiBibz::Ui::Ux
35
35
  def render
36
36
  if @per_page_field.options[:wrap_form] != false
37
37
  form_tag(url_for(url_parameters), method: :get) do
38
- per_page_html
38
+ per_page_html_in_wrap
39
39
  end
40
40
  else
41
41
  per_page_html
@@ -59,11 +59,19 @@ module UiBibz::Ui::Ux
59
59
  end
60
60
 
61
61
  def per_page_html
62
+ content_tag :div, class: 'table-pagination-per-page' do
63
+ concat results_count_html
64
+ concat UiBibz::Utils::Internationalization.new("ui_bibz.table.pagination.per_page", default: "Per page: ").translate
65
+ concat select_tag('per_page', options_for_select([5, 10, 20, 30, 50, 100, 200, 500], store.per_page), class: 'form-control')
66
+ end
67
+ end
68
+
69
+ def per_page_html_in_wrap
62
70
  content_tag :div, class: 'table-pagination-per-page' do
63
71
  concat results_count_html
64
72
  concat UiBibz::Utils::Internationalization.new("ui_bibz.table.pagination.per_page", default: "Per page: ").translate
65
73
  store.parameters.each do |k,v|
66
- concat tag(:input, type: 'hidden', name: k, value: v) unless default_parameters?(k)
74
+ concat tag(:input, type: 'hidden', name: k, value: v) if !default_parameters?(k) && !v.blank?
67
75
  end
68
76
  concat select_tag('per_page', options_for_select([5, 10, 20, 30, 50, 100, 200, 500], store.per_page), class: 'form-control')
69
77
  concat tag(:input, type: 'hidden', name: 'store_id', value: store.id) unless store.id.nil? # If there is more 1 table in html page
@@ -1,3 +1,4 @@
1
+ require "ui_bibz/ui/ux/table/components/store"
1
2
  module UiBibz::Ui::Ux
2
3
 
3
4
  # Create a TablePanel
@@ -97,8 +98,7 @@ module UiBibz::Ui::Ux
97
98
  # See UiBibz::Ui::Core::Component.initialize
98
99
  def initialize content = nil, options = nil, html_options = nil, &block
99
100
  super
100
- @store = @options.delete(:store) if @options[:store]
101
- table_options = (@options[:table_options] || {}).merge({ store: @store })
101
+ table_options = (@options[:table_options] || {}).merge({ store: store })
102
102
  @table = UiBibz::Ui::Ux::Table.new(table_options, @options[:table_html_options])
103
103
  end
104
104
 
@@ -109,9 +109,13 @@ module UiBibz::Ui::Ux
109
109
 
110
110
  content_tag :div, class_and_html_options(panel_classes) do |f|
111
111
  form_tag(url_for(url_parameters), method: :get) do
112
+ store.parameters.each do |k,v|
113
+ concat tag(:input, type: 'hidden', name: k, value: v) if !default_parameters?(k) && !v.blank?
114
+ end
115
+ concat tag(:input, type: 'hidden', name: 'store_id', value: store.id) unless store.id.nil? # if there is more one table in html page
112
116
  concat(header_html) unless @header.nil?
113
117
  concat(body_html) unless @body.nil?
114
- concat(table_html) unless @store.nil?
118
+ concat(table_html) unless store.nil?
115
119
  concat(footer_html) unless @footer.nil?
116
120
  end
117
121
  end
@@ -134,8 +138,22 @@ module UiBibz::Ui::Ux
134
138
 
135
139
  private
136
140
 
141
+ def store
142
+ @store ||= if @options[:store].nil?
143
+ raise 'Store is nil!'
144
+ elsif @options[:store].try(:records).nil?
145
+ raise 'Store can be created only with "table_search_pagination" method!'
146
+ else
147
+ Store.new @options.delete(:store) if @options[:store]
148
+ end
149
+ end
150
+
151
+ def default_parameters?(k)
152
+ %w(store_id per_page search utf8 search controller action utf8).include?(k)
153
+ end
154
+
137
155
  def url_parameters
138
- { controller: @store.controller, action: @store.action, id: @store.param_id }
156
+ { controller: store.controller, action: store.action, id: store.param_id }
139
157
  end
140
158
 
141
159
  def table_html
@@ -147,11 +165,11 @@ module UiBibz::Ui::Ux
147
165
  end
148
166
 
149
167
  def search
150
- @search ||= Searchable.new @store, @options
168
+ @search ||= Searchable.new store, @options.merge({ wrap_form: false })
151
169
  end
152
170
 
153
171
  def pagination
154
- @pagination ||= Paginable.new @store, @options
172
+ @pagination ||= Paginable.new store, @options.merge({ wrap_form: false })
155
173
  end
156
174
 
157
175
  def initialize_footer
@@ -11,7 +11,7 @@ module UiBibz::Ui::Ux
11
11
  def render
12
12
  if @search_field.options[:wrap_form] != false
13
13
  form_tag(url_for(url_parameters), method: :get, class: 'form-table-search-field') do
14
- search_field_html
14
+ search_field_html_in_wrap
15
15
  end
16
16
  else
17
17
  search_field_html
@@ -37,6 +37,14 @@ module UiBibz::Ui::Ux
37
37
  end
38
38
 
39
39
  def search_field_html
40
+ content_tag :div, @search_field.class_and_html_options(div_class) do
41
+ concat content_tag(:span, UiBibz::Ui::Core::Glyph.new('search').render, class: 'input-group-addon')
42
+ concat tag(:input, type: 'search', value: store.search, name: 'search', class: 'form-control', placeholder: search_placeholder_field)
43
+ concat content_tag(:span, UiBibz::Ui::Core::Glyph.new('times-circle').render, class: 'clear-search-btn input-group-addon')
44
+ end
45
+ end
46
+
47
+ def search_field_html_in_wrap
40
48
  content_tag :div, @search_field.class_and_html_options(div_class) do
41
49
  concat content_tag(:span, UiBibz::Ui::Core::Glyph.new('search').render, class: 'input-group-addon')
42
50
  store.parameters.each do |k,v|
@@ -1,3 +1,3 @@
1
1
  module UiBibz
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
metadata CHANGED
@@ -1,209 +1,209 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ui_bibz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thooams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-02 00:00:00.000000000 Z
11
+ date: 2015-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 4.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: will_paginate
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 3.0.6
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 3.0.6
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: will_paginate-bootstrap
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: will-paginate-i18n
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: haml
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: haml-rails
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: sass-rails
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ! '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: 5.0.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ! '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: 5.0.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: font-awesome-sass
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ! '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ! '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: bootstrap-sass
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ~>
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
131
  version: 3.3.5
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ~>
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: 3.3.5
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: minitest
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ! '>='
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ! '>='
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rdoc
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ! '>='
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ! '>='
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: sqlite3
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ! '>='
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ! '>='
178
+ - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: factory_girl_rails
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ~>
185
+ - - "~>"
186
186
  - !ruby/object:Gem::Version
187
187
  version: '4.0'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ~>
192
+ - - "~>"
193
193
  - !ruby/object:Gem::Version
194
194
  version: '4.0'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: codeclimate-test-reporter
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - ! '>='
199
+ - - ">="
200
200
  - !ruby/object:Gem::Version
201
201
  version: '0'
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - ! '>='
206
+ - - ">="
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  description: A Rails Boostrap framework...
@@ -213,12 +213,12 @@ executables: []
213
213
  extensions: []
214
214
  extra_rdoc_files: []
215
215
  files:
216
- - .gitignore
217
- - .travis.yml
218
- - .yardoc/checksums
219
- - .yardoc/object_types
220
- - .yardoc/objects/root.dat
221
- - .yardoc/proxy_types
216
+ - ".gitignore"
217
+ - ".travis.yml"
218
+ - ".yardoc/checksums"
219
+ - ".yardoc/object_types"
220
+ - ".yardoc/objects/root.dat"
221
+ - ".yardoc/proxy_types"
222
222
  - Gemfile
223
223
  - Gemfile.lock
224
224
  - MIT-LICENSE
@@ -476,17 +476,17 @@ require_paths:
476
476
  - vendor
477
477
  required_ruby_version: !ruby/object:Gem::Requirement
478
478
  requirements:
479
- - - ! '>='
479
+ - - ">="
480
480
  - !ruby/object:Gem::Version
481
481
  version: '0'
482
482
  required_rubygems_version: !ruby/object:Gem::Requirement
483
483
  requirements:
484
- - - ! '>='
484
+ - - ">="
485
485
  - !ruby/object:Gem::Version
486
486
  version: '0'
487
487
  requirements: []
488
488
  rubyforge_project:
489
- rubygems_version: 2.4.5
489
+ rubygems_version: 2.4.8
490
490
  signing_key:
491
491
  specification_version: 4
492
492
  summary: A Rails Bootstrap framework...