ui_bibz 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.yardoc/checksums +49 -46
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/Gemfile.lock +69 -56
- data/README.md +156 -61
- data/doc/UiBibz/Concerns/Models/Searchable/ClassMethods.html +6 -6
- data/doc/UiBibz/Concerns/Models/Searchable.html +2 -2
- data/doc/UiBibz/Concerns/Models.html +115 -0
- data/doc/UiBibz/Concerns.html +115 -0
- data/doc/UiBibz/Helpers/MetaHelper.html +75 -9
- data/doc/UiBibz/Helpers/UiCoreHelper.html +120 -68
- data/doc/UiBibz/Helpers/UiUxHelper.html +2 -2
- data/doc/UiBibz/Helpers/UtilsHelper.html +2 -2
- data/doc/UiBibz/Helpers.html +115 -0
- data/doc/UiBibz/Rails/Engine.html +1 -1
- data/doc/UiBibz/Rails.html +1 -1
- data/doc/UiBibz/Ui/Base.html +2 -2
- data/doc/UiBibz/Ui/Core/Alert.html +26 -13
- data/doc/UiBibz/Ui/Core/Bar.html +26 -13
- data/doc/UiBibz/Ui/Core/Breadcrumb.html +32 -19
- data/doc/UiBibz/Ui/Core/BreadcrumbLink.html +26 -13
- data/doc/UiBibz/Ui/Core/Button.html +26 -13
- data/doc/UiBibz/Ui/Core/ButtonDropdown.html +31 -18
- data/doc/UiBibz/Ui/Core/ButtonGroup.html +26 -13
- data/doc/UiBibz/Ui/Core/ButtonLink.html +26 -13
- data/doc/UiBibz/Ui/Core/ButtonSplitDropdown.html +27 -14
- data/doc/UiBibz/Ui/Core/Col.html +26 -13
- data/doc/UiBibz/Ui/Core/Component.html +166 -225
- data/doc/UiBibz/Ui/Core/Dropdown.html +61 -410
- data/doc/UiBibz/Ui/Core/DropdownLink.html +373 -0
- data/doc/UiBibz/Ui/Core/DropdownList.html +26 -13
- data/doc/UiBibz/Ui/Core/Glyph.html +26 -386
- data/doc/UiBibz/Ui/Core/Jumbotron.html +26 -13
- data/doc/UiBibz/Ui/Core/Label.html +29 -15
- data/doc/UiBibz/Ui/Core/List.html +64 -25
- data/doc/UiBibz/Ui/Core/ListGroup.html +47 -21
- data/doc/UiBibz/Ui/Core/Nav.html +64 -25
- data/doc/UiBibz/Ui/Core/NavDropdown.html +29 -16
- data/doc/UiBibz/Ui/Core/NavLink.html +30 -15
- data/doc/UiBibz/Ui/Core/Navbar.html +154 -45
- data/doc/UiBibz/Ui/Core/NavbarForm.html +58 -38
- data/doc/UiBibz/Ui/Core/NavbarNav.html +7 -7
- data/doc/UiBibz/Ui/Core/NavbarText.html +26 -13
- data/doc/UiBibz/Ui/Core/Panel.html +38 -237
- data/doc/UiBibz/Ui/Core/ProgressBar.html +45 -19
- data/doc/UiBibz/Ui/Core/Row.html +26 -13
- data/doc/UiBibz/Ui/Core/Stars.html +367 -0
- data/doc/UiBibz/Ui/Core.html +16 -5
- data/doc/UiBibz/Ui/Ux/Actionable.html +1 -1
- data/doc/UiBibz/Ui/Ux/Actions.html +198 -14
- data/doc/UiBibz/Ui/Ux/Column.html +4 -4
- data/doc/UiBibz/Ui/Ux/Columns.html +42 -16
- data/doc/UiBibz/Ui/Ux/Grid.html +31 -371
- data/doc/UiBibz/Ui/Ux/Paginable.html +22 -9
- data/doc/UiBibz/Ui/Ux/Searchable.html +22 -9
- data/doc/UiBibz/Ui/Ux/Sortable.html +18 -7
- data/doc/UiBibz/Ui/Ux/Store.html +160 -56
- data/doc/UiBibz/Ui/Ux/Table.html +109 -374
- data/doc/UiBibz/Ui/Ux/TableAction.html +2 -2
- data/doc/UiBibz/Ui/Ux/TablePagination.html +33 -14
- data/doc/UiBibz/Ui/Ux/TablePaginationPerPage.html +30 -15
- data/doc/UiBibz/Ui/Ux/TablePanel.html +139 -43
- data/doc/UiBibz/Ui/Ux/TableSearchField.html +26 -13
- data/doc/UiBibz/Ui/Ux.html +15 -4
- data/doc/UiBibz/Ui.html +4 -2
- data/doc/UiBibz/Utils/Internationalization.html +1 -1
- data/doc/UiBibz/Utils.html +1 -1
- data/doc/UiBibz.html +5 -5
- data/doc/_index.html +50 -7
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +155 -63
- data/doc/images/stars.png +0 -0
- data/doc/index.html +155 -63
- data/doc/method_list.html +278 -398
- data/doc/top-level-namespace.html +1 -1
- data/lib/ui_bibz/concerns/models/searchable.rb +36 -13
- data/lib/ui_bibz/helpers/meta_helper.rb +22 -3
- data/lib/ui_bibz/helpers/ui_core_helper.rb +4 -0
- data/lib/ui_bibz/ui/core/alert.rb +2 -0
- data/lib/ui_bibz/ui/core/breadcrumb/breadcrumb.rb +3 -0
- data/lib/ui_bibz/ui/core/breadcrumb/components/breadcrumb_link.rb +2 -0
- data/lib/ui_bibz/ui/core/button/button.rb +2 -0
- data/lib/ui_bibz/ui/core/button/button_dropdown.rb +6 -4
- data/lib/ui_bibz/ui/core/button/button_group.rb +2 -0
- data/lib/ui_bibz/ui/core/button/button_link.rb +2 -0
- data/lib/ui_bibz/ui/core/button/button_split_dropdown.rb +2 -0
- data/lib/ui_bibz/ui/core/col.rb +2 -0
- data/lib/ui_bibz/ui/core/component.rb +23 -25
- data/lib/ui_bibz/ui/core/dropdown/components/dropdown_link.rb +57 -0
- data/lib/ui_bibz/ui/core/dropdown/components/dropdown_list.rb +2 -0
- data/lib/ui_bibz/ui/core/dropdown/dropdown.rb +22 -9
- data/lib/ui_bibz/ui/core/glyph.rb +10 -0
- data/lib/ui_bibz/ui/core/jumbotron.rb +2 -0
- data/lib/ui_bibz/ui/core/label.rb +3 -0
- data/lib/ui_bibz/ui/core/list/components/list.rb +4 -0
- data/lib/ui_bibz/ui/core/list/list_group.rb +4 -0
- data/lib/ui_bibz/ui/core/nav/components/nav_dropdown.rb +4 -2
- data/lib/ui_bibz/ui/core/nav/components/nav_link.rb +4 -1
- data/lib/ui_bibz/ui/core/nav/components/navbar_form.rb +39 -3
- data/lib/ui_bibz/ui/core/nav/components/navbar_nav.rb +1 -0
- data/lib/ui_bibz/ui/core/nav/components/navbar_text.rb +8 -0
- data/lib/ui_bibz/ui/core/nav/nav.rb +6 -0
- data/lib/ui_bibz/ui/core/nav/navbar.rb +31 -4
- data/lib/ui_bibz/ui/core/panel.rb +7 -5
- data/lib/ui_bibz/ui/core/progress_bar/components/bar.rb +2 -0
- data/lib/ui_bibz/ui/core/progress_bar/progress_bar.rb +4 -0
- data/lib/ui_bibz/ui/core/row.rb +2 -0
- data/lib/ui_bibz/ui/core/stars.rb +88 -0
- data/lib/ui_bibz/ui/ux/grid.rb +4 -0
- data/lib/ui_bibz/ui/ux/table/components/actions.rb +17 -2
- data/lib/ui_bibz/ui/ux/table/components/column.rb +2 -2
- data/lib/ui_bibz/ui/ux/table/components/columns.rb +4 -2
- data/lib/ui_bibz/ui/ux/table/components/store.rb +10 -1
- data/lib/ui_bibz/ui/ux/table/extensions/actionable.rb +3 -1
- data/lib/ui_bibz/ui/ux/table/extensions/paginable.rb +1 -0
- data/lib/ui_bibz/ui/ux/table/extensions/searchable.rb +1 -0
- data/lib/ui_bibz/ui/ux/table/extensions/sortable.rb +8 -2
- data/lib/ui_bibz/ui/ux/table/table.rb +19 -8
- data/lib/ui_bibz/ui/ux/table/table_pagination.rb +8 -1
- data/lib/ui_bibz/ui/ux/table/table_pagination_per_page.rb +10 -2
- data/lib/ui_bibz/ui/ux/table/table_panel.rb +28 -13
- data/lib/ui_bibz/ui/ux/table/table_search_field.rb +9 -1
- data/lib/ui_bibz/version.rb +1 -1
- data/lib/ui_bibz.rb +1 -0
- data/test/test_helper.rb +5 -0
- data/test/ui/dropdown_test.rb +4 -4
- data/test/ui/stars_test.rb +42 -0
- data/test/ui/table_test.rb +25 -6
- data/ui_bibz.gemspec +4 -1
- data/vendor/assets/fonts/FontAwesome.otf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.svg +640 -0
- data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff2 +0 -0
- data/vendor/assets/javascripts/bootstrap-datepicker.min.js +8 -0
- data/vendor/assets/javascripts/bootstrap-select.min.js +8 -0
- data/vendor/assets/javascripts/bootstrap-switch.min.js +22 -0
- data/vendor/assets/javascripts/bootstrap.min.js +7 -0
- data/vendor/assets/javascripts/jquery-2.1.4.min.js +4 -0
- data/vendor/assets/javascripts/ui_bibz.js.coffee +8 -0
- data/vendor/assets/stylesheets/bootstrap-datepicker3.min.css +8 -0
- data/vendor/assets/stylesheets/bootstrap-select.min.css +6 -0
- data/vendor/assets/stylesheets/bootstrap-switch.min.css +22 -0
- data/vendor/assets/stylesheets/bootstrap-theme.min.css +5 -0
- data/vendor/assets/stylesheets/bootstrap.min.css +5 -0
- data/vendor/assets/stylesheets/font-awesome.min.css +4 -0
- data/vendor/assets/stylesheets/ui_bibz.sass +23 -0
- metadata +71 -2
data/README.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
-
![Ui Bibz logo](images/ui-bibz-logo-without-border.gif)
|
1
|
+
![Ui Bibz logo](http://hummel.link/Ui-Bibz/images/ui-bibz-logo-without-border.gif)
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/thooams/Ui-Bibz.svg)](https://travis-ci.org/thooams/Ui-Bibz)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/thooams/Ui-Bibz/badges/gpa.svg)](https://codeclimate.com/github/thooams/Ui-Bibz)
|
5
5
|
[![Test Coverage](https://codeclimate.com/github/thooams/Ui-Bibz/badges/coverage.svg)](https://codeclimate.com/github/thooams/Ui-Bibz)
|
6
|
+
[![Inline docs](http://inch-ci.org/github/thooams/Ui-Bibz.svg?branch=master)](http://inch-ci.org/github/thooams/Ui-Bibz)
|
7
|
+
[![security](https://hakiri.io/github/thooams/Ui-Bibz/master.svg)](https://hakiri.io/github/thooams/Ui-Bibz/master)
|
8
|
+
[![Dependency Status](https://gemnasium.com/thooams/Ui-Bibz.svg)](https://gemnasium.com/thooams/Ui-Bibz)
|
6
9
|
|
7
10
|
This project rocks and uses MIT-LICENSE.
|
8
11
|
|
@@ -12,7 +15,7 @@ This project rocks and uses MIT-LICENSE.
|
|
12
15
|
> à l'aide de [Ruby on Rails 4](http://rubyonrails.org/) et de [Boostrap 3](http://getbootstrap.com/).
|
13
16
|
|
14
17
|
Ui Bibz charge la librairie [boostrap](http://getbootstrap.com/) et
|
15
|
-
[awesomefont](http://fontawesome.io/)
|
18
|
+
[awesomefont](http://fontawesome.io/).
|
16
19
|
|
17
20
|
Tous les composants du framework Ui Bibz comportent l'agument *options* et l'argument *html_options*.
|
18
21
|
Ces éléments sont basés sur l'élément ```Component```.
|
@@ -89,6 +92,24 @@ Exemple ([haml](http://haml.info/)):
|
|
89
92
|
%body
|
90
93
|
```
|
91
94
|
|
95
|
+
Ui Bibz chargera les librairies en CDN directement dans votre application.
|
96
|
+
Si vous préférez charger les librairies en locales, utilisez plutôt la méthode ```ui_bibz_local_meta_links```
|
97
|
+
et insérez dans le fichier ```/config/initializers/assets.rb``` de votre
|
98
|
+
application ces 3-4 lignes:
|
99
|
+
|
100
|
+
```
|
101
|
+
|
102
|
+
# For awesome-font
|
103
|
+
Rails.application.config.assets.paths << Rails.root.join("app", "assets", "fonts")
|
104
|
+
# For Ui bibz css
|
105
|
+
Rails.application.config.assets.precompile += %w(bootstrap.min.css bootstrap-theme.min.css font-awesome.min.css)
|
106
|
+
# For boostrap-theme (optionel)
|
107
|
+
Rails.application.config.assets.precompile += %w(bootstrap-theme.min.css)
|
108
|
+
# For Ui bibz js
|
109
|
+
Rails.application.config.assets.precompile += %w(jquery-2.1.4.min.js bootstrap.min.js)
|
110
|
+
|
111
|
+
```
|
112
|
+
|
92
113
|
Placer la ligne suivante dans ```/app/assets/stylesheets/applications.css```
|
93
114
|
|
94
115
|
```
|
@@ -109,7 +130,7 @@ Placer la ligne suivante dans ```/app/assets/javascripts/applications.js```
|
|
109
130
|
|
110
131
|
### Alert
|
111
132
|
|
112
|
-
![alert](images/alert.png)
|
133
|
+
![alert](http://hummel.link/Ui-Bibz/images/alert.png)
|
113
134
|
|
114
135
|
L'élément ```notify``` à pour ```options``` un Hash acceptant les clefs :
|
115
136
|
|
@@ -120,11 +141,11 @@ L'élément ```notify``` à pour ```options``` un Hash acceptant les clefs :
|
|
120
141
|
notify 'Alert', state: :info, glyph: 'eye'
|
121
142
|
```
|
122
143
|
|
123
|
-
Voir la [doc](UiBibz/Ui/Core/Alert.html)
|
144
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/Alert.html)
|
124
145
|
|
125
146
|
### Breadcrumb (fil d'ariane)
|
126
147
|
|
127
|
-
![breadcrumb](images/breadcrumb.png)
|
148
|
+
![breadcrumb](http://hummel.link/Ui-Bibz/images/breadcrumb.png)
|
128
149
|
|
129
150
|
L'élément ```breadcrumb``` à pour enfant l'élément ```link``` qui accepte pour option un Hash avec les clefs :
|
130
151
|
|
@@ -142,13 +163,13 @@ breadcrumb do |b|
|
|
142
163
|
end
|
143
164
|
```
|
144
165
|
|
145
|
-
Voir la [doc](UiBibz/Ui/Core/Breadcrumb.html)
|
166
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/Breadcrumb.html)
|
146
167
|
|
147
168
|
### Buttons (Boutons)
|
148
169
|
|
149
170
|
#### Button
|
150
171
|
|
151
|
-
![button](images/button.png)
|
172
|
+
![button](http://hummel.link/Ui-Bibz/images/button.png)
|
152
173
|
|
153
174
|
L'élément ```button``` à pour ```options``` un Hash acceptant les clefs :
|
154
175
|
|
@@ -161,14 +182,14 @@ L'élément ```button``` à pour ```options``` un Hash acceptant les clefs :
|
|
161
182
|
button 'Button', { state: :danger, size: :xs, glyph: 'star' } , { class: 'my-button' }
|
162
183
|
```
|
163
184
|
|
164
|
-
Voir la [doc](UiBibz/Ui/Core/Button.html)
|
185
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/Button.html)
|
165
186
|
|
166
187
|
#### Button Dropdown
|
167
188
|
|
168
189
|
L'élément ```button_dropdown``` accepte pour options les mêmes clefs que l'élément
|
169
190
|
[dropdown](#dropdown).
|
170
191
|
|
171
|
-
![button_link](images/button_dropdown.png)
|
192
|
+
![button_link](http://hummel.link/Ui-Bibz/images/button_dropdown.png)
|
172
193
|
|
173
194
|
```
|
174
195
|
button_dropdown 'Button Dropdown' do |bd|
|
@@ -180,11 +201,11 @@ button_dropdown 'Button Dropdown' do |bd|
|
|
180
201
|
end
|
181
202
|
```
|
182
203
|
|
183
|
-
Voir la [doc](UiBibz/Ui/Core/ButtonLink.html)
|
204
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/ButtonLink.html)
|
184
205
|
|
185
206
|
#### Button group
|
186
207
|
|
187
|
-
![button_group](images/button_group.png)
|
208
|
+
![button_group](http://hummel.link/Ui-Bibz/images/button_group.png)
|
188
209
|
|
189
210
|
L'élément ```button_group``` à pour ```options``` un Hash acceptant les clefs :
|
190
211
|
|
@@ -216,11 +237,11 @@ button_group do
|
|
216
237
|
end
|
217
238
|
```
|
218
239
|
|
219
|
-
Voir la [doc](UiBibz/Ui/Core/ButtonGroup.html)
|
240
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/ButtonGroup.html)
|
220
241
|
|
221
242
|
#### Button Link (Lien Bouton)
|
222
243
|
|
223
|
-
![button_link](images/button_link.png)
|
244
|
+
![button_link](http://hummel.link/Ui-Bibz/images/button_link.png)
|
224
245
|
|
225
246
|
L'élément ```button_link``` à pour ```options``` un Hash acceptant les clefs :
|
226
247
|
|
@@ -228,11 +249,11 @@ L'élément ```button_link``` à pour ```options``` un Hash acceptant les clefs
|
|
228
249
|
button_link 'Button', { url: '#button', state: :primary, glyph: 'star' }, { class: 'my-button' }
|
229
250
|
```
|
230
251
|
|
231
|
-
Voir la [doc](UiBibz/Ui/Core/ButtonLink.html)
|
252
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/ButtonLink.html)
|
232
253
|
|
233
254
|
#### Button Split Dropdown
|
234
255
|
|
235
|
-
![button_group](images/button_split_dropdown.png)
|
256
|
+
![button_group](http://hummel.link/Ui-Bibz/images/button_split_dropdown.png)
|
236
257
|
|
237
258
|
L'élément ```button_split_dropdown```accepte pour options les mêmes clefs
|
238
259
|
que l'élément [dropdown](#dropdown).
|
@@ -249,7 +270,7 @@ button_split_dropdown 'Dropdown', state: :primary do |d|
|
|
249
270
|
end
|
250
271
|
```
|
251
272
|
|
252
|
-
Voir la [doc](UiBibz/Ui/Core/ButtonSplitDropdown.html)
|
273
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/ButtonSplitDropdown.html)
|
253
274
|
|
254
275
|
### Dropdown
|
255
276
|
|
@@ -286,11 +307,11 @@ d.list '--'
|
|
286
307
|
...
|
287
308
|
```
|
288
309
|
|
289
|
-
Voir la [doc](UiBibz/Ui/Core/Dropdown.html)
|
310
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/Dropdown.html)
|
290
311
|
|
291
312
|
### Progress Bar
|
292
313
|
|
293
|
-
![glyph](images/progress_bar.png)
|
314
|
+
![glyph](http://hummel.link/Ui-Bibz/images/progress_bar.png)
|
294
315
|
|
295
316
|
L'élément ```progress_bar``` à pour ```options``` un Hash acceptant les clefs :
|
296
317
|
|
@@ -318,11 +339,11 @@ progress_bar(tap: true) do |pb|
|
|
318
339
|
end
|
319
340
|
```
|
320
341
|
|
321
|
-
Voir la [doc](UiBibz/Ui/Core/ProgressBar.html)
|
342
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/ProgressBar.html)
|
322
343
|
|
323
344
|
### Glyph
|
324
345
|
|
325
|
-
![glyph](images/glyph.png)
|
346
|
+
![glyph](http://hummel.link/Ui-Bibz/images/glyph.png)
|
326
347
|
|
327
348
|
Les glyphs utilisés proviennent de [Font Awesome](http://fontawesome.io/).
|
328
349
|
L'élément ```glyph``` peut contenir un hash pour ```content```
|
@@ -337,15 +358,37 @@ glyph 'star', { size: 3, type: 'fw' }, class: 'star-exemple'
|
|
337
358
|
glyph { name: 'star', size: 3, type: 'fw' }
|
338
359
|
```
|
339
360
|
|
340
|
-
Voir la [doc](UiBibz/Ui/Core/Glyph.html)
|
361
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/Glyph.html)
|
362
|
+
|
363
|
+
### Stars
|
364
|
+
|
365
|
+
![stars](http://hummel.link/Ui-Bibz/images/stars.png)
|
366
|
+
|
367
|
+
L'élément ```stars``` à pour ```options``` un Hash acceptant les clefs :
|
368
|
+
|
369
|
+
* num - Correspond au nombre d'étoiles affichées (default: 5)
|
370
|
+
* [state](#state-values)
|
371
|
+
|
372
|
+
```ruby
|
373
|
+
stars 3.2
|
374
|
+
|
375
|
+
stars 7, { num: 10, state: :danger }
|
376
|
+
|
377
|
+
stars num: 3 do
|
378
|
+
1
|
379
|
+
end
|
380
|
+
```
|
381
|
+
|
382
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/Stars.html)
|
383
|
+
|
341
384
|
|
342
385
|
### Panel
|
343
386
|
|
344
|
-
![panel](images/panel.png)
|
387
|
+
![panel](http://hummel.link/Ui-Bibz/images/panel.png)
|
345
388
|
|
346
389
|
L'élément ```panel``` à pour ```options``` un Hash acceptant les clefs :
|
347
390
|
|
348
|
-
* [state](#state)
|
391
|
+
* [state](#state-values)
|
349
392
|
* tap (true) : permet de créer un header, body et footer
|
350
393
|
|
351
394
|
Les éléments ```header```, ```body```,```footer``` sont des éléments [component](#component).
|
@@ -359,7 +402,7 @@ panel(state: :danger) do
|
|
359
402
|
'Content'
|
360
403
|
end
|
361
404
|
|
362
|
-
panel({ tap: true, state: :danger }, { class: 'exemple' }) |p|
|
405
|
+
panel({ tap: true, state: :danger, table_options: { actionable: true } }, { class: 'exemple' }) |p|
|
363
406
|
p.header 'Header', glyph: 'eye'
|
364
407
|
p.body(class: 'my-body') do
|
365
408
|
'Content body'
|
@@ -368,11 +411,11 @@ panel({ tap: true, state: :danger }, { class: 'exemple' }) |p|
|
|
368
411
|
end
|
369
412
|
```
|
370
413
|
|
371
|
-
Voir la [doc](UiBibz/Ui/Core/Panel.html)
|
414
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/Panel.html)
|
372
415
|
|
373
416
|
### Table
|
374
417
|
|
375
|
-
![table](images/table.png)
|
418
|
+
![table](http://hummel.link/Ui-Bibz/images/table.png)
|
376
419
|
|
377
420
|
L'élément ```table``` est un tableau composé d'une recherche, une pagination et un trie de colonnes intégrées.
|
378
421
|
Le tableau est compatible [I18n](http://guides.rubyonrails.org/i18n.html).
|
@@ -408,7 +451,7 @@ searchable_attributes :name_fr, :name_en
|
|
408
451
|
|
409
452
|
Un champ recherche est disponible dans la vue :
|
410
453
|
|
411
|
-
![table_search_field](images/table_search_field.png)
|
454
|
+
![table_search_field](http://hummel.link/Ui-Bibz/images/table_search_field.png)
|
412
455
|
|
413
456
|
```
|
414
457
|
table_search_field store: @documents
|
@@ -422,7 +465,7 @@ table_pagination store: @documents
|
|
422
465
|
|
423
466
|
Un champs select par page est disponible dans la vue :
|
424
467
|
|
425
|
-
![table_search_field](images/table_pagination_per_page.png)
|
468
|
+
![table_search_field](http://hummel.link/Ui-Bibz/images/table_pagination_per_page.png)
|
426
469
|
|
427
470
|
```
|
428
471
|
table_pagination_per_page store: @documents
|
@@ -510,11 +553,11 @@ L'ajout de colonnes à travers la méthode ```column``` contient plusieurs argum
|
|
510
553
|
# app/views/documents/index.html.haml
|
511
554
|
table store: @documents do |g|
|
512
555
|
g.columns do |c|
|
513
|
-
c.column
|
514
|
-
c.column
|
515
|
-
c.column
|
516
|
-
c.column
|
517
|
-
c.column
|
556
|
+
c.column :id, { name: '#' }
|
557
|
+
c.column :name_fr, { name: 'Name fr', link: edit_document_path(:id) }
|
558
|
+
c.column :name_en
|
559
|
+
c.column :hotline_access, { name: 'Hotline', format: lambda{ |records, record| glyph(record.icon) } }
|
560
|
+
c.column :update_at, { date_format: '%Y' }
|
518
561
|
end
|
519
562
|
end
|
520
563
|
```
|
@@ -541,7 +584,7 @@ l'appeler comme valeur pour la clef ```data_index```.
|
|
541
584
|
# app/views/documents/index.html.haml
|
542
585
|
table store: @documents do |g|
|
543
586
|
g.columns do |c|
|
544
|
-
c.column
|
587
|
+
c.column :user_name, { name: 'User', sort: "user.name" }
|
545
588
|
end
|
546
589
|
end
|
547
590
|
```
|
@@ -589,11 +632,59 @@ Dans la vue :
|
|
589
632
|
# app/views/documents/index.html.haml
|
590
633
|
table store: @documents do |g|
|
591
634
|
g.columns do |c|
|
592
|
-
c.column
|
635
|
+
c.column :users, { name: 'Users count', count: true, custom_sort: true }
|
636
|
+
end
|
637
|
+
end
|
638
|
+
```
|
639
|
+
|
640
|
+
#### table actions
|
641
|
+
|
642
|
+
Les actions d'une table peuvent être formatées avec le 'record' passé en paramètre.
|
643
|
+
|
644
|
+
```
|
645
|
+
# app/views/documents/index.html.haml
|
646
|
+
table store: @documents do |t|
|
647
|
+
t.columns do |cls|
|
648
|
+
cls.column :id, { name: '#' }
|
649
|
+
cls.column :name_en
|
650
|
+
end
|
651
|
+
t.actions do |acs|
|
652
|
+
acs.format do |record|
|
653
|
+
if record.active?
|
654
|
+
acs.action 'Active', { url: active_document_path(record.id) }
|
655
|
+
else
|
656
|
+
acs.action 'Disabled', { url: disabled_document_path(record.id) }
|
657
|
+
end
|
658
|
+
acs.action 'Show', { url: document_path(record.id) }
|
659
|
+
end
|
593
660
|
end
|
594
661
|
end
|
595
662
|
```
|
596
663
|
|
664
|
+
Les actions ainsi que la colonne action peuvent être désactivées en passant l'agument ```actionable:
|
665
|
+
false```.
|
666
|
+
|
667
|
+
```
|
668
|
+
# app/views/documents/index.html.haml
|
669
|
+
table store: @documents, actionable: false
|
670
|
+
```
|
671
|
+
|
672
|
+
#### Plus d'une table sur une page html
|
673
|
+
|
674
|
+
Si vous avez plus d'une table sur votre page html et que vous souhaitez faire
|
675
|
+
des recherches, paginer... Vous devez identifier chaque store pour que l'action
|
676
|
+
effectuée (recherche, pagination,...) ne soit affectée que sur la table désirée.
|
677
|
+
|
678
|
+
Pour cela il faut que vous donniez un identifiant unique à vos stores.
|
679
|
+
|
680
|
+
ex:
|
681
|
+
|
682
|
+
```
|
683
|
+
# app/controllers/document_controller.rb
|
684
|
+
@documents = Document.includes(:users).table_search_pagination(params, session, { store_id: 'store-1'})
|
685
|
+
```
|
686
|
+
|
687
|
+
|
597
688
|
#### table I18n
|
598
689
|
|
599
690
|
La table est utilisable avec I18n. Les traductions
|
@@ -620,11 +711,11 @@ activerecord:
|
|
620
711
|
...
|
621
712
|
```
|
622
713
|
|
623
|
-
Voir la [doc](UiBibz/Ui/Ux/Table.html)
|
714
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Ux/Table.html)
|
624
715
|
|
625
716
|
### Table Panel
|
626
717
|
|
627
|
-
![table_panel](images/table_panel.png)
|
718
|
+
![table_panel](http://hummel.link/Ui-Bibz/images/table_panel.png)
|
628
719
|
|
629
720
|
Le composant ```table_panel``` est un [tableau](#table) dans un [panel](#panel).
|
630
721
|
|
@@ -633,13 +724,13 @@ table_panel store: @users
|
|
633
724
|
|
634
725
|
table_panel({ store: @users, tap: true, glyph: 'home', state: :danger }) do |g|
|
635
726
|
g.columns do |cls|
|
636
|
-
cls.column
|
637
|
-
cls.column
|
638
|
-
cls.column
|
639
|
-
cls.column(
|
727
|
+
cls.column :id, { name: '#' }
|
728
|
+
cls.column :username, { name: 'Username', link: edit_user_path(:id) }
|
729
|
+
cls.column :name
|
730
|
+
cls.column(:email) do
|
640
731
|
'Email'
|
641
732
|
end
|
642
|
-
cls.column
|
733
|
+
cls.column :role_name, { name: 'Role', sort: 'roles.name' }
|
643
734
|
end
|
644
735
|
g.actions do |acs|
|
645
736
|
acs.action 'Action 1', { url: edit_user_path(:id), glyph: 'pencil' }
|
@@ -651,11 +742,11 @@ table_panel({ store: @users, tap: true, glyph: 'home', state: :danger }) do |g|
|
|
651
742
|
end
|
652
743
|
```
|
653
744
|
|
654
|
-
Voir la [doc](UiBibz/Ui/Ux/TablePanel.html)
|
745
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Ux/TablePanel.html)
|
655
746
|
|
656
747
|
### List
|
657
748
|
|
658
|
-
![list](images/list.png)
|
749
|
+
![list](http://hummel.link/Ui-Bibz/images/list.png)
|
659
750
|
|
660
751
|
Par défaut une liste à pour tag ```<li>```.
|
661
752
|
Mais elle peut se transformer en lien ```<a>``` à travers l'option ```type:```.
|
@@ -676,11 +767,11 @@ list_group do |lg|
|
|
676
767
|
end
|
677
768
|
```
|
678
769
|
|
679
|
-
Voir la [doc](UiBibz/Ui/Core/List.html)
|
770
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/List.html)
|
680
771
|
|
681
772
|
### Nav
|
682
773
|
|
683
|
-
![nav](images/nav.png)
|
774
|
+
![nav](http://hummel.link/Ui-Bibz/images/nav.png)
|
684
775
|
|
685
776
|
Par défaut la navigation comporte des onglets "tab".
|
686
777
|
L'élément ```nav``` accepte en option les arguments :
|
@@ -700,11 +791,11 @@ nav(type: :pills, position: :justified) do |d|
|
|
700
791
|
end
|
701
792
|
```
|
702
793
|
|
703
|
-
Voir la [doc](UiBibz/Ui/Core/Nav.html)
|
794
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/Nav.html)
|
704
795
|
|
705
|
-
|
796
|
+
### Navbar
|
706
797
|
|
707
|
-
![navbar](images/navbar.png)
|
798
|
+
![navbar](http://hummel.link/Ui-Bibz/images/navbar.png)
|
708
799
|
|
709
800
|
Par défaut la navigation comporte des onglets "tab".
|
710
801
|
L'élément ```navbar``` accepte en option les arguments :
|
@@ -714,8 +805,12 @@ L'élément ```navbar``` accepte en option les arguments :
|
|
714
805
|
* position (:top, :bottom)
|
715
806
|
* title (string)
|
716
807
|
|
717
|
-
L'élement
|
718
|
-
|
808
|
+
L'élement nav est un [component](#component) et contient les composants :
|
809
|
+
|
810
|
+
* form
|
811
|
+
* dropdown
|
812
|
+
* text
|
813
|
+
* link
|
719
814
|
|
720
815
|
```
|
721
816
|
navbar(type: :inverse, position: :top) do |nb|
|
@@ -731,12 +826,12 @@ navbar(type: :inverse, position: :top) do |nb|
|
|
731
826
|
end
|
732
827
|
```
|
733
828
|
|
734
|
-
Voir la [doc](UiBibz/Ui/Core/Navbar.html)
|
829
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/Navbar.html)
|
735
830
|
|
736
831
|
|
737
832
|
### Etiquette
|
738
833
|
|
739
|
-
![list](images/etiquette.png)
|
834
|
+
![list](http://hummel.link/Ui-Bibz/images/etiquette.png)
|
740
835
|
|
741
836
|
|
742
837
|
NB : Les méthodes ```Tag, label``` sont déjà utilisées par Rails.
|
@@ -753,7 +848,7 @@ etiquette 'label 2', state: :success
|
|
753
848
|
etiquette 'label 2', state: :danger
|
754
849
|
```
|
755
850
|
|
756
|
-
Voir la [doc](UiBibz/Ui/Core/Etiquette.html)
|
851
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/Etiquette.html)
|
757
852
|
|
758
853
|
### Row
|
759
854
|
|
@@ -766,7 +861,7 @@ end
|
|
766
861
|
# => <div class='row toto'>content</div>
|
767
862
|
```
|
768
863
|
|
769
|
-
Voir la [doc](UiBibz/Ui/Core/Content.html)
|
864
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/Content.html)
|
770
865
|
|
771
866
|
### Col
|
772
867
|
|
@@ -797,7 +892,7 @@ end
|
|
797
892
|
# => <div class='col-xs-offset-1 col-md-3 test'>content</div>
|
798
893
|
```
|
799
894
|
|
800
|
-
Voir la [doc](UiBibz/Ui/Core/Col.html)
|
895
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Core/Col.html)
|
801
896
|
|
802
897
|
### Grid
|
803
898
|
|
@@ -863,20 +958,20 @@ grid do |g|
|
|
863
958
|
end
|
864
959
|
```
|
865
960
|
|
866
|
-
Voir la [doc](UiBibz/Ui/Ux/Grid.html)
|
961
|
+
Voir la [doc](http://hummel.link/Ui-Bibz/UiBibz/Ui/Ux/Grid.html)
|
867
962
|
|
868
963
|
### Arguments and Values
|
869
964
|
|
870
|
-
####
|
965
|
+
#### status-values
|
871
966
|
* :active
|
872
967
|
* :disable
|
873
968
|
|
874
|
-
####
|
969
|
+
#### size-values
|
875
970
|
* :xs
|
876
971
|
* :sm
|
877
972
|
* :lg
|
878
973
|
|
879
|
-
####
|
974
|
+
#### state-values
|
880
975
|
* :default
|
881
976
|
* :primary
|
882
977
|
* :info
|
@@ -884,7 +979,7 @@ Voir la [doc](UiBibz/Ui/Ux/Grid.html)
|
|
884
979
|
* :warning
|
885
980
|
* :danger
|
886
981
|
|
887
|
-
####
|
982
|
+
#### glyph-arguments
|
888
983
|
* name
|
889
984
|
* size
|
890
985
|
* type
|
@@ -32,7 +32,7 @@
|
|
32
32
|
<div id="menu">
|
33
33
|
|
34
34
|
<a href="../../../../_index.html">Index (C)</a> »
|
35
|
-
<span class='title'><span class='object_link'><a href="../../../../UiBibz.html" title="UiBibz (module)">UiBibz</a></span></span> » <span class='title'>Concerns</span> » <span class='title'>Models</span> » <span class='title'><span class='object_link'><a href="../Searchable.html" title="UiBibz::Concerns::Models::Searchable (module)">Searchable</a></span></span>
|
35
|
+
<span class='title'><span class='object_link'><a href="../../../../UiBibz.html" title="UiBibz (module)">UiBibz</a></span></span> » <span class='title'><span class='object_link'><a href="../../../Concerns.html" title="UiBibz::Concerns (module)">Concerns</a></span></span> » <span class='title'><span class='object_link'><a href="../../Models.html" title="UiBibz::Concerns::Models (module)">Models</a></span></span> » <span class='title'><span class='object_link'><a href="../Searchable.html" title="UiBibz::Concerns::Models::Searchable (module)">Searchable</a></span></span>
|
36
36
|
»
|
37
37
|
<span class="title">ClassMethods</span>
|
38
38
|
|
@@ -145,12 +145,12 @@
|
|
145
145
|
<pre class="lines">
|
146
146
|
|
147
147
|
|
148
|
-
|
149
|
-
|
150
|
-
|
148
|
+
111
|
149
|
+
112
|
150
|
+
113</pre>
|
151
151
|
</td>
|
152
152
|
<td>
|
153
|
-
<pre class="code"><span class="info file"># File 'lib/ui_bibz/concerns/models/searchable.rb', line
|
153
|
+
<pre class="code"><span class="info file"># File 'lib/ui_bibz/concerns/models/searchable.rb', line 111</span>
|
154
154
|
|
155
155
|
<span class='kw'>def</span> <span class='id identifier rubyid_searchable_attributes'>searchable_attributes</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span>
|
156
156
|
<span class='ivar'>@searchable_attributes</span> <span class='op'>||=</span> <span class='id identifier rubyid_args'>args</span>
|
@@ -165,7 +165,7 @@
|
|
165
165
|
</div>
|
166
166
|
|
167
167
|
<div id="footer">
|
168
|
-
Generated on
|
168
|
+
Generated on Mon Aug 31 14:08:52 2015 by
|
169
169
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
170
170
|
0.8.7.6 (ruby-1.9.3).
|
171
171
|
</div>
|
@@ -32,7 +32,7 @@
|
|
32
32
|
<div id="menu">
|
33
33
|
|
34
34
|
<a href="../../../_index.html">Index (S)</a> »
|
35
|
-
<span class='title'><span class='object_link'><a href="../../../UiBibz.html" title="UiBibz (module)">UiBibz</a></span></span> » <span class='title'>Concerns</span> » <span class='title'>Models</span>
|
35
|
+
<span class='title'><span class='object_link'><a href="../../../UiBibz.html" title="UiBibz (module)">UiBibz</a></span></span> » <span class='title'><span class='object_link'><a href="../../Concerns.html" title="UiBibz::Concerns (module)">Concerns</a></span></span> » <span class='title'><span class='object_link'><a href="../Models.html" title="UiBibz::Concerns::Models (module)">Models</a></span></span>
|
36
36
|
»
|
37
37
|
<span class="title">Searchable</span>
|
38
38
|
|
@@ -111,7 +111,7 @@
|
|
111
111
|
</div>
|
112
112
|
|
113
113
|
<div id="footer">
|
114
|
-
Generated on
|
114
|
+
Generated on Mon Aug 31 14:08:52 2015 by
|
115
115
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
116
116
|
0.8.7.6 (ruby-1.9.3).
|
117
117
|
</div>
|
@@ -0,0 +1,115 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: UiBibz::Concerns::Models
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!UiBibz/Concerns/Models.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (M)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../UiBibz.html" title="UiBibz (module)">UiBibz</a></span></span> » <span class='title'><span class='object_link'><a href="../Concerns.html" title="UiBibz::Concerns (module)">Concerns</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Models</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: UiBibz::Concerns::Models
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
82
|
+
<dd class="r1 last">lib/ui_bibz.rb</dd>
|
83
|
+
|
84
|
+
</dl>
|
85
|
+
<div class="clear"></div>
|
86
|
+
|
87
|
+
<h2>Defined Under Namespace</h2>
|
88
|
+
<p class="children">
|
89
|
+
|
90
|
+
|
91
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Models/Searchable.html" title="UiBibz::Concerns::Models::Searchable (module)">Searchable</a></span>
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
</p>
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
</div>
|
107
|
+
|
108
|
+
<div id="footer">
|
109
|
+
Generated on Mon Aug 31 14:08:52 2015 by
|
110
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
111
|
+
0.8.7.6 (ruby-1.9.3).
|
112
|
+
</div>
|
113
|
+
|
114
|
+
</body>
|
115
|
+
</html>
|