ui_bibz 2.0.0.alpha24 → 2.0.0.alpha26
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 +4 -4
- data/CONTRIBUTORS.md +19 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +60 -55
- data/app/assets/javascripts/interface.coffee +11 -0
- data/app/assets/javascripts/ui_bibz.coffee +3 -1
- data/app/assets/stylesheets/table.sass +1 -2
- data/app/assets/stylesheets/ui_bibz.sass +2 -0
- data/app/inputs/custom_inputs/autocomplete_input.rb +3 -2
- data/app/inputs/custom_inputs/date_picker_input.rb +2 -2
- data/app/inputs/custom_inputs/dropdown_select_input.rb +2 -2
- data/app/inputs/custom_inputs/formula_input.rb +2 -2
- data/app/inputs/custom_inputs/markdown_editor_input.rb +2 -2
- data/app/inputs/custom_inputs/multi_column_input.rb +2 -2
- data/app/inputs/custom_inputs/multi_select_input.rb +2 -2
- data/app/inputs/custom_inputs/radios_input.rb +20 -0
- data/app/inputs/custom_inputs/surround_input.rb +2 -2
- data/app/inputs/custom_inputs/switch_input.rb +2 -2
- data/config/initializers/will_paginate.rb +79 -0
- data/lib/ui_bibz.rb +56 -30
- data/lib/ui_bibz/helpers/ui_core_helper.rb +45 -37
- data/lib/ui_bibz/ui/core/alert.rb +1 -2
- data/lib/ui_bibz/ui/core/{breadcrumb/breadcrumb.rb → breadcrumb.rb} +5 -5
- data/lib/ui_bibz/ui/core/cards/card.rb +6 -6
- data/lib/ui_bibz/ui/core/cards/components/block/card_block_link.rb +1 -1
- data/lib/ui_bibz/ui/core/cards/components/block/card_block_text.rb +1 -1
- data/lib/ui_bibz/ui/core/cards/components/block/card_block_title.rb +1 -1
- data/lib/ui_bibz/ui/core/cards/components/card_block.rb +4 -4
- data/lib/ui_bibz/ui/core/cards/components/card_footer.rb +1 -1
- data/lib/ui_bibz/ui/core/cards/components/card_header.rb +1 -1
- data/lib/ui_bibz/ui/core/cards/components/card_image.rb +1 -1
- data/lib/ui_bibz/ui/core/cards/components/card_list_group.rb +2 -2
- data/lib/ui_bibz/ui/core/component.rb +4 -51
- data/lib/ui_bibz/ui/core/component/glyph_extension.rb +19 -0
- data/lib/ui_bibz/ui/core/component/klass_extension.rb +38 -0
- data/lib/ui_bibz/ui/core/{dropdown → dropdowns}/components/dropdown_divider.rb +1 -1
- data/lib/ui_bibz/ui/core/{dropdown → dropdowns}/components/dropdown_header.rb +2 -2
- data/lib/ui_bibz/ui/core/{dropdown → dropdowns}/components/dropdown_link.rb +2 -2
- data/lib/ui_bibz/ui/core/{dropdown → dropdowns}/dropdown.rb +11 -12
- data/lib/ui_bibz/ui/core/{buttons/button_split_dropdown.rb → dropdowns/split_dropdown.rb} +6 -10
- data/lib/ui_bibz/ui/core/{buttons → forms/buttons}/button.rb +5 -5
- data/lib/ui_bibz/ui/core/{buttons → forms/buttons}/button_choice.rb +8 -8
- data/lib/ui_bibz/ui/core/{buttons → forms/buttons}/button_group.rb +5 -5
- data/lib/ui_bibz/ui/core/{buttons → forms/buttons}/button_link.rb +13 -9
- data/lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb +98 -0
- data/lib/ui_bibz/ui/core/forms/choices/radio_field.rb +98 -0
- data/lib/ui_bibz/ui/core/{inputs → forms/choices}/switch_field.rb +3 -3
- data/lib/ui_bibz/ui/core/{inputs → forms/dates}/date_picker_field.rb +6 -6
- data/lib/ui_bibz/ui/core/{inputs → forms/numbers}/formula_field.rb +5 -5
- data/lib/ui_bibz/ui/core/{inputs → forms/selects}/dropdown_select_field.rb +5 -5
- data/lib/ui_bibz/ui/core/{inputs → forms/selects}/multi_column_field.rb +5 -5
- data/lib/ui_bibz/ui/core/{inputs → forms/selects}/multi_select_field.rb +8 -8
- data/lib/ui_bibz/ui/core/{inputs → forms/textareas}/markdown_editor_field.rb +5 -5
- data/lib/ui_bibz/ui/core/{inputs → forms/texts}/autocomplete_field.rb +5 -5
- data/lib/ui_bibz/ui/core/{inputs → forms/texts}/surround_field.rb +5 -5
- data/lib/ui_bibz/ui/core/glyph.rb +2 -1
- data/lib/ui_bibz/ui/core/{list → lists}/components/list.rb +11 -11
- data/lib/ui_bibz/ui/core/{list/components → lists/components/list}/list_body.rb +2 -2
- data/lib/ui_bibz/ui/core/{list/components → lists/components/list}/list_header.rb +2 -2
- data/lib/ui_bibz/ui/core/{list → lists}/list_group.rb +4 -4
- data/lib/ui_bibz/ui/core/navs/components/nav_dropdown.rb +1 -1
- data/lib/ui_bibz/ui/core/navs/components/navbar_form.rb +3 -1
- data/lib/ui_bibz/ui/core/paths/breadcrumb.rb +109 -0
- data/lib/ui_bibz/ui/core/{breadcrumb → paths}/components/breadcrumb_link.rb +6 -6
- data/lib/ui_bibz/ui/core/{stars.rb → star.rb} +14 -14
- data/lib/ui_bibz/ui/core/tag.rb +1 -2
- data/lib/ui_bibz/ui/core/{modal → windows}/components/modal_body.rb +2 -2
- data/lib/ui_bibz/ui/core/{modal → windows}/components/modal_footer.rb +2 -2
- data/lib/ui_bibz/ui/core/{modal → windows}/components/modal_header.rb +2 -2
- data/lib/ui_bibz/ui/core/{modal → windows}/modal.rb +8 -8
- data/lib/ui_bibz/ui/ux/tables/components/actions.rb +9 -9
- data/lib/ui_bibz/ui/ux/tables/extensions/actionable.rb +1 -1
- data/lib/ui_bibz/ui/ux/tables/table_pagination.rb +5 -4
- data/lib/ui_bibz/version.rb +1 -1
- data/test/dummy/app/controllers/users_controller.rb +18 -0
- data/test/dummy/app/models/user.rb +1 -0
- data/test/dummy/config/application.rb +1 -1
- data/test/dummy/config/initializers/simple_form_bootstrap.rb +155 -0
- data/test/simple_form_test.rb +123 -0
- data/test/test_helper.rb +2 -2
- data/test/ui/breadcrumb_test.rb +2 -2
- data/test/ui/button_test.rb +13 -39
- data/test/ui/dropdown_test.rb +14 -1
- data/test/ui/glyph_test.rb +6 -0
- data/test/ui/input_dropdown_select_field_test.rb +9 -9
- data/test/ui/input_switch_field_test.rb +11 -11
- data/test/ui/inputs_test.rb +26 -12
- data/test/ui/list_group_test.rb +2 -2
- data/test/ui/{stars_test.rb → star_test.rb} +7 -7
- data/test/ui/table_test.rb +3 -3
- data/test/ui_helper_test.rb +6 -1
- data/ui_bibz.gemspec +4 -3
- data/vendor/assets/stylesheets/awesome-bootstrap-checkbox.scss +250 -0
- metadata +65 -39
- data/lib/ui_bibz/helpers/pagination_helper.rb +0 -55
- data/lib/ui_bibz/ui/core/buttons/button_dropdown.rb +0 -82
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ui_bibz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.alpha26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thooams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 3.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: will-paginate-i18n
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: will_paginate-bootstrap4
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - '='
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 4.0.0.
|
131
|
+
version: 4.0.0.alpha5
|
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
|
-
version: 4.0.0.
|
138
|
+
version: 4.0.0.alpha5
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: minitest
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,6 +178,20 @@ dependencies:
|
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '4.0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: simplecov
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
181
195
|
- !ruby/object:Gem::Dependency
|
182
196
|
name: codeclimate-test-reporter
|
183
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -224,28 +238,22 @@ files:
|
|
224
238
|
- app/inputs/custom_inputs/markdown_editor_input.rb
|
225
239
|
- app/inputs/custom_inputs/multi_column_input.rb
|
226
240
|
- app/inputs/custom_inputs/multi_select_input.rb
|
241
|
+
- app/inputs/custom_inputs/radios_input.rb
|
227
242
|
- app/inputs/custom_inputs/surround_input.rb
|
228
243
|
- app/inputs/custom_inputs/switch_input.rb
|
244
|
+
- config/initializers/will_paginate.rb
|
229
245
|
- config/locales/en.yml
|
230
246
|
- config/locales/fr.yml
|
231
247
|
- lib/tasks/ui_bibz_tasks.rake
|
232
248
|
- lib/ui_bibz.rb
|
233
249
|
- lib/ui_bibz/concerns/models/searchable.rb
|
234
|
-
- lib/ui_bibz/helpers/pagination_helper.rb
|
235
250
|
- lib/ui_bibz/helpers/ui_core_helper.rb
|
236
251
|
- lib/ui_bibz/helpers/ui_ux_helper.rb
|
237
252
|
- lib/ui_bibz/helpers/utils_helper.rb
|
238
253
|
- lib/ui_bibz/rails/engine.rb
|
239
254
|
- lib/ui_bibz/ui/base.rb
|
240
255
|
- lib/ui_bibz/ui/core/alert.rb
|
241
|
-
- lib/ui_bibz/ui/core/breadcrumb
|
242
|
-
- lib/ui_bibz/ui/core/breadcrumb/components/breadcrumb_link.rb
|
243
|
-
- lib/ui_bibz/ui/core/buttons/button.rb
|
244
|
-
- lib/ui_bibz/ui/core/buttons/button_choice.rb
|
245
|
-
- lib/ui_bibz/ui/core/buttons/button_dropdown.rb
|
246
|
-
- lib/ui_bibz/ui/core/buttons/button_group.rb
|
247
|
-
- lib/ui_bibz/ui/core/buttons/button_link.rb
|
248
|
-
- lib/ui_bibz/ui/core/buttons/button_split_dropdown.rb
|
256
|
+
- lib/ui_bibz/ui/core/breadcrumb.rb
|
249
257
|
- lib/ui_bibz/ui/core/cards/card.rb
|
250
258
|
- lib/ui_bibz/ui/core/cards/card_column.rb
|
251
259
|
- lib/ui_bibz/ui/core/cards/card_deck.rb
|
@@ -259,32 +267,37 @@ files:
|
|
259
267
|
- lib/ui_bibz/ui/core/cards/components/card_image.rb
|
260
268
|
- lib/ui_bibz/ui/core/cards/components/card_list_group.rb
|
261
269
|
- lib/ui_bibz/ui/core/component.rb
|
262
|
-
- lib/ui_bibz/ui/core/
|
263
|
-
- lib/ui_bibz/ui/core/
|
264
|
-
- lib/ui_bibz/ui/core/
|
265
|
-
- lib/ui_bibz/ui/core/
|
270
|
+
- lib/ui_bibz/ui/core/component/glyph_extension.rb
|
271
|
+
- lib/ui_bibz/ui/core/component/klass_extension.rb
|
272
|
+
- lib/ui_bibz/ui/core/dropdowns/components/dropdown_divider.rb
|
273
|
+
- lib/ui_bibz/ui/core/dropdowns/components/dropdown_header.rb
|
274
|
+
- lib/ui_bibz/ui/core/dropdowns/components/dropdown_link.rb
|
275
|
+
- lib/ui_bibz/ui/core/dropdowns/dropdown.rb
|
276
|
+
- lib/ui_bibz/ui/core/dropdowns/split_dropdown.rb
|
277
|
+
- lib/ui_bibz/ui/core/forms/buttons/button.rb
|
278
|
+
- lib/ui_bibz/ui/core/forms/buttons/button_choice.rb
|
279
|
+
- lib/ui_bibz/ui/core/forms/buttons/button_group.rb
|
280
|
+
- lib/ui_bibz/ui/core/forms/buttons/button_link.rb
|
281
|
+
- lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb
|
282
|
+
- lib/ui_bibz/ui/core/forms/choices/radio_field.rb
|
283
|
+
- lib/ui_bibz/ui/core/forms/choices/switch_field.rb
|
284
|
+
- lib/ui_bibz/ui/core/forms/dates/date_picker_field.rb
|
285
|
+
- lib/ui_bibz/ui/core/forms/numbers/formula_field.rb
|
286
|
+
- lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb
|
287
|
+
- lib/ui_bibz/ui/core/forms/selects/multi_column_field.rb
|
288
|
+
- lib/ui_bibz/ui/core/forms/selects/multi_select_field.rb
|
289
|
+
- lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb
|
290
|
+
- lib/ui_bibz/ui/core/forms/texts/autocomplete_field.rb
|
291
|
+
- lib/ui_bibz/ui/core/forms/texts/surround_field.rb
|
266
292
|
- lib/ui_bibz/ui/core/glyph.rb
|
267
|
-
- lib/ui_bibz/ui/core/inputs/autocomplete_field.rb
|
268
|
-
- lib/ui_bibz/ui/core/inputs/date_picker_field.rb
|
269
|
-
- lib/ui_bibz/ui/core/inputs/dropdown_select_field.rb
|
270
|
-
- lib/ui_bibz/ui/core/inputs/formula_field.rb
|
271
|
-
- lib/ui_bibz/ui/core/inputs/markdown_editor_field.rb
|
272
|
-
- lib/ui_bibz/ui/core/inputs/multi_column_field.rb
|
273
|
-
- lib/ui_bibz/ui/core/inputs/multi_select_field.rb
|
274
|
-
- lib/ui_bibz/ui/core/inputs/surround_field.rb
|
275
|
-
- lib/ui_bibz/ui/core/inputs/switch_field.rb
|
276
293
|
- lib/ui_bibz/ui/core/jumbotron.rb
|
277
294
|
- lib/ui_bibz/ui/core/layouts/col.rb
|
278
295
|
- lib/ui_bibz/ui/core/layouts/container.rb
|
279
296
|
- lib/ui_bibz/ui/core/layouts/row.rb
|
280
|
-
- lib/ui_bibz/ui/core/
|
281
|
-
- lib/ui_bibz/ui/core/
|
282
|
-
- lib/ui_bibz/ui/core/
|
283
|
-
- lib/ui_bibz/ui/core/
|
284
|
-
- lib/ui_bibz/ui/core/modal/components/modal_body.rb
|
285
|
-
- lib/ui_bibz/ui/core/modal/components/modal_footer.rb
|
286
|
-
- lib/ui_bibz/ui/core/modal/components/modal_header.rb
|
287
|
-
- lib/ui_bibz/ui/core/modal/modal.rb
|
297
|
+
- lib/ui_bibz/ui/core/lists/components/list.rb
|
298
|
+
- lib/ui_bibz/ui/core/lists/components/list/list_body.rb
|
299
|
+
- lib/ui_bibz/ui/core/lists/components/list/list_header.rb
|
300
|
+
- lib/ui_bibz/ui/core/lists/list_group.rb
|
288
301
|
- lib/ui_bibz/ui/core/navs/components/nav_dropdown.rb
|
289
302
|
- lib/ui_bibz/ui/core/navs/components/nav_link.rb
|
290
303
|
- lib/ui_bibz/ui/core/navs/components/nav_link_link.rb
|
@@ -295,9 +308,15 @@ files:
|
|
295
308
|
- lib/ui_bibz/ui/core/navs/components/navbar_text.rb
|
296
309
|
- lib/ui_bibz/ui/core/navs/nav.rb
|
297
310
|
- lib/ui_bibz/ui/core/navs/navbar.rb
|
311
|
+
- lib/ui_bibz/ui/core/paths/breadcrumb.rb
|
312
|
+
- lib/ui_bibz/ui/core/paths/components/breadcrumb_link.rb
|
298
313
|
- lib/ui_bibz/ui/core/progress.rb
|
299
|
-
- lib/ui_bibz/ui/core/
|
314
|
+
- lib/ui_bibz/ui/core/star.rb
|
300
315
|
- lib/ui_bibz/ui/core/tag.rb
|
316
|
+
- lib/ui_bibz/ui/core/windows/components/modal_body.rb
|
317
|
+
- lib/ui_bibz/ui/core/windows/components/modal_footer.rb
|
318
|
+
- lib/ui_bibz/ui/core/windows/components/modal_header.rb
|
319
|
+
- lib/ui_bibz/ui/core/windows/modal.rb
|
301
320
|
- lib/ui_bibz/ui/ux/tables/components/actions.rb
|
302
321
|
- lib/ui_bibz/ui/ux/tables/components/as.rb
|
303
322
|
- lib/ui_bibz/ui/ux/tables/components/column.rb
|
@@ -322,6 +341,7 @@ files:
|
|
322
341
|
- test/dummy/app/assets/stylesheets/application.css
|
323
342
|
- test/dummy/app/controllers/application_controller.rb
|
324
343
|
- test/dummy/app/controllers/concerns/.keep
|
344
|
+
- test/dummy/app/controllers/users_controller.rb
|
325
345
|
- test/dummy/app/helpers/application_helper.rb
|
326
346
|
- test/dummy/app/mailers/.keep
|
327
347
|
- test/dummy/app/models/.keep
|
@@ -347,6 +367,7 @@ files:
|
|
347
367
|
- test/dummy/config/initializers/inflections.rb
|
348
368
|
- test/dummy/config/initializers/mime_types.rb
|
349
369
|
- test/dummy/config/initializers/session_store.rb
|
370
|
+
- test/dummy/config/initializers/simple_form_bootstrap.rb
|
350
371
|
- test/dummy/config/initializers/wrap_parameters.rb
|
351
372
|
- test/dummy/config/locales/en.yml
|
352
373
|
- test/dummy/config/routes.rb
|
@@ -363,6 +384,7 @@ files:
|
|
363
384
|
- test/dummy/test/fixtures/users.yml
|
364
385
|
- test/dummy/test/models/user_test.rb
|
365
386
|
- test/factories/user.rb
|
387
|
+
- test/simple_form_test.rb
|
366
388
|
- test/store_test.rb
|
367
389
|
- test/support/factory_girl.rb
|
368
390
|
- test/test_helper.rb
|
@@ -378,7 +400,7 @@ files:
|
|
378
400
|
- test/ui/inputs_test.rb
|
379
401
|
- test/ui/list_group_test.rb
|
380
402
|
- test/ui/nav_test.rb
|
381
|
-
- test/ui/
|
403
|
+
- test/ui/star_test.rb
|
382
404
|
- test/ui/table_test.rb
|
383
405
|
- test/ui_bibz_test.rb
|
384
406
|
- test/ui_helper_test.rb
|
@@ -396,6 +418,7 @@ files:
|
|
396
418
|
- vendor/assets/javascripts/marked.js
|
397
419
|
- vendor/assets/javascripts/tether.min.js
|
398
420
|
- vendor/assets/javascripts/to-markdown.js
|
421
|
+
- vendor/assets/stylesheets/awesome-bootstrap-checkbox.scss
|
399
422
|
- vendor/assets/stylesheets/bootstrap-datepicker3.min.css
|
400
423
|
- vendor/assets/stylesheets/bootstrap-markdown.min.css
|
401
424
|
- vendor/assets/stylesheets/bootstrap-multiselect.min.css
|
@@ -438,6 +461,7 @@ test_files:
|
|
438
461
|
- test/dummy/app/assets/stylesheets/application.css
|
439
462
|
- test/dummy/app/controllers/application_controller.rb
|
440
463
|
- test/dummy/app/controllers/concerns/.keep
|
464
|
+
- test/dummy/app/controllers/users_controller.rb
|
441
465
|
- test/dummy/app/helpers/application_helper.rb
|
442
466
|
- test/dummy/app/mailers/.keep
|
443
467
|
- test/dummy/app/models/.keep
|
@@ -463,6 +487,7 @@ test_files:
|
|
463
487
|
- test/dummy/config/initializers/inflections.rb
|
464
488
|
- test/dummy/config/initializers/mime_types.rb
|
465
489
|
- test/dummy/config/initializers/session_store.rb
|
490
|
+
- test/dummy/config/initializers/simple_form_bootstrap.rb
|
466
491
|
- test/dummy/config/initializers/wrap_parameters.rb
|
467
492
|
- test/dummy/config/locales/en.yml
|
468
493
|
- test/dummy/config/routes.rb
|
@@ -479,6 +504,7 @@ test_files:
|
|
479
504
|
- test/dummy/test/fixtures/users.yml
|
480
505
|
- test/dummy/test/models/user_test.rb
|
481
506
|
- test/factories/user.rb
|
507
|
+
- test/simple_form_test.rb
|
482
508
|
- test/store_test.rb
|
483
509
|
- test/support/factory_girl.rb
|
484
510
|
- test/test_helper.rb
|
@@ -494,7 +520,7 @@ test_files:
|
|
494
520
|
- test/ui/inputs_test.rb
|
495
521
|
- test/ui/list_group_test.rb
|
496
522
|
- test/ui/nav_test.rb
|
497
|
-
- test/ui/
|
523
|
+
- test/ui/star_test.rb
|
498
524
|
- test/ui/table_test.rb
|
499
525
|
- test/ui_bibz_test.rb
|
500
526
|
- test/ui_helper_test.rb
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require "will_paginate/view_helpers/action_view"
|
2
|
-
|
3
|
-
module PaginationHelper
|
4
|
-
|
5
|
-
module BootstrapRenderer
|
6
|
-
|
7
|
-
def to_html
|
8
|
-
html = pagination.map do |item|
|
9
|
-
item.is_a?(Fixnum) ?
|
10
|
-
page_number(item) :
|
11
|
-
send(item)
|
12
|
-
end.join(@options[:link_separator])
|
13
|
-
|
14
|
-
html = html_container(html) if @options[:container]
|
15
|
-
|
16
|
-
tag("nav", tag("ul", html, class: @options[:class]))
|
17
|
-
end
|
18
|
-
|
19
|
-
protected
|
20
|
-
|
21
|
-
def page_item(text, url, link_status = nil)
|
22
|
-
text = text.to_s + tag(:span, "(current)", class: "sr-only") if link_status == "active"
|
23
|
-
link_tag = link_status.nil? ? link(text, url, class: "page-link", rel: text) : tag(:span, text, class: "page-link")
|
24
|
-
|
25
|
-
tag(:li, link_tag, class: "page-item #{link_status}")
|
26
|
-
end
|
27
|
-
|
28
|
-
def page_number(page)
|
29
|
-
link_status = "active" if page == current_page
|
30
|
-
page_item(page, page, link_status)
|
31
|
-
end
|
32
|
-
|
33
|
-
def gap
|
34
|
-
text = @template.will_paginate_translate(:page_gap) { '…' }
|
35
|
-
page_item(text, nil, "disabled")
|
36
|
-
end
|
37
|
-
|
38
|
-
def previous_page
|
39
|
-
num = @collection.current_page > 1 && @collection.current_page - 1
|
40
|
-
previous_or_next_page(num, @options[:previous_label], "Previous")
|
41
|
-
end
|
42
|
-
|
43
|
-
def next_page
|
44
|
-
num = @collection.current_page < total_pages && @collection.current_page + 1
|
45
|
-
previous_or_next_page(num, @options[:next_label], "Next")
|
46
|
-
end
|
47
|
-
|
48
|
-
def previous_or_next_page(page, text, aria_label)
|
49
|
-
link_status = "disabled" unless page
|
50
|
-
page_item(text, page, link_status)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
WillPaginate::ActionView::LinkRenderer.send :include, PaginationHelper::BootstrapRenderer
|
@@ -1,82 +0,0 @@
|
|
1
|
-
module UiBibz::Ui::Core::Buttons
|
2
|
-
|
3
|
-
# Create a button dropdown
|
4
|
-
#
|
5
|
-
# This element is an extend of UiBibz::Ui::Core::Dropdown
|
6
|
-
#
|
7
|
-
# ==== Attributes
|
8
|
-
#
|
9
|
-
# * +content+ - Content of element
|
10
|
-
# * +options+ - Options of element
|
11
|
-
# * +html_options+ - Html Options of element
|
12
|
-
#
|
13
|
-
# ==== Options
|
14
|
-
#
|
15
|
-
# You can add HTML attributes using the +html_options+.
|
16
|
-
# You can pass arguments in options attribute:
|
17
|
-
# * +status+ - status of élement with symbol value:
|
18
|
-
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+)
|
19
|
-
# * +size+
|
20
|
-
# (+:xs+, +:sm+, +:lg+)
|
21
|
-
# * +outline+ - Boolean
|
22
|
-
# * +state+ - Symbol (+:active+, +:disabled)
|
23
|
-
# * +type+ - Symbol (+:block)
|
24
|
-
# * +glyph+ - Add glyph with name or hash options
|
25
|
-
# * +name+ - String
|
26
|
-
# * +size+ - Integer
|
27
|
-
# * +type+ - Symbol
|
28
|
-
#
|
29
|
-
# ==== Signatures
|
30
|
-
#
|
31
|
-
# UiBibz::Ui::Core::Buttons::ButtonDropdown.new(options = nil, html_options = nil).tap do |d|
|
32
|
-
# ...
|
33
|
-
# d.list content = nil, options = nil, html_options = nil, &block
|
34
|
-
# d.link content = nil, options = nil, html_options = nil, &block
|
35
|
-
# ...
|
36
|
-
# end
|
37
|
-
#
|
38
|
-
# ==== Examples
|
39
|
-
#
|
40
|
-
# UiBibz::Ui::Core::Buttons::ButtonDropdown.new(name, status: :success).tap do |d|
|
41
|
-
# d.link 'test', { url: '#Test1' }
|
42
|
-
# d.list('---')
|
43
|
-
# d.list('Header 1', { type: :header })
|
44
|
-
# d.link 'test2', { url: '#Test2' }
|
45
|
-
# end.render
|
46
|
-
#
|
47
|
-
# ==== Helper
|
48
|
-
#
|
49
|
-
# button_dropdown(name, options = { tap: true }, html_options = {}) do |d|
|
50
|
-
# d.list(content, options = {}, html_options = {})
|
51
|
-
# d.list(options = {}, html_options = {}) do
|
52
|
-
# content
|
53
|
-
# end
|
54
|
-
# end
|
55
|
-
#
|
56
|
-
class ButtonDropdown < UiBibz::Ui::Core::Dropdown
|
57
|
-
|
58
|
-
# See UiBibz::Ui::Core::Dropdown.initialize
|
59
|
-
def initialize name, options = nil, html_options = nil, &block
|
60
|
-
super
|
61
|
-
end
|
62
|
-
|
63
|
-
# Render html tag
|
64
|
-
def render
|
65
|
-
content_tag :div, html_options do
|
66
|
-
concat button_html
|
67
|
-
concat ul_html
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
private
|
72
|
-
|
73
|
-
def component_html_classes
|
74
|
-
['btn-group', type]
|
75
|
-
end
|
76
|
-
|
77
|
-
def component_html_options
|
78
|
-
{ role: 'group' }
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
82
|
-
end
|