ui_bibz 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +13 -5
  2. data/.gitignore +1 -1
  3. data/.yardoc/checksums +52 -0
  4. data/.yardoc/object_types +0 -0
  5. data/.yardoc/objects/root.dat +0 -0
  6. data/.yardoc/proxy_types +0 -0
  7. data/Gemfile +1 -1
  8. data/Gemfile.lock +11 -21
  9. data/README.md +359 -239
  10. data/Rakefile +12 -13
  11. data/doc/UiBibz/Concerns/Models/Searchable/ClassMethods.html +174 -0
  12. data/doc/UiBibz/Concerns/Models/Searchable.html +120 -0
  13. data/doc/UiBibz/Helpers/MetaHelper.html +218 -0
  14. data/doc/UiBibz/Helpers/UiCoreHelper.html +1130 -0
  15. data/doc/UiBibz/Helpers/UiUxHelper.html +463 -0
  16. data/doc/UiBibz/Helpers/UtilsHelper.html +187 -0
  17. data/doc/UiBibz/Rails/Engine.html +123 -0
  18. data/doc/UiBibz/Rails.html +115 -0
  19. data/doc/UiBibz/Ui/Base.html +304 -0
  20. data/doc/UiBibz/Ui/Core/Alert.html +367 -0
  21. data/doc/UiBibz/Ui/Core/Bar.html +356 -0
  22. data/doc/UiBibz/Ui/Core/Breadcrumb.html +427 -0
  23. data/doc/UiBibz/Ui/Core/BreadcrumbLink.html +354 -0
  24. data/doc/UiBibz/Ui/Core/Button.html +363 -0
  25. data/doc/UiBibz/Ui/Core/ButtonDropdown.html +385 -0
  26. data/doc/UiBibz/Ui/Core/ButtonGroup.html +356 -0
  27. data/doc/UiBibz/Ui/Core/ButtonLink.html +365 -0
  28. data/doc/UiBibz/Ui/Core/ButtonSplitDropdown.html +387 -0
  29. data/doc/UiBibz/Ui/Core/Col.html +357 -0
  30. data/doc/UiBibz/Ui/Core/Component.html +1144 -0
  31. data/doc/UiBibz/Ui/Core/Dropdown.html +877 -0
  32. data/doc/UiBibz/Ui/Core/DropdownList.html +369 -0
  33. data/doc/UiBibz/Ui/Core/Glyph.html +742 -0
  34. data/doc/UiBibz/Ui/Core/Jumbotron.html +363 -0
  35. data/doc/UiBibz/Ui/Core/Label.html +361 -0
  36. data/doc/UiBibz/Ui/Core/List.html +486 -0
  37. data/doc/UiBibz/Ui/Core/ListGroup.html +446 -0
  38. data/doc/UiBibz/Ui/Core/Nav.html +474 -0
  39. data/doc/UiBibz/Ui/Core/NavDropdown.html +376 -0
  40. data/doc/UiBibz/Ui/Core/NavLink.html +347 -0
  41. data/doc/UiBibz/Ui/Core/Navbar.html +535 -0
  42. data/doc/UiBibz/Ui/Core/NavbarForm.html +341 -0
  43. data/doc/UiBibz/Ui/Core/NavbarNav.html +301 -0
  44. data/doc/UiBibz/Ui/Core/NavbarText.html +341 -0
  45. data/doc/UiBibz/Ui/Core/Panel.html +806 -0
  46. data/doc/UiBibz/Ui/Core/ProgressBar.html +433 -0
  47. data/doc/UiBibz/Ui/Core/Row.html +335 -0
  48. data/doc/UiBibz/Ui/Core.html +117 -0
  49. data/doc/UiBibz/Ui/Ux/Actionable.html +478 -0
  50. data/doc/UiBibz/Ui/Ux/Actions.html +314 -0
  51. data/doc/UiBibz/Ui/Ux/Column.html +1177 -0
  52. data/doc/UiBibz/Ui/Ux/Columns.html +312 -0
  53. data/doc/UiBibz/Ui/Ux/Grid.html +823 -0
  54. data/doc/UiBibz/Ui/Ux/Paginable.html +368 -0
  55. data/doc/UiBibz/Ui/Ux/Searchable.html +363 -0
  56. data/doc/UiBibz/Ui/Ux/Sortable.html +289 -0
  57. data/doc/UiBibz/Ui/Ux/Store.html +968 -0
  58. data/doc/UiBibz/Ui/Ux/Table.html +957 -0
  59. data/doc/UiBibz/Ui/Ux/TableAction.html +309 -0
  60. data/doc/UiBibz/Ui/Ux/TablePagination.html +319 -0
  61. data/doc/UiBibz/Ui/Ux/TablePaginationPerPage.html +331 -0
  62. data/doc/UiBibz/Ui/Ux/TablePanel.html +576 -0
  63. data/doc/UiBibz/Ui/Ux/TableSearchField.html +291 -0
  64. data/doc/UiBibz/Ui/Ux.html +117 -0
  65. data/doc/UiBibz/Ui.html +117 -0
  66. data/doc/UiBibz/Utils/Internationalization.html +262 -0
  67. data/doc/UiBibz/Utils.html +115 -0
  68. data/doc/UiBibz.html +129 -0
  69. data/doc/_index.html +635 -0
  70. data/doc/class_list.html +58 -0
  71. data/doc/css/common.css +1 -0
  72. data/doc/css/full_list.css +57 -0
  73. data/doc/css/style.css +339 -0
  74. data/doc/file.README.html +1022 -0
  75. data/doc/file_list.html +60 -0
  76. data/doc/frames.html +26 -0
  77. data/doc/images/navbar.png +0 -0
  78. data/doc/index.html +1022 -0
  79. data/doc/js/app.js +219 -0
  80. data/doc/js/full_list.js +181 -0
  81. data/doc/js/jquery.js +4 -0
  82. data/doc/method_list.html +1335 -0
  83. data/doc/top-level-namespace.html +112 -0
  84. data/lib/ui_bibz/helpers/ui_core_helper.rb +94 -0
  85. data/lib/ui_bibz/helpers/ui_ux_helper.rb +43 -0
  86. data/lib/ui_bibz/rails/engine.rb +2 -1
  87. data/lib/ui_bibz/ui/{ui.rb → base.rb} +1 -1
  88. data/lib/ui_bibz/ui/{alert.rb → core/alert.rb} +15 -7
  89. data/lib/ui_bibz/ui/core/breadcrumb/breadcrumb.rb +71 -0
  90. data/lib/ui_bibz/ui/{breadcrumb → core/breadcrumb}/components/breadcrumb_link.rb +6 -6
  91. data/lib/ui_bibz/ui/{button → core/button}/button.rb +13 -6
  92. data/lib/ui_bibz/ui/{button → core/button}/button_dropdown.rb +15 -4
  93. data/lib/ui_bibz/ui/{button → core/button}/button_group.rb +14 -6
  94. data/lib/ui_bibz/ui/{button → core/button}/button_link.rb +14 -6
  95. data/lib/ui_bibz/ui/{button → core/button}/button_split_dropdown.rb +15 -4
  96. data/lib/ui_bibz/ui/{grid/components → core}/col.rb +12 -6
  97. data/lib/ui_bibz/ui/{component.rb → core/component.rb} +7 -7
  98. data/lib/ui_bibz/ui/{dropdown → core/dropdown}/components/dropdown_list.rb +7 -7
  99. data/lib/ui_bibz/ui/{dropdown → core/dropdown}/dropdown.rb +18 -7
  100. data/lib/ui_bibz/ui/{glyph.rb → core/glyph.rb} +18 -10
  101. data/lib/ui_bibz/ui/{jumbotron.rb → core/jumbotron.rb} +14 -6
  102. data/lib/ui_bibz/ui/{label.rb → core/label.rb} +14 -6
  103. data/lib/ui_bibz/ui/{list → core/list}/components/list.rb +8 -8
  104. data/lib/ui_bibz/ui/{list → core/list}/list_group.rb +28 -6
  105. data/lib/ui_bibz/ui/core/nav/components/nav_dropdown.rb +64 -0
  106. data/lib/ui_bibz/ui/{nav → core/nav}/components/nav_link.rb +6 -6
  107. data/lib/ui_bibz/ui/core/nav/components/navbar_form.rb +45 -0
  108. data/lib/ui_bibz/ui/core/nav/components/navbar_nav.rb +56 -0
  109. data/lib/ui_bibz/ui/core/nav/components/navbar_text.rb +45 -0
  110. data/lib/ui_bibz/ui/core/nav/nav.rb +90 -0
  111. data/lib/ui_bibz/ui/core/nav/navbar.rb +121 -0
  112. data/lib/ui_bibz/ui/{panel.rb → core/panel.rb} +36 -8
  113. data/lib/ui_bibz/ui/{progress_bar → core/progress_bar}/components/bar.rb +7 -7
  114. data/lib/ui_bibz/ui/{progress_bar → core/progress_bar}/progress_bar.rb +20 -9
  115. data/lib/ui_bibz/ui/{grid/components → core}/row.rb +12 -4
  116. data/lib/ui_bibz/ui/{grid → ux}/grid.rb +17 -8
  117. data/lib/ui_bibz/ui/{table → ux/table}/components/actions.rb +5 -5
  118. data/lib/ui_bibz/ui/ux/table/components/column.rb +34 -0
  119. data/lib/ui_bibz/ui/ux/table/components/columns.rb +16 -0
  120. data/lib/ui_bibz/ui/{table → ux/table}/components/store.rb +4 -4
  121. data/lib/ui_bibz/ui/{table → ux/table}/components/table_action.rb +2 -2
  122. data/lib/ui_bibz/ui/{table/ux → ux/table/extensions}/actionable.rb +3 -3
  123. data/lib/ui_bibz/ui/{table/ux → ux/table/extensions}/paginable.rb +5 -5
  124. data/lib/ui_bibz/ui/{table/ux → ux/table/extensions}/searchable.rb +4 -4
  125. data/lib/ui_bibz/ui/{table/ux → ux/table/extensions}/sortable.rb +3 -3
  126. data/lib/ui_bibz/ui/{table → ux/table}/table.rb +40 -22
  127. data/lib/ui_bibz/ui/ux/table/table_pagination.rb +51 -0
  128. data/lib/ui_bibz/ui/{table → ux/table}/table_pagination_per_page.rb +26 -4
  129. data/lib/ui_bibz/ui/ux/table/table_panel.rb +155 -0
  130. data/lib/ui_bibz/ui/{table → ux/table}/table_search_field.rb +7 -7
  131. data/lib/ui_bibz/version.rb +1 -1
  132. data/lib/ui_bibz.rb +40 -29
  133. data/test/store_test.rb +2 -2
  134. data/test/ui/button_test.rb +6 -6
  135. data/test/ui/component_test.rb +2 -2
  136. data/test/ui/dropdown_test.rb +1 -1
  137. data/test/ui/glyph_test.rb +3 -3
  138. data/test/ui/grid_test.rb +4 -4
  139. data/test/ui/list_group_test.rb +2 -2
  140. data/test/ui/nav_test.rb +3 -4
  141. data/test/ui/panel_test.rb +4 -4
  142. data/test/ui/table_test.rb +32 -32
  143. data/test/ui_helper_test.rb +18 -2
  144. data/ui_bibz.gemspec +1 -0
  145. data/vendor/assets/stylesheets/ui_bibz.sass +3 -0
  146. metadata +166 -132
  147. data/README.rdoc +0 -0
  148. data/lib/ui_bibz/helpers/ui_helper.rb +0 -119
  149. data/lib/ui_bibz/ui/breadcrumb/breadcrumb.rb +0 -54
  150. data/lib/ui_bibz/ui/nav/nav.rb +0 -65
  151. data/lib/ui_bibz/ui/table/components/column.rb +0 -34
  152. data/lib/ui_bibz/ui/table/components/columns.rb +0 -16
  153. data/lib/ui_bibz/ui/table/table_pagination.rb +0 -29
  154. data/lib/ui_bibz/ui/table/table_panel.rb +0 -66
