ui_bibz 1.2.5.3 → 2.0.0.alpha
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/.gitignore +1 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +10 -7
- data/README.md +8 -1042
- data/app/assets/javascripts/multi_column.coffee +45 -0
- data/app/assets/javascripts/{ui_bibz.js.coffee → ui_bibz.coffee} +16 -3
- data/app/assets/stylesheets/fix-bootstrap-4.sass +2 -0
- data/app/assets/stylesheets/ui_bibz.sass +22 -9
- data/app/inputs/custom_inputs/date_picker_input.rb +10 -0
- data/app/inputs/custom_inputs/date_picker_input_old.rb +61 -0
- data/app/inputs/custom_inputs/multi_column_input.rb +18 -0
- data/app/inputs/custom_inputs/multi_select_input.rb +15 -0
- data/app/inputs/custom_inputs/surround_input.rb +10 -0
- data/doc/UiBibz.html +2 -2
- data/doc/UiBibz/Concerns.html +1 -1
- data/doc/UiBibz/Concerns/Models.html +1 -1
- data/doc/UiBibz/Concerns/Models/Searchable.html +1 -1
- data/doc/UiBibz/Concerns/Models/Searchable/ClassMethods.html +5 -5
- data/doc/UiBibz/Helpers.html +1 -1
- data/doc/UiBibz/Helpers/MetaHelper.html +1 -1
- data/doc/UiBibz/Helpers/UiCoreHelper.html +1 -1
- data/doc/UiBibz/Helpers/UiUxHelper.html +1 -1
- data/doc/UiBibz/Helpers/UtilsHelper.html +1 -1
- data/doc/UiBibz/Rails.html +1 -1
- data/doc/UiBibz/Rails/Engine.html +1 -1
- data/doc/UiBibz/Ui.html +1 -1
- data/doc/UiBibz/Ui/Base.html +1 -1
- data/doc/UiBibz/Ui/Core.html +1 -1
- data/doc/UiBibz/Ui/Core/Alert.html +1 -1
- data/doc/UiBibz/Ui/Core/Bar.html +1 -1
- data/doc/UiBibz/Ui/Core/Breadcrumb.html +1 -1
- data/doc/UiBibz/Ui/Core/BreadcrumbLink.html +1 -1
- data/doc/UiBibz/Ui/Core/Button.html +1 -1
- data/doc/UiBibz/Ui/Core/ButtonDropdown.html +1 -1
- data/doc/UiBibz/Ui/Core/ButtonGroup.html +1 -1
- data/doc/UiBibz/Ui/Core/ButtonLink.html +1 -1
- data/doc/UiBibz/Ui/Core/ButtonSplitDropdown.html +1 -1
- data/doc/UiBibz/Ui/Core/Col.html +1 -1
- data/doc/UiBibz/Ui/Core/Component.html +1 -1
- data/doc/UiBibz/Ui/Core/Dropdown.html +1 -1
- data/doc/UiBibz/Ui/Core/DropdownDivider.html +1 -1
- data/doc/UiBibz/Ui/Core/DropdownHeader.html +1 -1
- data/doc/UiBibz/Ui/Core/DropdownLink.html +1 -1
- data/doc/UiBibz/Ui/Core/Glyph.html +1 -1
- data/doc/UiBibz/Ui/Core/Jumbotron.html +1 -1
- data/doc/UiBibz/Ui/Core/Label.html +1 -1
- data/doc/UiBibz/Ui/Core/List.html +1 -1
- data/doc/UiBibz/Ui/Core/ListGroup.html +1 -1
- data/doc/UiBibz/Ui/Core/Modal.html +1 -1
- data/doc/UiBibz/Ui/Core/ModalBody.html +1 -1
- data/doc/UiBibz/Ui/Core/ModalFooter.html +1 -1
- data/doc/UiBibz/Ui/Core/ModalHeader.html +1 -1
- data/doc/UiBibz/Ui/Core/Nav.html +1 -1
- data/doc/UiBibz/Ui/Core/NavDropdown.html +1 -1
- data/doc/UiBibz/Ui/Core/NavLink.html +1 -1
- data/doc/UiBibz/Ui/Core/Navbar.html +1 -1
- data/doc/UiBibz/Ui/Core/NavbarForm.html +1 -1
- data/doc/UiBibz/Ui/Core/NavbarNav.html +1 -1
- data/doc/UiBibz/Ui/Core/NavbarText.html +1 -1
- data/doc/UiBibz/Ui/Core/Panel.html +1 -1
- data/doc/UiBibz/Ui/Core/ProgressBar.html +1 -1
- data/doc/UiBibz/Ui/Core/Row.html +1 -1
- data/doc/UiBibz/Ui/Core/Stars.html +1 -1
- data/doc/UiBibz/Ui/Ux.html +1 -1
- data/doc/UiBibz/Ui/Ux/Actionable.html +1 -1
- data/doc/UiBibz/Ui/Ux/Actions.html +1 -1
- data/doc/UiBibz/Ui/Ux/Column.html +1 -1
- data/doc/UiBibz/Ui/Ux/Columns.html +1 -1
- data/doc/UiBibz/Ui/Ux/Grid.html +1 -1
- data/doc/UiBibz/Ui/Ux/Paginable.html +1 -1
- data/doc/UiBibz/Ui/Ux/Searchable.html +1 -1
- data/doc/UiBibz/Ui/Ux/Sortable.html +1 -1
- data/doc/UiBibz/Ui/Ux/Store.html +18 -70
- data/doc/UiBibz/Ui/Ux/Table.html +1 -1
- data/doc/UiBibz/Ui/Ux/TablePagination.html +1 -1
- data/doc/UiBibz/Ui/Ux/TablePaginationPerPage.html +1 -1
- data/doc/UiBibz/Ui/Ux/TablePanel.html +1 -1
- data/doc/UiBibz/Ui/Ux/TableSearchField.html +1 -1
- data/doc/UiBibz/Utils.html +1 -1
- data/doc/UiBibz/Utils/Internationalization.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +47 -51
- data/doc/index.html +47 -51
- data/doc/method_list.html +69 -75
- data/doc/top-level-namespace.html +1 -1
- data/lib/ui_bibz.rb +14 -7
- data/lib/ui_bibz/helpers/ui_core_helper.rb +46 -11
- data/lib/ui_bibz/helpers/ui_ux_helper.rb +7 -3
- data/lib/ui_bibz/rails/engine.rb +2 -2
- data/lib/ui_bibz/ui/base.rb +5 -0
- data/lib/ui_bibz/ui/core/alert.rb +15 -6
- data/lib/ui_bibz/ui/core/breadcrumb/breadcrumb.rb +37 -2
- data/lib/ui_bibz/ui/core/breadcrumb/components/breadcrumb_link.rb +3 -3
- data/lib/ui_bibz/ui/core/button/button.rb +39 -6
- data/lib/ui_bibz/ui/core/button/button_choice.rb +104 -0
- data/lib/ui_bibz/ui/core/button/button_dropdown.rb +15 -2
- data/lib/ui_bibz/ui/core/button/button_group.rb +17 -5
- data/lib/ui_bibz/ui/core/button/button_link.rb +8 -11
- data/lib/ui_bibz/ui/core/button/button_split_dropdown.rb +15 -5
- data/lib/ui_bibz/ui/core/card/card.rb +158 -0
- data/lib/ui_bibz/ui/core/card/card_column.rb +60 -0
- data/lib/ui_bibz/ui/core/card/card_deck.rb +62 -0
- data/lib/ui_bibz/ui/core/card/card_group.rb +60 -0
- data/lib/ui_bibz/ui/core/card/components/block/card_block_link.rb +51 -0
- data/lib/ui_bibz/ui/core/card/components/block/card_block_text.rb +51 -0
- data/lib/ui_bibz/ui/core/card/components/block/card_block_title.rb +51 -0
- data/lib/ui_bibz/ui/core/card/components/card_block.rb +67 -0
- data/lib/ui_bibz/ui/core/card/components/card_footer.rb +55 -0
- data/lib/ui_bibz/ui/core/card/components/card_header.rb +51 -0
- data/lib/ui_bibz/ui/core/card/components/card_image.rb +57 -0
- data/lib/ui_bibz/ui/core/card/components/card_list_group.rb +47 -0
- data/lib/ui_bibz/ui/core/component.rb +78 -32
- data/lib/ui_bibz/ui/core/dropdown/components/dropdown_divider.rb +1 -1
- data/lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb +11 -1
- data/lib/ui_bibz/ui/core/dropdown/components/dropdown_link.rb +11 -4
- data/lib/ui_bibz/ui/core/dropdown/dropdown.rb +14 -6
- data/lib/ui_bibz/ui/core/glyph.rb +22 -4
- data/lib/ui_bibz/ui/core/input/date_picker_field.rb +125 -0
- data/lib/ui_bibz/ui/core/input/multi_column_field.rb +77 -0
- data/lib/ui_bibz/ui/core/input/multi_select_field.rb +89 -0
- data/lib/ui_bibz/ui/core/input/surround_field.rb +74 -0
- data/lib/ui_bibz/ui/core/jumbotron.rb +10 -6
- data/lib/ui_bibz/ui/core/label.rb +13 -3
- data/lib/ui_bibz/ui/core/{col.rb → layout/col.rb} +38 -18
- data/lib/ui_bibz/ui/core/layout/container.rb +65 -0
- data/lib/ui_bibz/ui/core/{row.rb → layout/row.rb} +7 -1
- data/lib/ui_bibz/ui/core/list/components/list.rb +26 -11
- data/lib/ui_bibz/ui/core/list/components/list_body.rb +36 -0
- data/lib/ui_bibz/ui/core/list/components/list_header.rb +36 -0
- data/lib/ui_bibz/ui/core/list/list_group.rb +7 -3
- data/lib/ui_bibz/ui/core/modal/components/modal_body.rb +7 -1
- data/lib/ui_bibz/ui/core/modal/components/modal_footer.rb +7 -1
- data/lib/ui_bibz/ui/core/modal/components/modal_header.rb +5 -2
- data/lib/ui_bibz/ui/core/modal/modal.rb +13 -2
- data/lib/ui_bibz/ui/core/nav/components/nav_dropdown.rb +6 -2
- data/lib/ui_bibz/ui/core/nav/components/nav_link.rb +7 -18
- data/lib/ui_bibz/ui/core/nav/components/nav_link_link.rb +45 -0
- data/lib/ui_bibz/ui/core/nav/components/nav_link_list.rb +35 -0
- data/lib/ui_bibz/ui/core/nav/components/navbar_brand.rb +40 -0
- data/lib/ui_bibz/ui/core/nav/components/navbar_form.rb +2 -2
- data/lib/ui_bibz/ui/core/nav/components/navbar_nav.rb +1 -1
- data/lib/ui_bibz/ui/core/nav/components/navbar_text.rb +6 -2
- data/lib/ui_bibz/ui/core/nav/nav.rb +22 -4
- data/lib/ui_bibz/ui/core/nav/navbar.rb +26 -17
- data/lib/ui_bibz/ui/core/progress.rb +98 -0
- data/lib/ui_bibz/ui/core/stars.rb +13 -5
- data/lib/ui_bibz/ui/ux/table/components/actions.rb +4 -0
- data/lib/ui_bibz/ui/ux/table/components/store.rb +4 -4
- data/lib/ui_bibz/ui/ux/table/extensions/actionable.rb +15 -13
- data/lib/ui_bibz/ui/ux/table/extensions/paginable.rb +7 -6
- data/lib/ui_bibz/ui/ux/table/extensions/searchable.rb +6 -5
- data/lib/ui_bibz/ui/ux/table/table.rb +14 -7
- data/lib/ui_bibz/ui/ux/table/{table_panel.rb → table_card.rb} +34 -36
- data/lib/ui_bibz/ui/ux/table/table_search_field.rb +19 -11
- data/lib/ui_bibz/version.rb +1 -1
- data/test/ui/breadcrumb_test.rb +25 -0
- data/test/ui/button_test.rb +44 -4
- data/test/ui/card_test.rb +106 -0
- data/test/ui/col_test.rb +22 -0
- data/test/ui/dropdown_test.rb +1 -1
- data/test/ui/inputs_test.rb +81 -0
- data/test/ui/list_group_test.rb +1 -1
- data/test/ui/nav_test.rb +4 -5
- data/test/ui/table_test.rb +11 -11
- data/test/ui_helper_test.rb +29 -18
- data/ui_bibz.gemspec +3 -3
- data/vendor/assets/images/switch.png +0 -0
- data/vendor/assets/javascripts/bootstrap-4.0.0-alpha.min.js +7 -0
- data/vendor/assets/javascripts/bootstrap-multiselect.min.js +1180 -0
- data/vendor/assets/javascripts/jquery.multi-select.min.js +1 -0
- data/vendor/assets/javascripts/jquery.quicksearch.min.js +1 -0
- data/vendor/assets/stylesheets/bootstrap-4.0.0-alpha.min.css +6 -0
- data/vendor/assets/stylesheets/bootstrap-datepicker3.min.css +1 -1
- data/vendor/assets/stylesheets/bootstrap-multiselect.min.css +1 -0
- data/vendor/assets/stylesheets/multi-select.min.css +1 -0
- metadata +70 -24
- data/.yardoc/checksums +0 -59
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/lib/ui_bibz/helpers/meta_helper.rb +0 -32
- data/lib/ui_bibz/ui/core/panel.rb +0 -138
- data/lib/ui_bibz/ui/core/progress_bar/components/bar.rb +0 -105
- data/lib/ui_bibz/ui/core/progress_bar/progress_bar.rb +0 -94
- data/lib/ui_bibz/ui/ux/grid.rb +0 -121
- data/test/ui/grid_test.rb +0 -46
- data/test/ui/panel_test.rb +0 -52
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2d33883fa7f3a8fa1092d3c011c634e94e69f107
|
|
4
|
+
data.tar.gz: b27fd0d3e07693c91c8d92adf01b6910fbf8a8ae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e33cee7fa94acc9b9b6884d3f880aef02afef79517c0be6802084832fceca94b9873ce429a09e1ce0ebe0dbd4bb130cab9876f1e6fb3148e563c56e74ef17a0
|
|
7
|
+
data.tar.gz: 10f162ab46b76018679a40117476e4d7011ec87cd565b1167938548b764e9d59825d6cf82a5776c2a194dc33579241c6e6ad2db0ad2f56ed8181e99796dbe5ad
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ui_bibz (
|
|
5
|
-
bootstrap
|
|
4
|
+
ui_bibz (2.0.0.alpha)
|
|
5
|
+
bootstrap (~> 4.0.0.alpha3)
|
|
6
6
|
font-awesome-sass
|
|
7
7
|
haml
|
|
8
8
|
haml-rails
|
|
9
9
|
rails (>= 4.2.0)
|
|
10
|
+
rails-assets-tether (>= 1.1.0)
|
|
10
11
|
sass-rails (>= 5.0.0)
|
|
11
12
|
will-paginate-i18n
|
|
12
|
-
will_paginate (~> 3.0
|
|
13
|
+
will_paginate (~> 3.1.0)
|
|
13
14
|
will_paginate-bootstrap
|
|
14
15
|
|
|
15
16
|
GEM
|
|
16
17
|
remote: https://rubygems.org/
|
|
18
|
+
remote: https://rails-assets.org/
|
|
17
19
|
specs:
|
|
18
20
|
actionmailer (4.2.5.2)
|
|
19
21
|
actionpack (= 4.2.5.2)
|
|
@@ -54,9 +56,9 @@ GEM
|
|
|
54
56
|
autoprefixer-rails (6.3.3.1)
|
|
55
57
|
execjs
|
|
56
58
|
awesome_print (1.6.1)
|
|
57
|
-
bootstrap
|
|
58
|
-
autoprefixer-rails (>=
|
|
59
|
-
sass (>= 3.
|
|
59
|
+
bootstrap (4.0.0.alpha3)
|
|
60
|
+
autoprefixer-rails (>= 6.0.3)
|
|
61
|
+
sass (>= 3.4.19)
|
|
60
62
|
builder (3.2.2)
|
|
61
63
|
codeclimate-test-reporter (0.5.0)
|
|
62
64
|
simplecov (>= 0.7.1, < 1.0.0)
|
|
@@ -111,6 +113,7 @@ GEM
|
|
|
111
113
|
bundler (>= 1.3.0, < 2.0)
|
|
112
114
|
railties (= 4.2.5.2)
|
|
113
115
|
sprockets-rails
|
|
116
|
+
rails-assets-tether (1.2.0)
|
|
114
117
|
rails-deprecated_sanitizer (1.0.3)
|
|
115
118
|
activesupport (>= 4.2.0.alpha)
|
|
116
119
|
rails-dom-testing (1.0.7)
|
|
@@ -156,7 +159,7 @@ GEM
|
|
|
156
159
|
tzinfo (1.2.2)
|
|
157
160
|
thread_safe (~> 0.1)
|
|
158
161
|
will-paginate-i18n (0.1.15)
|
|
159
|
-
will_paginate (3.0
|
|
162
|
+
will_paginate (3.1.0)
|
|
160
163
|
will_paginate-bootstrap (1.0.1)
|
|
161
164
|
will_paginate (>= 3.0.3)
|
|
162
165
|
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-

|
|
2
2
|
|
|
3
3
|
[](http://badge.fury.io/rb/ui_bibz)
|
|
4
4
|
[](https://travis-ci.org/thooams/Ui-Bibz)
|
|
@@ -11,1047 +11,13 @@
|
|
|
11
11
|
This project rocks and uses MIT-LICENSE.
|
|
12
12
|
|
|
13
13
|
# Ui Bibz
|
|
14
|
-
> Ui Bibz
|
|
15
|
-
>
|
|
16
|
-
>
|
|
14
|
+
> Ui Bibz is a [Ui framework](http://fr.wikipedia.org/wiki/Framework_d%27interface)
|
|
15
|
+
> to allow build an interface very quickly and simply
|
|
16
|
+
> using [Ruby on Rails 4](http://rubyonrails.org/) and [Boostrap 4](http://getbootstrap.com/).
|
|
17
17
|
|
|
18
|
-
Ui Bibz
|
|
19
|
-
[awesomefont](http://fontawesome.io/).
|
|
18
|
+
Ui Bibz load [boostrap](http://getbootstrap.com/) and [awesomefont](http://fontawesome.io/).
|
|
20
19
|
|
|
21
|
-
Tous les composants du framework Ui Bibz comportent l'agument *options* et l'argument *html_options*.
|
|
22
|
-
Ces éléments sont basés sur l'élément ```Component```.
|
|
23
|
-
Un ```component``` accepte un contenu par variable ou par block.
|
|
24
|
-
|
|
25
|
-
### Component
|
|
26
|
-
|
|
27
|
-
L'élément ```component``` accepte dans content et block :
|
|
28
|
-
|
|
29
|
-
* le contenu
|
|
30
|
-
|
|
31
|
-
L'élément ```component``` à pour ```options``` un Hash acceptant les clefs :
|
|
32
|
-
|
|
33
|
-
* [state](#state-values)
|
|
34
|
-
* [glyph](#glyph-arguments)
|
|
35
|
-
* [status](#status-values)
|
|
36
|
-
* class
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
L'élément ```component``` à pour ```html_options``` un Hash acceptant les clefs :
|
|
40
|
-
|
|
41
|
-
* class
|
|
42
|
-
* data
|
|
43
|
-
* ...
|
|
44
|
-
|
|
45
|
-
Exemple :
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
Component.new 'Exemple', { state: :success, glyph: { name: 'pencil', size: 3} }, { class: 'exemple' }
|
|
49
|
-
|
|
50
|
-
Component.new { state: :success, glyph: 'eye' }, { class: 'exemple' } do
|
|
51
|
-
'Exemple'
|
|
52
|
-
end
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Signature :
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
Component.new content = nil, options = nil, html_options = nil, &block
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
**NB** : Pour des raisons de simplicité d'écriture, l'argument ```class``` est présent
|
|
62
|
-
dans ```options``` et ```html_options```.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
## Installation
|
|
66
|
-
|
|
67
|
-
Ajouter la gem dans Rails :
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
gem "ui_bibz", '~> 1.2.5'
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
Lancer la command suivante :
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
bundle install
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Placer la ligne suivante dans ```/app/views/layouts/application.rb```
|
|
80
|
-
|
|
81
|
-
```
|
|
82
|
-
= ui_bibz_meta_links
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Exemple ([haml](http://haml.info/)):
|
|
86
|
-
```
|
|
87
|
-
!!!
|
|
88
|
-
%html
|
|
89
|
-
%head
|
|
90
|
-
...
|
|
91
|
-
= ui_bibz_meta_links
|
|
92
|
-
...
|
|
93
|
-
%body
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
Ui Bibz chargera les librairies en CDN directement dans votre application.
|
|
97
|
-
Si vous préférez charger les librairies en locales, utilisez plutôt la méthode ```ui_bibz_local_meta_links```
|
|
98
|
-
et insérez dans le fichier ```/config/initializers/assets.rb``` de votre
|
|
99
|
-
application cette ligne:
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
# For Ui bibz js
|
|
103
|
-
Rails.application.config.assets.precompile += %w(jquery-2.1.4.min.js)
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
Placer la ligne suivante dans ```/app/assets/stylesheets/applications.css```
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
...
|
|
111
|
-
*= require ui_bibz
|
|
112
|
-
...
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
Placer la ligne suivante dans ```/app/assets/javascripts/applications.js```
|
|
116
|
-
|
|
117
|
-
```
|
|
118
|
-
...
|
|
119
|
-
//= require ui_bibz
|
|
120
|
-
...
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
_Ps: Vous pouvez utiliser les variables sass présentes dans boostrap._
|
|
124
|
-
|
|
125
|
-
## Utilisation
|
|
126
|
-
|
|
127
|
-
### Alert
|
|
128
|
-
|
|
129
|
-

|
|
130
|
-
|
|
131
|
-
L'élément ```notify``` à pour ```options``` un Hash acceptant les clefs :
|
|
132
|
-
|
|
133
|
-
* [state](#state-values)
|
|
134
|
-
* [glyph](#glyph-arguments)
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
notify 'Alert', state: :info, glyph: 'eye'
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/Alert.html)
|
|
141
|
-
|
|
142
|
-
### Breadcrumb (fil d'ariane)
|
|
143
|
-
|
|
144
|
-

|
|
145
|
-
|
|
146
|
-
L'élément ```breadcrumb``` à pour enfant l'élément ```link``` qui accepte pour option un Hash avec les clefs :
|
|
147
|
-
|
|
148
|
-
* [status](#status-values)
|
|
149
|
-
* [glyph](#glyph-arguments)
|
|
150
|
-
* url
|
|
151
|
-
|
|
152
|
-
```
|
|
153
|
-
breadcrumb do |b|
|
|
154
|
-
b.link 'Exemple 1', url: '#exemple-1', glyph: 'home'
|
|
155
|
-
b.link({ url: '#exemple-2' }, { class:'link' }) do
|
|
156
|
-
'Exemple 2'
|
|
157
|
-
end
|
|
158
|
-
b.link 'Exemple 3', status: :active
|
|
159
|
-
end
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/Breadcrumb.html)
|
|
163
|
-
|
|
164
|
-
### Buttons (Boutons)
|
|
165
|
-
|
|
166
|
-
#### Button
|
|
167
|
-
|
|
168
|
-

|
|
169
|
-
|
|
170
|
-
L'élément ```button``` à pour ```options``` un Hash acceptant les clefs :
|
|
171
|
-
|
|
172
|
-
* [state](#state-values)
|
|
173
|
-
* [status](#status-values)
|
|
174
|
-
* [glyph](#glyph-arguments)
|
|
175
|
-
* [size](#size-values)
|
|
176
|
-
|
|
177
|
-
```
|
|
178
|
-
button 'Button', { state: :danger, size: :xs, glyph: 'star' } , { class: 'my-button' }
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/Button.html)
|
|
182
|
-
|
|
183
|
-
#### Button Dropdown
|
|
184
|
-
|
|
185
|
-
L'élément ```button_dropdown``` accepte pour options les mêmes clefs que l'élément
|
|
186
|
-
[dropdown](#dropdown).
|
|
187
|
-
|
|
188
|
-

|
|
189
|
-
|
|
190
|
-
```
|
|
191
|
-
button_dropdown 'Button Dropdown' do |bd|
|
|
192
|
-
bd.link Link 1', '#'
|
|
193
|
-
bd.header 'Header 1'
|
|
194
|
-
bd.link 'Link 2'
|
|
195
|
-
bd.divider
|
|
196
|
-
bd.link 'Link 3', '#'
|
|
197
|
-
bd.html link_to('Link 4', '#')
|
|
198
|
-
end
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/ButtonLink.html)
|
|
202
|
-
|
|
203
|
-
#### Button group
|
|
204
|
-
|
|
205
|
-

|
|
206
|
-
|
|
207
|
-
L'élément ```button_group``` à pour ```options``` un Hash acceptant les clefs :
|
|
208
|
-
|
|
209
|
-
* position (:vertical, :horizontal)
|
|
210
|
-
* [size](#size-values)
|
|
211
|
-
|
|
212
|
-
L'élément ```list``` à pour ```options``` un Hash acceptant les clefs :
|
|
213
|
-
|
|
214
|
-
* [status](#status-values)
|
|
215
|
-
* [state](#state-values)
|
|
216
|
-
|
|
217
|
-
```ruby
|
|
218
|
-
button_group({ position: :vertical, size: :xs }) do
|
|
219
|
-
button 'Button 1', status: :active
|
|
220
|
-
button 'Button 2'
|
|
221
|
-
button 'Button 3'
|
|
222
|
-
end
|
|
223
|
-
|
|
224
|
-
button_group do
|
|
225
|
-
button 'Button 1', status: :active
|
|
226
|
-
button 'Button 2'
|
|
227
|
-
button 'Button 3'
|
|
228
|
-
button_dropdown 'Button Dropdown' do |bd|
|
|
229
|
-
bd.header 'header'
|
|
230
|
-
bd.link 'Link 1', '#'
|
|
231
|
-
bd.divider
|
|
232
|
-
bd.link 'Link 2', '#'
|
|
233
|
-
end
|
|
234
|
-
end
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/ButtonGroup.html)
|
|
238
|
-
|
|
239
|
-
#### Button Link (Lien Bouton)
|
|
240
|
-
|
|
241
|
-

|
|
242
|
-
|
|
243
|
-
L'élément ```button_link``` à pour ```options``` un Hash acceptant les clefs :
|
|
244
|
-
|
|
245
|
-
```ruby
|
|
246
|
-
button_link 'Button', { url: '#button', state: :primary, glyph: 'star' }, { class: 'my-button' }
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/ButtonLink.html)
|
|
250
|
-
|
|
251
|
-
#### Button Split Dropdown
|
|
252
|
-
|
|
253
|
-

|
|
254
|
-
|
|
255
|
-
L'élément ```button_split_dropdown```accepte pour options les mêmes clefs
|
|
256
|
-
que l'élément [dropdown](#dropdown).
|
|
257
|
-
|
|
258
|
-
```ruby
|
|
259
|
-
button_split_dropdown 'Dropdown', state: :primary do |d|
|
|
260
|
-
d.link url: "#" do
|
|
261
|
-
'Link 1'
|
|
262
|
-
end
|
|
263
|
-
d.header 'Header 1'
|
|
264
|
-
d.link 'Link 2', '#'
|
|
265
|
-
d.divider
|
|
266
|
-
d.link 'Link 3', '#'
|
|
267
|
-
end
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/ButtonSplitDropdown.html)
|
|
271
|
-
|
|
272
|
-
### Dropdown
|
|
273
|
-
|
|
274
|
-
L'élément ```dropdown``` à pour ```options``` un Hash acceptant les clefs :
|
|
275
|
-
|
|
276
|
-
* [state](#state-values)
|
|
277
|
-
* [status](#status-values)
|
|
278
|
-
* position (:left, :right)
|
|
279
|
-
|
|
280
|
-
L'élément ```list``` est un [component](#component) qui accepte pour options les clefs :
|
|
281
|
-
|
|
282
|
-
* type (:header)
|
|
283
|
-
* [glyph](#glyph-arguments)
|
|
284
|
-
|
|
285
|
-
```ruby
|
|
286
|
-
dropdown 'Dropdown', state: :success do |d|
|
|
287
|
-
d.list do
|
|
288
|
-
link_to 'Link 1', "#"
|
|
289
|
-
end
|
|
290
|
-
d.list 'Header 1', type: :header
|
|
291
|
-
d.list link_to 'Link 2', '#'
|
|
292
|
-
d.list '---'
|
|
293
|
-
d.list link_to 'Link 3', '#'
|
|
294
|
-
end
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
Pour ajouter une ligne séparatrice, il suffit d'insérer 3 "-" à la suite
|
|
298
|
-
|
|
299
|
-
Exemple :
|
|
300
|
-
|
|
301
|
-
```
|
|
302
|
-
...
|
|
303
|
-
d.list '--'
|
|
304
|
-
...
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/Dropdown.html)
|
|
308
|
-
|
|
309
|
-
### Progress Bar
|
|
310
|
-
|
|
311
|
-

|
|
312
|
-
|
|
313
|
-
L'élément ```progress_bar``` à pour ```options``` un Hash acceptant les clefs :
|
|
314
|
-
|
|
315
|
-
* [state](#state-values)
|
|
316
|
-
* type (:animated, :striped)
|
|
317
|
-
* label - String (default: "percentage%")
|
|
318
|
-
* tap - Boolean (true: To add several bars)
|
|
319
|
-
* percentage_min - Integer (default: 0)
|
|
320
|
-
* percentage_max - Integer (default: 100)
|
|
321
|
-
* sr_only - Boolean to show label (default: false)
|
|
322
|
-
|
|
323
|
-
```ruby
|
|
324
|
-
progress_bar 30
|
|
325
|
-
|
|
326
|
-
progress_bar state: :info, sr_only: true, type: :animated do
|
|
327
|
-
70
|
|
328
|
-
end
|
|
329
|
-
|
|
330
|
-
progress_bar(tap: true) do |pb|
|
|
331
|
-
pb.bar 10, { state: :success, label: 'Loading...' },{ class: 'test' }
|
|
332
|
-
pb.bar 30, state: :warning
|
|
333
|
-
pb.bar(type: :striped) do
|
|
334
|
-
10
|
|
335
|
-
end
|
|
336
|
-
end
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/ProgressBar.html)
|
|
340
|
-
|
|
341
|
-
### Glyph
|
|
342
|
-
|
|
343
|
-

|
|
344
|
-
|
|
345
|
-
Les glyphs utilisés proviennent de [Font Awesome](http://fontawesome.io/).
|
|
346
|
-
L'élément ```glyph``` peut contenir un hash pour ```content```
|
|
347
|
-
L'élément ```glyph``` à pour ```options``` un Hash acceptant les clefs :
|
|
348
|
-
|
|
349
|
-
* size
|
|
350
|
-
* type
|
|
351
|
-
|
|
352
|
-
```ruby
|
|
353
|
-
glyph 'star', { size: 3, type: 'fw' }, class: 'star-exemple'
|
|
354
|
-
|
|
355
|
-
glyph { name: 'star', size: 3, type: 'fw' }
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/Glyph.html)
|
|
359
|
-
|
|
360
|
-
### Stars
|
|
361
|
-
|
|
362
|
-

|
|
363
|
-
|
|
364
|
-
L'élément ```stars``` à pour ```options``` un Hash acceptant les clefs :
|
|
365
|
-
|
|
366
|
-
* num - Correspond au nombre d'étoiles affichées (default: 5)
|
|
367
|
-
* [state](#state-values)
|
|
368
|
-
|
|
369
|
-
```ruby
|
|
370
|
-
stars 3.2
|
|
371
|
-
|
|
372
|
-
stars 7, { num: 10, state: :danger }
|
|
373
|
-
|
|
374
|
-
stars num: 3 do
|
|
375
|
-
1
|
|
376
|
-
end
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/Stars.html)
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
### Modal
|
|
383
|
-
|
|
384
|
-

|
|
385
|
-
|
|
386
|
-
Les éléments ```header```, ```body```, ```footer``` sont des éléments [component](#component).
|
|
387
|
-
|
|
388
|
-
Exemple :
|
|
389
|
-
|
|
390
|
-
```ruby
|
|
391
|
-
|
|
392
|
-
modal do |m|
|
|
393
|
-
m.header 'Header', glyph: 'eye'
|
|
394
|
-
m.body(class: 'my-body') do
|
|
395
|
-
'Content body'
|
|
396
|
-
end
|
|
397
|
-
m.footer 'Footer'
|
|
398
|
-
end
|
|
399
|
-
```
|
|
400
|
-
|
|
401
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/Modal.html)
|
|
402
|
-
|
|
403
|
-
### Panel
|
|
404
|
-
|
|
405
|
-

|
|
406
|
-
|
|
407
|
-
L'élément ```panel``` à pour ```options``` un Hash acceptant les clefs :
|
|
408
|
-
|
|
409
|
-
* [state](#state-values)
|
|
410
|
-
* tap (true) : permet de créer un header, body et footer
|
|
411
|
-
|
|
412
|
-
Les éléments ```header```, ```body```,```footer``` sont des éléments [component](#component).
|
|
413
|
-
|
|
414
|
-
Exemple :
|
|
415
|
-
|
|
416
|
-
```ruby
|
|
417
|
-
panel 'danger'
|
|
418
|
-
|
|
419
|
-
panel(state: :danger) do
|
|
420
|
-
'Content'
|
|
421
|
-
end
|
|
422
|
-
|
|
423
|
-
panel({ tap: true, state: :danger, table_options: { actionable: true } }, { class: 'exemple' }) |p|
|
|
424
|
-
p.header 'Header', glyph: 'eye'
|
|
425
|
-
p.body(class: 'my-body') do
|
|
426
|
-
'Content body'
|
|
427
|
-
end
|
|
428
|
-
p.footer 'Footer'
|
|
429
|
-
end
|
|
430
|
-
```
|
|
431
|
-
|
|
432
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/Panel.html)
|
|
433
|
-
|
|
434
|
-
### Table
|
|
435
|
-
|
|
436
|
-

|
|
437
|
-
|
|
438
|
-
L'élément ```table``` est un tableau composé d'une recherche, une pagination et un trie de colonnes intégrées.
|
|
439
|
-
Le tableau est compatible [I18n](http://guides.rubyonrails.org/i18n.html).
|
|
440
|
-
Le tableau contient pour chaque ligne un bouton dropdown 'action' avec par défaut
|
|
441
|
-
ces 3 actions : voir, éditer, supprimer. Toutes les colonnes sont présentes et
|
|
442
|
-
affichées par défaut.
|
|
443
|
-
|
|
444
|
-
La table doit contenir un store. Ce store doit-être créé dans le *controlleur* avec la
|
|
445
|
-
méthode ```table_search_pagination```.
|
|
446
|
-
|
|
447
|
-
La méthode ```table_search_pagination``` contient 3 arguments :
|
|
448
|
-
|
|
449
|
-
* params
|
|
450
|
-
* session
|
|
451
|
-
* args (optionel)
|
|
452
|
-
|
|
453
|
-
Exemple :
|
|
454
|
-
|
|
455
|
-
```
|
|
456
|
-
# app/controllers/document_controller.rb
|
|
457
|
-
@documents = Document.table_search_pagination(params, session)
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
Dans le *model*, insérer la méthode ```searchable_attributes``` afin de pouvoir
|
|
461
|
-
faire une recherche sur les attributs souhaités.
|
|
462
|
-
|
|
463
|
-
Exemple :
|
|
464
|
-
|
|
465
|
-
```
|
|
466
|
-
# app/models/document.rb
|
|
467
|
-
searchable_attributes :name_fr, :name_en
|
|
468
|
-
```
|
|
469
|
-
|
|
470
|
-
Un champ recherche est disponible dans la vue :
|
|
471
|
-
|
|
472
|
-

|
|
473
|
-
|
|
474
|
-
```
|
|
475
|
-
table_search_field store: @documents
|
|
476
|
-
```
|
|
477
|
-
|
|
478
|
-
Une pagination est disponible dans la vue :
|
|
479
|
-
|
|
480
|
-
```
|
|
481
|
-
table_pagination store: @documents
|
|
482
|
-
```
|
|
483
|
-
|
|
484
|
-
Un champs select par page est disponible dans la vue :
|
|
485
|
-
|
|
486
|
-

|
|
487
|
-
|
|
488
|
-
```
|
|
489
|
-
table_pagination_per_page store: @documents
|
|
490
|
-
```
|
|
491
|
-
|
|
492
|
-
#### Simple Example table
|
|
493
|
-
|
|
494
|
-
Dans le **controlleur**, insérer la méthode ```table_search_pagination```.
|
|
495
|
-
La méthode ```table_search_pagination``` contient 3 arguments :
|
|
496
|
-
|
|
497
|
-
* params
|
|
498
|
-
* session
|
|
499
|
-
* args
|
|
500
|
-
|
|
501
|
-
Exemple :
|
|
502
|
-
|
|
503
|
-
```
|
|
504
|
-
# app/controllers/document_controller.rb
|
|
505
|
-
@documents = Document.table_search_pagination(params, session)
|
|
506
|
-
```
|
|
507
|
-
|
|
508
|
-
Dans le **model**, insérer la méthode ```searchable_attributes``` afin de pouvoir
|
|
509
|
-
faire une recherche sur les attributs souhaités. Vous pouvez même faire une
|
|
510
|
-
recherche sur une table différente en insérant un hash avec pour clef le nom du model et en valeur le nom
|
|
511
|
-
de l'attribut recherché.
|
|
512
|
-
|
|
513
|
-
Exemple :
|
|
514
|
-
|
|
515
|
-
```
|
|
516
|
-
# app/models/document.rb
|
|
517
|
-
searchable_attributes :name_fr, :name_en, { user: :name }
|
|
518
|
-
```
|
|
519
|
-
|
|
520
|
-
Dans la **vue**, insérer la méthode ```table``` qui peut contenir plusieurs arguments :
|
|
521
|
-
|
|
522
|
-
* store (ex: @documents)
|
|
523
|
-
* paginable (true, false)
|
|
524
|
-
* sortable (true, false)
|
|
525
|
-
|
|
526
|
-
Une table comporte des **colonnes** et des **actions**.
|
|
527
|
-
|
|
528
|
-
Exemple :
|
|
529
|
-
|
|
530
|
-
```
|
|
531
|
-
# app/views/documents/index.html.haml
|
|
532
|
-
table store: @documents
|
|
533
|
-
```
|
|
534
|
-
|
|
535
|
-
Les actions par défauts peuvent être modifiées ([voir exemple complexe](#Complex-Example-table)) :
|
|
536
|
-
|
|
537
|
-
* edit
|
|
538
|
-
* view
|
|
539
|
-
* delete
|
|
540
|
-
|
|
541
|
-
Elles sont intégrées à l'intérieur d'un bouton [dropdown](#dropdown).
|
|
542
|
-
|
|
543
|
-
Exemple :
|
|
544
|
-
|
|
545
|
-
```
|
|
546
|
-
# app/views/documents/index.html.haml
|
|
547
|
-
table store: @documents do |g|
|
|
548
|
-
g.actions do |acs|
|
|
549
|
-
acs.headr 'Main Actions'
|
|
550
|
-
acs.link 'Show', documents_path(:id), glyph: 'eye'
|
|
551
|
-
acs.link 'Edit', edit_document_path(:id), glyph: 'pencil'
|
|
552
|
-
acs.link 'Delete', documents_path(:id), method: :delete, glyph: 'trash', data: { confirm: 'Are you sure?' }
|
|
553
|
-
acs.divider
|
|
554
|
-
acs.link 'Duplicate', duplicate_document_path(:id), glyph: 'files-o'
|
|
555
|
-
acs.link 'Alert', alert_document_path(:id), glyph: 'bell'
|
|
556
|
-
end
|
|
557
|
-
end
|
|
558
|
-
```
|
|
559
|
-
|
|
560
|
-
L'ajout de colonnes à travers la méthode ```column``` contient plusieurs arguments et cette méthode est basée sur le component :
|
|
561
|
-
|
|
562
|
-
* Content (ex: name)
|
|
563
|
-
* options (hash)
|
|
564
|
-
* data_index (le nom de l'attribut)
|
|
565
|
-
* count (utilise la méthode count sur l'élément)
|
|
566
|
-
* date_format (formate l'affichage de la date en utilisant la méthode ```strftime``` ex: '%Y/%M/%D')
|
|
567
|
-
* format (formate les élements de la colone en utilisant **lambda**)
|
|
568
|
-
* link (ajoute un lien où l'expression ```:id``` est parsé et remplacé par l'entier correspondant)
|
|
569
|
-
* sort (permet de trier sur des champs )
|
|
570
|
-
* column_id (permet d'identifier la colonne : peut être utile pour le sort)
|
|
571
|
-
* custom_sort (indique que le tableau sera triéé d'une manière personnalisée)
|
|
572
|
-
* html_options (hash)
|
|
573
|
-
|
|
574
|
-
```
|
|
575
|
-
# app/views/documents/index.html.haml
|
|
576
|
-
table store: @documents do |g|
|
|
577
|
-
g.columns do |c|
|
|
578
|
-
c.column :id, { name: '#' }
|
|
579
|
-
c.column :name_fr, { name: 'Name fr', link: edit_document_path(:id) }
|
|
580
|
-
c.column :name_en
|
|
581
|
-
c.column :hotline_access, { name: 'Hotline', format: lambda{ |records, record| glyph(record.icon) } }
|
|
582
|
-
c.column :update_at, { date_format: '%Y' }
|
|
583
|
-
end
|
|
584
|
-
end
|
|
585
|
-
```
|
|
586
|
-
|
|
587
|
-
#### Complex Example table
|
|
588
|
-
|
|
589
|
-
Si on souhaite voir apparaître certaines liasions avec d'autres tables il faut pour
|
|
590
|
-
cela :
|
|
591
|
-
|
|
592
|
-
Dans le controlleur, insérer la méthode ```table_search_pagination``` en ajoutant
|
|
593
|
-
un ```includes``` juste avant.
|
|
594
|
-
|
|
595
|
-
Exemple :
|
|
596
|
-
```ruby
|
|
597
|
-
# app/controllers/document_controller.rb
|
|
598
|
-
@documents = Document.includes(:users).table_search_pagination(params, session)
|
|
599
|
-
```
|
|
600
|
-
|
|
601
|
-
Dans la vue, insérer la méthod ```table```.
|
|
602
|
-
NB: On peut créer ses propres méthodes comme ```user_name``` dans notre *model* "Document" et
|
|
603
|
-
l'appeler comme valeur pour la clef ```data_index```.
|
|
604
|
-
|
|
605
|
-
```
|
|
606
|
-
# app/views/documents/index.html.haml
|
|
607
|
-
table store: @documents do |g|
|
|
608
|
-
g.columns do |c|
|
|
609
|
-
c.column :user_name, { name: 'User', sort: "user.name" }
|
|
610
|
-
end
|
|
611
|
-
end
|
|
612
|
-
```
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
#### Ultra Complex Example table
|
|
616
|
-
|
|
617
|
-
Si l'on souhaite, par exemple, dénombrer des utilisateurs qui ont un lien non
|
|
618
|
-
direct avec les documents.
|
|
619
|
-
Imaginons par exemple, un utilisateur à des produits et que
|
|
620
|
-
ces produits contiennent plusieurs documents. On souhaite compter le nombre
|
|
621
|
-
d'utilisateurs par documents.
|
|
622
|
-
|
|
623
|
-
On peut ajouter des arguments dans la méthode ```table_search_pagination```
|
|
624
|
-
qui vont permettre de faire des jointures.
|
|
625
|
-
|
|
626
|
-
Exemple :
|
|
627
|
-
```
|
|
628
|
-
# app/controllers/document_controller.rb
|
|
629
|
-
arguments = { sortable: {
|
|
630
|
-
column: 'users',
|
|
631
|
-
count: true,
|
|
632
|
-
joins: "LEFT OUTER JOIN documents_products ON documents_products.document_id = documents.id
|
|
633
|
-
LEFT OUTER JOIN products ON products.id = documents_products.product_id
|
|
634
|
-
LEFT OUTER JOIN products_users ON products_users.product_id = products.id
|
|
635
|
-
LEFT OUTER JOIN users ON users.id = products_users.user_id"
|
|
636
|
-
} }
|
|
637
|
-
|
|
638
|
-
@documents = Document.includes(:users).table_search_pagination(params, session, arguments)
|
|
639
|
-
```
|
|
640
|
-
|
|
641
|
-
Ici l'argument sortable signifie que l'on souhaite s'interresser à la
|
|
642
|
-
fonctionnalité de trie.
|
|
643
|
-
|
|
644
|
-
Pour celà il faut :
|
|
645
|
-
|
|
646
|
-
* définir le nom de la colonne triéé à travers l'argument ```column:``` (string)
|
|
647
|
-
* définir si le traitement se fait sur le comptage avec l'argument ```count:```
|
|
648
|
-
(boolean)
|
|
649
|
-
* définir la jointure avec l'argument ```joins:``` (string, array, hash)
|
|
650
|
-
|
|
651
|
-
Dans la vue :
|
|
652
|
-
|
|
653
|
-
```
|
|
654
|
-
# app/views/documents/index.html.haml
|
|
655
|
-
table store: @documents do |g|
|
|
656
|
-
g.columns do |c|
|
|
657
|
-
c.column :users, { name: 'Users count', count: true, custom_sort: true }
|
|
658
|
-
end
|
|
659
|
-
end
|
|
660
|
-
```
|
|
661
|
-
|
|
662
|
-
#### table actions
|
|
663
|
-
|
|
664
|
-
Les actions d'une table peuvent être formatées avec le 'record' passé en paramètre.
|
|
665
|
-
|
|
666
|
-
```
|
|
667
|
-
# app/views/documents/index.html.haml
|
|
668
|
-
table store: @documents do |t|
|
|
669
|
-
t.columns do |cls|
|
|
670
|
-
cls.column :id, { name: '#' }
|
|
671
|
-
cls.column :name_en
|
|
672
|
-
end
|
|
673
|
-
t.actions do |acs|
|
|
674
|
-
acs.format do |record|
|
|
675
|
-
if record.active?
|
|
676
|
-
acs.link 'Active', { url: active_document_path(record.id) }
|
|
677
|
-
else
|
|
678
|
-
acs.link 'Disabled', { url: disabled_document_path(record.id) }
|
|
679
|
-
end
|
|
680
|
-
acs.link 'Show', { url: document_path(record.id) }
|
|
681
|
-
end
|
|
682
|
-
end
|
|
683
|
-
end
|
|
684
|
-
```
|
|
685
|
-
|
|
686
|
-
Les actions ainsi que la colonne action peuvent être désactivées en passant l'agument ```actionable:
|
|
687
|
-
false```.
|
|
688
|
-
|
|
689
|
-
```
|
|
690
|
-
# app/views/documents/index.html.haml
|
|
691
|
-
table store: @documents, actionable: false
|
|
692
|
-
```
|
|
693
|
-
|
|
694
|
-
#### Plus d'une table sur une page html
|
|
695
|
-
|
|
696
|
-
Si vous avez plus d'une table sur votre page html et que vous souhaitez faire
|
|
697
|
-
des recherches, paginer... Vous devez identifier chaque store pour que l'action
|
|
698
|
-
effectuée (recherche, pagination,...) ne soit affectée que sur la table désirée.
|
|
699
|
-
|
|
700
|
-
Pour cela il faut que vous donniez un identifiant unique à vos stores.
|
|
701
|
-
|
|
702
|
-
ex:
|
|
703
|
-
|
|
704
|
-
```
|
|
705
|
-
# app/controllers/document_controller.rb
|
|
706
|
-
@documents = Document.includes(:users).table_search_pagination(params, session, { store_id: 'store-1'})
|
|
707
|
-
```
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
#### table I18n
|
|
711
|
-
|
|
712
|
-
La table est utilisable avec I18n. Les traductions
|
|
713
|
-
s'executent par ordre d'importance dans cet ordre précis pour la colonne "name_fr" par exemple.
|
|
714
|
-
|
|
715
|
-
1. ui_biz.table.headers.document.name_fr
|
|
716
|
-
2. ui_biz.table.headers.defaults.name_fr
|
|
717
|
-
3. activerecord.attributes.document.name_fr
|
|
718
|
-
4. activerecord.attributes.defaults.name_fr
|
|
719
|
-
|
|
720
|
-
Le placeholder du champ recherche est utilisable et traduisible avec les attributs activerecord dans le fichier locale.
|
|
721
|
-
|
|
722
|
-
Exemple :
|
|
723
|
-
|
|
724
|
-
```
|
|
725
|
-
# config/locales/fr.yml
|
|
726
|
-
...
|
|
727
|
-
activerecord:
|
|
728
|
-
models:
|
|
729
|
-
user: 'Utilisateur'
|
|
730
|
-
attributes:
|
|
731
|
-
defaults:
|
|
732
|
-
name_fr: 'Nom fr'
|
|
733
|
-
...
|
|
734
|
-
```
|
|
735
|
-
|
|
736
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Ux/Table.html)
|
|
737
|
-
|
|
738
|
-
### Table Panel
|
|
739
|
-
|
|
740
|
-

|
|
741
|
-
|
|
742
|
-
Le composant ```table_panel``` est un [tableau](#table) dans un [panel](#panel).
|
|
743
|
-
|
|
744
|
-
```
|
|
745
|
-
table_panel store: @users
|
|
746
|
-
|
|
747
|
-
table_panel({ store: @users, tap: true, glyph: 'home', state: :danger }) do |g|
|
|
748
|
-
g.columns do |cls|
|
|
749
|
-
cls.column :id, { name: '#' }
|
|
750
|
-
cls.column :username, { name: 'Username', link: edit_user_path(:id) }
|
|
751
|
-
cls.column :name
|
|
752
|
-
cls.column(:email) do
|
|
753
|
-
'Email'
|
|
754
|
-
end
|
|
755
|
-
cls.column :role_name, { name: 'Role', sort: 'roles.name' }
|
|
756
|
-
end
|
|
757
|
-
g.actions do |acs|
|
|
758
|
-
acs.link 'Action 1', { url: edit_user_path(:id), glyph: 'pencil' }
|
|
759
|
-
acs.divider
|
|
760
|
-
acs.link { url: user_path(:id), glyph: 'eye' } do
|
|
761
|
-
'Action 2'
|
|
762
|
-
end
|
|
763
|
-
end
|
|
764
|
-
end
|
|
765
|
-
```
|
|
766
|
-
|
|
767
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Ux/TablePanel.html)
|
|
768
|
-
|
|
769
|
-
### List
|
|
770
|
-
|
|
771
|
-

|
|
772
|
-
|
|
773
|
-
Par défaut une liste à pour tag ```<li>```.
|
|
774
|
-
Mais elle peut se transformer en lien ```<a>``` à travers l'option ```type:```.
|
|
775
|
-
Par défaut le tag ```<li>``` est présent.
|
|
776
|
-
|
|
777
|
-
```
|
|
778
|
-
list_group type: :link do |lg|
|
|
779
|
-
lg.list 'Momo', { state: :success, glyph: 'home' }, { href: '#Momo' }
|
|
780
|
-
lg.list({ tap: true, status: :active }, { href: '#Toto' }) do |l|
|
|
781
|
-
l.header 'My title'
|
|
782
|
-
l.body 'My title'
|
|
783
|
-
end
|
|
784
|
-
end
|
|
785
|
-
|
|
786
|
-
list_group do |lg|
|
|
787
|
-
lg.list 'Momo', glyph: 'home', badge: 2
|
|
788
|
-
lg.list 'Toto'
|
|
789
|
-
end
|
|
790
|
-
```
|
|
791
|
-
|
|
792
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/List.html)
|
|
793
|
-
|
|
794
|
-
### Nav
|
|
795
|
-
|
|
796
|
-

|
|
797
|
-
|
|
798
|
-
Par défaut la navigation comporte des onglets "tab".
|
|
799
|
-
L'élément ```nav``` accepte en option les arguments :
|
|
800
|
-
|
|
801
|
-
* type (:pills, :tabs)
|
|
802
|
-
* position (:justified, :stacked)
|
|
803
|
-
* tap (true)
|
|
804
|
-
|
|
805
|
-
L'élement link est un [component](#component).
|
|
806
|
-
|
|
807
|
-
```
|
|
808
|
-
nav(type: :pills, position: :justified) do |d|
|
|
809
|
-
d.link 'Link 1', url: '#test', badge: 6
|
|
810
|
-
d.link(url: '#test2', status: :active) do
|
|
811
|
-
"Link 2"
|
|
812
|
-
end
|
|
813
|
-
end
|
|
814
|
-
```
|
|
815
|
-
|
|
816
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/Nav.html)
|
|
817
|
-
|
|
818
|
-
### Navbar
|
|
819
|
-
|
|
820
|
-

|
|
821
|
-
|
|
822
|
-
Par défaut la navigation comporte des onglets "tab".
|
|
823
|
-
L'élément ```navbar``` accepte en option les arguments :
|
|
824
|
-
|
|
825
|
-
* type (:default, :inverse)
|
|
826
|
-
* [glyph](#glyph-values)
|
|
827
|
-
* position (:top, :bottom)
|
|
828
|
-
* title (string)
|
|
829
|
-
|
|
830
|
-
L'élement nav est un [component](#component) et contient les composants :
|
|
831
|
-
|
|
832
|
-
* form
|
|
833
|
-
* dropdown
|
|
834
|
-
* text
|
|
835
|
-
* link
|
|
836
|
-
|
|
837
|
-
```
|
|
838
|
-
navbar(type: :inverse, position: :top) do |nb|
|
|
839
|
-
nb.nav do |n|
|
|
840
|
-
n.link 'Link 1', url: '#link-1'
|
|
841
|
-
end
|
|
842
|
-
nb.nav(position: :right) do |n|
|
|
843
|
-
n.link 'Link 2', url: '#test', badge: 6
|
|
844
|
-
n.link(url: '#link-2', status: :active) do
|
|
845
|
-
"Link 3"
|
|
846
|
-
end
|
|
847
|
-
end
|
|
848
|
-
end
|
|
849
|
-
```
|
|
850
|
-
|
|
851
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/Navbar.html)
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
### Etiquette
|
|
855
|
-
|
|
856
|
-

|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
NB : Les méthodes ```Tag, label``` sont déjà utilisées par Rails.
|
|
860
|
-
L'élément ```etiquette``` à pour ```options``` un Hash acceptant les clefs :
|
|
861
|
-
|
|
862
|
-
* [state](#state-values)
|
|
863
|
-
* [glyph](#glyph-values)
|
|
864
|
-
|
|
865
|
-
Exemple :
|
|
866
|
-
|
|
867
|
-
```
|
|
868
|
-
etiquette 'label'
|
|
869
|
-
etiquette 'label 2', state: :success
|
|
870
|
-
etiquette 'label 2', state: :danger
|
|
871
|
-
```
|
|
872
|
-
|
|
873
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/Etiquette.html)
|
|
874
|
-
|
|
875
|
-
### Row
|
|
876
|
-
|
|
877
|
-
Le composant row génére une div avec la class row.
|
|
878
|
-
|
|
879
|
-
```
|
|
880
|
-
row class: 'toto' do
|
|
881
|
-
'content'
|
|
882
|
-
end
|
|
883
|
-
# => <div class='row toto'>content</div>
|
|
884
|
-
```
|
|
885
|
-
|
|
886
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/Content.html)
|
|
887
|
-
|
|
888
|
-
### Col
|
|
889
|
-
|
|
890
|
-
L'élément ```col``` est un [composant](#composant) qui accèpte en arguments :
|
|
891
|
-
|
|
892
|
-
* num
|
|
893
|
-
* offset
|
|
894
|
-
* size
|
|
895
|
-
|
|
896
|
-
ou
|
|
897
|
-
|
|
898
|
-
* un tableau de hashes avec les arguments ```num```, ```offset``` et ```size``` à l'intérieur.
|
|
899
|
-
|
|
900
|
-
Ces paramètres génèrent les classes qui seront insérées dans la div avec la classe
|
|
901
|
-
col.
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
```
|
|
905
|
-
col({num: 2, size: :lg}, class: 'test') do
|
|
906
|
-
'content'
|
|
907
|
-
end
|
|
908
|
-
# => <div class='col-lg-2 test'>content</div>
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
col([{ offset: 1, size: :xs}, { num: 3}], class: 'test') do
|
|
912
|
-
'content'
|
|
913
|
-
end
|
|
914
|
-
# => <div class='col-xs-offset-1 col-md-3 test'>content</div>
|
|
915
|
-
```
|
|
916
|
-
|
|
917
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Core/Col.html)
|
|
918
|
-
|
|
919
|
-
### Grid
|
|
920
|
-
|
|
921
|
-
Une grid est un composant qui est composé de 5 vues :
|
|
922
|
-
|
|
923
|
-
* top
|
|
924
|
-
* right
|
|
925
|
-
* bottom
|
|
926
|
-
* left
|
|
927
|
-
* center
|
|
928
|
-
|
|
929
|
-
La vue **center** est obligatoire.
|
|
930
|
-
Une vue à pour arguments :
|
|
931
|
-
|
|
932
|
-
* position (:top, :left, :bottom, :right, :center)
|
|
933
|
-
* num (1..12) 12 étant le nombre limite de colonnes utilisable dans boostrap.
|
|
934
|
-
|
|
935
|
-
L'argument ```position``` détermine la position de la vue et l'argument ```num``` determine
|
|
936
|
-
le nombre de colonnes occupées par la vue.
|
|
937
|
-
|
|
938
|
-
```
|
|
939
|
-
grid do |g|
|
|
940
|
-
g.view num: 3, position: :left do
|
|
941
|
-
list_group(type: :link) do |lg|
|
|
942
|
-
lg.list 'Link 1', { url: '#link1' }
|
|
943
|
-
lg.list 'Link 2', { url: '#link1', status: :active }
|
|
944
|
-
lg.list 'Link 1', { url: '#link1' }
|
|
945
|
-
lg.list 'Link 3', { url: '#link1' }
|
|
946
|
-
lg.list 'Link 4', { url: '#link1' }
|
|
947
|
-
end
|
|
948
|
-
end
|
|
949
|
-
g.view({ position: :top}) do
|
|
950
|
-
button_group(type: :toolbar) do
|
|
951
|
-
button 'option 1'
|
|
952
|
-
button 'option 2'
|
|
953
|
-
button 'option 3'
|
|
954
|
-
end
|
|
955
|
-
end
|
|
956
|
-
g.view position: :center do
|
|
957
|
-
table store: @users, type: :bordered
|
|
958
|
-
end
|
|
959
|
-
g.view position: :bottom do
|
|
960
|
-
'bottom'
|
|
961
|
-
end
|
|
962
|
-
end
|
|
963
|
-
|
|
964
|
-
grid do |g|
|
|
965
|
-
g.view num: 5, position: :left do
|
|
966
|
-
'left'
|
|
967
|
-
end
|
|
968
|
-
g.view position: :right do
|
|
969
|
-
'right'
|
|
970
|
-
end
|
|
971
|
-
g.view({ position: :top}, { class: 'success'}) do
|
|
972
|
-
'top'
|
|
973
|
-
end
|
|
974
|
-
g.view position: :center do
|
|
975
|
-
'center'
|
|
976
|
-
end
|
|
977
|
-
g.view position: :bottom do
|
|
978
|
-
'bottom'
|
|
979
|
-
end
|
|
980
|
-
end
|
|
981
|
-
```
|
|
982
|
-
|
|
983
|
-
Voir la [doc](http://hummel.link/Ui-Bibz/1.2.5/UiBibz/Ui/Ux/Grid.html)
|
|
984
|
-
|
|
985
|
-
### Arguments and Values
|
|
986
|
-
|
|
987
|
-
#### status-values
|
|
988
|
-
* :active
|
|
989
|
-
* :disable
|
|
990
|
-
|
|
991
|
-
#### size-values
|
|
992
|
-
* :xs
|
|
993
|
-
* :sm
|
|
994
|
-
* :lg
|
|
995
|
-
|
|
996
|
-
#### state-values
|
|
997
|
-
* :default
|
|
998
|
-
* :primary
|
|
999
|
-
* :info
|
|
1000
|
-
* :success
|
|
1001
|
-
* :warning
|
|
1002
|
-
* :danger
|
|
1003
|
-
|
|
1004
|
-
#### glyph-arguments
|
|
1005
|
-
* name
|
|
1006
|
-
* size
|
|
1007
|
-
* type
|
|
1008
|
-
|
|
1009
|
-
# Plus de détails
|
|
1010
|
-
|
|
1011
|
-
Pour plus d'informations, vous pouvez accéder à la documentation rdoc en
|
|
1012
|
-
générant cette dernière :
|
|
1013
|
-
|
|
1014
|
-
```
|
|
1015
|
-
rake rdoc
|
|
1016
|
-
```
|
|
1017
|
-
|
|
1018
|
-
# Conflits
|
|
1019
|
-
|
|
1020
|
-
Certaines méthodes dans le helper peuvent être en conflit avec d'autres
|
|
1021
|
-
librairies. Le cas échéant, vous pouvez utiliser directement la librairie UiBibz
|
|
1022
|
-
comme ci-dessous.
|
|
1023
|
-
|
|
1024
|
-
Exemple :
|
|
1025
|
-
|
|
1026
|
-
```ruby
|
|
1027
|
-
UiBibz::Ui::Core::Panel.new('Exemple', { state: :success }, { class: 'exemple'}).render
|
|
1028
|
-
# au lieu de
|
|
1029
|
-
panel 'Exemple', { state: :success }, { class: 'exemple' }
|
|
1030
|
-
```
|
|
1031
|
-
|
|
1032
|
-
# Ui Bibz versions
|
|
1033
|
-
|
|
1034
|
-
* [Ui Bibz v1.1.0](http://hummel.link/Ui-Bibz/1.1.0/index.html)
|
|
1035
|
-
* [Ui Bibz v1.1.1](http://hummel.link/Ui-Bibz/1.1.1/index.html)
|
|
1036
|
-
* [Ui Bibz v1.1.2](http://hummel.link/Ui-Bibz/1.1.2/index.html)
|
|
1037
|
-
* [Ui Bibz v1.1.3](http://hummel.link/Ui-Bibz/1.1.3/index.html)
|
|
1038
|
-
* [Ui Bibz v1.1.4](http://hummel.link/Ui-Bibz/1.1.4/index.html)
|
|
1039
|
-
* [Ui Bibz v1.1.5](http://hummel.link/Ui-Bibz/1.1.5/index.html)
|
|
1040
|
-
* [Ui Bibz v1.1.6](http://hummel.link/Ui-Bibz/1.1.6/index.html)
|
|
1041
|
-
* [Ui Bibz v1.1.7](http://hummel.link/Ui-Bibz/1.1.7/index.html)
|
|
1042
|
-
* [Ui Bibz v1.2.0](http://hummel.link/Ui-Bibz/1.2.0/index.html)
|
|
1043
|
-
* [Ui Bibz v1.2.1](http://hummel.link/Ui-Bibz/1.2.5/index.html)
|
|
1044
|
-
* [Ui Bibz v1.2.2](http://hummel.link/Ui-Bibz/1.2.2/index.html)
|
|
1045
|
-
* [Ui Bibz v1.2.3](http://hummel.link/Ui-Bibz/1.2.5/index.html)
|
|
1046
|
-
* [Ui Bibz v1.2.4](http://hummel.link/Ui-Bibz/1.2.5/index.html)
|
|
1047
|
-
* [Ui Bibz v1.2.5](http://hummel.link/Ui-Bibz/1.2.5/index.html)
|
|
1048
|
-
|
|
1049
|
-
# Roadmap
|
|
1050
|
-
|
|
1051
|
-
Pour la V2.
|
|
1052
|
-
|
|
1053
|
-
* créer des stores pour les listes, breadcrumb
|
|
1054
|
-
* créer d'autres extensions, plugins et une guideline
|
|
1055
|
-
* mise à jour vers bootstrap 4
|
|
1056
|
-
...
|
|
1057
20
|
|
|
21
|
+
## Documentation
|
|
22
|
+
Documentation is here :
|
|
23
|
+
[http://hummel.link/ui-bibz-app/](http://hummel.link/ui-bibz-app/)
|