@@ -1,65 +0,0 @@
1
- require 'ui_bibz/ui/nav/components/nav_link'
2
- module UiBibz::Ui
3
-
4
- # Create a nav
5
- #
6
- # This element is an extend of UiBibz::Ui::Component.
7
- #
8
- # ==== Attributes
9
- #
10
- # * +content+ - Content of element
11
- # * +options+ - Options of element
12
- # * +html_options+ - Html Options of element
13
- #
14
- # ==== Options
15
- #
16
- # You can add HTML attributes using the +html_options+.
17
- # You can pass arguments in options attribute:
18
- # * +type+ - Symbol
19
- # (+:pills+, +:tab+)
20
- #
21
- # ==== Signatures
22
- #
23
- # UiBibz::Ui::Button.new(content, options = nil, html_options = nil)
24
- #
25
- # UiBibz::Ui::Button.new(options = nil, html_options = nil).tap do |d|
26
- # ...
27
- # d. content = nil, options = nil, html_options = nil, block
28
- # ...
29
- # end
30
- #
31
- # ==== Examples
32
- #
33
- # UiBibz::Ui::Nav.new(type: :pills).tap do |d|
34
- # d.link 'Test', url: '#test'
35
- # d.link 'Test2', url: '#test2', status: :active
36
- # end.render
37
- #
38
- class Nav < Component
39
-
40
- def initialize content = nil, options = nil, html_options = nil, &block
41
- super
42
- @links = []
43
- end
44
-
45
- def render
46
- content_tag :ul, @links.join().html_safe, class_and_html_options(["nav", "nav-#{ type }", position])
47
- end
48
-
49
- def link content = nil, options = {}, html_options = nil, &block
50
- @links << NavLink.new(content, options.merge({ nav_type: type }), html_options, &block).render
51
- end
52
-
53
- private
54
-
55
- # tabs or pills
56
- def type
57
- @options[:type] || :tabs
58
- end
59
-
60
- def position
61
- "nav-#{ @options[:position] }" unless @options[:position].nil?
62
- end
63
-
64
- end
65
- end
@@ -1,34 +0,0 @@
1
- module UiBibz::Ui
2
- class Column
3
-
4
- attr_accessor :hidden, :link, :name, :data_index, :date_format, :sort, :format, :date_format, :count, :custom_sort, :parent
5
-
6
- def initialize args
7
- @args = args
8
- @link = args[:link] # show or edit
9
- @name = args[:name]
10
- @order = args[:order]
11
- @data_index = args[:data_index]
12
- @date_format = args[:date_format]
13
- @sort = args[:sort]
14
- @custom_sort = args[:custom_sort]
15
- @parent = args[:parent]
16
- @count = args[:count]
17
- @format = args[:format]
18
- @hidden = args[:hidden]
19
- end
20
-
21
- def linkable?
22
- !@link.nil?
23
- end
24
-
25
- def order
26
- @order || 0
27
- end
28
-
29
- def hidden?
30
- @hidden == true
31
- end
32
-
33
- end
34
- end
@@ -1,16 +0,0 @@
1
- module UiBibz::Ui
2
- class Columns
3
-
4
- def initialize columns = nil
5
- @columns = columns || []
6
- end
7
-
8
- def column hash
9
- @columns << Column.new(hash)
10
- end
11
-
12
- def list
13
- @columns
14
- end
15
- end
16
- end
@@ -1,29 +0,0 @@
1
- require 'will_paginate'
2
- require "will_paginate-bootstrap"
3
- require "ui_bibz/ui/table/components/store"
4
- module UiBibz::Ui
5
- class TablePagination < Ui
6
- include WillPaginate::ActionView
7
-
8
- def initialize options = nil, html_options = nil
9
- @pagination = Component.new nil, options, html_options
10
- end
11
-
12
- def render
13
- will_paginate(store.records, params: { controller: store.controller }, renderer: BootstrapPagination::Rails)
14
- end
15
-
16
- private
17
-
18
- def store
19
- @store ||= if @pagination.options[:store].nil?
20
- raise 'Store is nil!'
21
- elsif @pagination.options[:store].try(:records).nil?
22
- raise 'Store can be created only with "table_search_pagination" method!'
23
- else
24
- Store.new @pagination.options.delete :store
25
- end
26
- end
27
-
28
- end
29
- end
@@ -1,66 +0,0 @@
1
- module UiBibz::Ui
2
- class TablePanel < Panel
3
-
4
- attr_accessor :columns
5
-
6
- def initialize content = nil, options = nil, html_options = nil, &block
7
- super
8
- @store = @options.delete(:store) if @options[:store]
9
- table_options = (@options[:table_options] || {}).merge({ store: @store })
10
- @table = UiBibz::Ui::Table.new(table_options, @options[:table_html_options])
11
- end
12
-
13
- def render
14
- initialize_header
15
- initialize_footer
16
-
17
- content_tag :div, class_and_html_options(panel_classes) do |f|
18
- form_tag(url_for(controller: @store.controller, action: @store.action), method: :get) do
19
- concat(header_html) unless @header.nil?
20
- concat(body_html) unless @body.nil?
21
- concat(table_html) unless @store.nil?
22
- concat(footer_html) unless @footer.nil?
23
- end
24
- end
25
- end
26
-
27
- def columns &block
28
- @table.columns &block
29
- end
30
-
31
- def actions &block
32
- @table.actions &block
33
- end
34
-
35
- private
36
-
37
- def table_html
38
- content_tag :div, @table.render, class: 'panel-table'
39
- end
40
-
41
- def panel_classes
42
- %w(panel panel-default table-panel)
43
- end
44
-
45
- def search
46
- @search ||= Searchable.new @store, @options
47
- end
48
-
49
- def pagination
50
- @pagination ||= Paginable.new @store, @options
51
- end
52
-
53
- def initialize_footer
54
- @footer = @table.pagination
55
- end
56
-
57
- def initialize_header
58
- @header = Component.new search.render
59
- end
60
-
61
- def initialize_footer
62
- @footer = Component.new(pagination.render) if pagination.paginable?
63
- end
64
-
65
- end
66
- end