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.
- checksums.yaml +13 -5
- data/.gitignore +1 -1
- data/.yardoc/checksums +52 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +11 -21
- data/README.md +359 -239
- data/Rakefile +12 -13
- data/doc/UiBibz/Concerns/Models/Searchable/ClassMethods.html +174 -0
- data/doc/UiBibz/Concerns/Models/Searchable.html +120 -0
- data/doc/UiBibz/Helpers/MetaHelper.html +218 -0
- data/doc/UiBibz/Helpers/UiCoreHelper.html +1130 -0
- data/doc/UiBibz/Helpers/UiUxHelper.html +463 -0
- data/doc/UiBibz/Helpers/UtilsHelper.html +187 -0
- data/doc/UiBibz/Rails/Engine.html +123 -0
- data/doc/UiBibz/Rails.html +115 -0
- data/doc/UiBibz/Ui/Base.html +304 -0
- data/doc/UiBibz/Ui/Core/Alert.html +367 -0
- data/doc/UiBibz/Ui/Core/Bar.html +356 -0
- data/doc/UiBibz/Ui/Core/Breadcrumb.html +427 -0
- data/doc/UiBibz/Ui/Core/BreadcrumbLink.html +354 -0
- data/doc/UiBibz/Ui/Core/Button.html +363 -0
- data/doc/UiBibz/Ui/Core/ButtonDropdown.html +385 -0
- data/doc/UiBibz/Ui/Core/ButtonGroup.html +356 -0
- data/doc/UiBibz/Ui/Core/ButtonLink.html +365 -0
- data/doc/UiBibz/Ui/Core/ButtonSplitDropdown.html +387 -0
- data/doc/UiBibz/Ui/Core/Col.html +357 -0
- data/doc/UiBibz/Ui/Core/Component.html +1144 -0
- data/doc/UiBibz/Ui/Core/Dropdown.html +877 -0
- data/doc/UiBibz/Ui/Core/DropdownList.html +369 -0
- data/doc/UiBibz/Ui/Core/Glyph.html +742 -0
- data/doc/UiBibz/Ui/Core/Jumbotron.html +363 -0
- data/doc/UiBibz/Ui/Core/Label.html +361 -0
- data/doc/UiBibz/Ui/Core/List.html +486 -0
- data/doc/UiBibz/Ui/Core/ListGroup.html +446 -0
- data/doc/UiBibz/Ui/Core/Nav.html +474 -0
- data/doc/UiBibz/Ui/Core/NavDropdown.html +376 -0
- data/doc/UiBibz/Ui/Core/NavLink.html +347 -0
- data/doc/UiBibz/Ui/Core/Navbar.html +535 -0
- data/doc/UiBibz/Ui/Core/NavbarForm.html +341 -0
- data/doc/UiBibz/Ui/Core/NavbarNav.html +301 -0
- data/doc/UiBibz/Ui/Core/NavbarText.html +341 -0
- data/doc/UiBibz/Ui/Core/Panel.html +806 -0
- data/doc/UiBibz/Ui/Core/ProgressBar.html +433 -0
- data/doc/UiBibz/Ui/Core/Row.html +335 -0
- data/doc/UiBibz/Ui/Core.html +117 -0
- data/doc/UiBibz/Ui/Ux/Actionable.html +478 -0
- data/doc/UiBibz/Ui/Ux/Actions.html +314 -0
- data/doc/UiBibz/Ui/Ux/Column.html +1177 -0
- data/doc/UiBibz/Ui/Ux/Columns.html +312 -0
- data/doc/UiBibz/Ui/Ux/Grid.html +823 -0
- data/doc/UiBibz/Ui/Ux/Paginable.html +368 -0
- data/doc/UiBibz/Ui/Ux/Searchable.html +363 -0
- data/doc/UiBibz/Ui/Ux/Sortable.html +289 -0
- data/doc/UiBibz/Ui/Ux/Store.html +968 -0
- data/doc/UiBibz/Ui/Ux/Table.html +957 -0
- data/doc/UiBibz/Ui/Ux/TableAction.html +309 -0
- data/doc/UiBibz/Ui/Ux/TablePagination.html +319 -0
- data/doc/UiBibz/Ui/Ux/TablePaginationPerPage.html +331 -0
- data/doc/UiBibz/Ui/Ux/TablePanel.html +576 -0
- data/doc/UiBibz/Ui/Ux/TableSearchField.html +291 -0
- data/doc/UiBibz/Ui/Ux.html +117 -0
- data/doc/UiBibz/Ui.html +117 -0
- data/doc/UiBibz/Utils/Internationalization.html +262 -0
- data/doc/UiBibz/Utils.html +115 -0
- data/doc/UiBibz.html +129 -0
- data/doc/_index.html +635 -0
- data/doc/class_list.html +58 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +1022 -0
- data/doc/file_list.html +60 -0
- data/doc/frames.html +26 -0
- data/doc/images/navbar.png +0 -0
- data/doc/index.html +1022 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +181 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +1335 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/ui_bibz/helpers/ui_core_helper.rb +94 -0
- data/lib/ui_bibz/helpers/ui_ux_helper.rb +43 -0
- data/lib/ui_bibz/rails/engine.rb +2 -1
- data/lib/ui_bibz/ui/{ui.rb → base.rb} +1 -1
- data/lib/ui_bibz/ui/{alert.rb → core/alert.rb} +15 -7
- data/lib/ui_bibz/ui/core/breadcrumb/breadcrumb.rb +71 -0
- data/lib/ui_bibz/ui/{breadcrumb → core/breadcrumb}/components/breadcrumb_link.rb +6 -6
- data/lib/ui_bibz/ui/{button → core/button}/button.rb +13 -6
- data/lib/ui_bibz/ui/{button → core/button}/button_dropdown.rb +15 -4
- data/lib/ui_bibz/ui/{button → core/button}/button_group.rb +14 -6
- data/lib/ui_bibz/ui/{button → core/button}/button_link.rb +14 -6
- data/lib/ui_bibz/ui/{button → core/button}/button_split_dropdown.rb +15 -4
- data/lib/ui_bibz/ui/{grid/components → core}/col.rb +12 -6
- data/lib/ui_bibz/ui/{component.rb → core/component.rb} +7 -7
- data/lib/ui_bibz/ui/{dropdown → core/dropdown}/components/dropdown_list.rb +7 -7
- data/lib/ui_bibz/ui/{dropdown → core/dropdown}/dropdown.rb +18 -7
- data/lib/ui_bibz/ui/{glyph.rb → core/glyph.rb} +18 -10
- data/lib/ui_bibz/ui/{jumbotron.rb → core/jumbotron.rb} +14 -6
- data/lib/ui_bibz/ui/{label.rb → core/label.rb} +14 -6
- data/lib/ui_bibz/ui/{list → core/list}/components/list.rb +8 -8
- data/lib/ui_bibz/ui/{list → core/list}/list_group.rb +28 -6
- data/lib/ui_bibz/ui/core/nav/components/nav_dropdown.rb +64 -0
- data/lib/ui_bibz/ui/{nav → core/nav}/components/nav_link.rb +6 -6
- data/lib/ui_bibz/ui/core/nav/components/navbar_form.rb +45 -0
- data/lib/ui_bibz/ui/core/nav/components/navbar_nav.rb +56 -0
- data/lib/ui_bibz/ui/core/nav/components/navbar_text.rb +45 -0
- data/lib/ui_bibz/ui/core/nav/nav.rb +90 -0
- data/lib/ui_bibz/ui/core/nav/navbar.rb +121 -0
- data/lib/ui_bibz/ui/{panel.rb → core/panel.rb} +36 -8
- data/lib/ui_bibz/ui/{progress_bar → core/progress_bar}/components/bar.rb +7 -7
- data/lib/ui_bibz/ui/{progress_bar → core/progress_bar}/progress_bar.rb +20 -9
- data/lib/ui_bibz/ui/{grid/components → core}/row.rb +12 -4
- data/lib/ui_bibz/ui/{grid → ux}/grid.rb +17 -8
- data/lib/ui_bibz/ui/{table → ux/table}/components/actions.rb +5 -5
- data/lib/ui_bibz/ui/ux/table/components/column.rb +34 -0
- data/lib/ui_bibz/ui/ux/table/components/columns.rb +16 -0
- data/lib/ui_bibz/ui/{table → ux/table}/components/store.rb +4 -4
- data/lib/ui_bibz/ui/{table → ux/table}/components/table_action.rb +2 -2
- data/lib/ui_bibz/ui/{table/ux → ux/table/extensions}/actionable.rb +3 -3
- data/lib/ui_bibz/ui/{table/ux → ux/table/extensions}/paginable.rb +5 -5
- data/lib/ui_bibz/ui/{table/ux → ux/table/extensions}/searchable.rb +4 -4
- data/lib/ui_bibz/ui/{table/ux → ux/table/extensions}/sortable.rb +3 -3
- data/lib/ui_bibz/ui/{table → ux/table}/table.rb +40 -22
- data/lib/ui_bibz/ui/ux/table/table_pagination.rb +51 -0
- data/lib/ui_bibz/ui/{table → ux/table}/table_pagination_per_page.rb +26 -4
- data/lib/ui_bibz/ui/ux/table/table_panel.rb +155 -0
- data/lib/ui_bibz/ui/{table → ux/table}/table_search_field.rb +7 -7
- data/lib/ui_bibz/version.rb +1 -1
- data/lib/ui_bibz.rb +40 -29
- data/test/store_test.rb +2 -2
- data/test/ui/button_test.rb +6 -6
- data/test/ui/component_test.rb +2 -2
- data/test/ui/dropdown_test.rb +1 -1
- data/test/ui/glyph_test.rb +3 -3
- data/test/ui/grid_test.rb +4 -4
- data/test/ui/list_group_test.rb +2 -2
- data/test/ui/nav_test.rb +3 -4
- data/test/ui/panel_test.rb +4 -4
- data/test/ui/table_test.rb +32 -32
- data/test/ui_helper_test.rb +18 -2
- data/ui_bibz.gemspec +1 -0
- data/vendor/assets/stylesheets/ui_bibz.sass +3 -0
- metadata +166 -132
- data/README.rdoc +0 -0
- data/lib/ui_bibz/helpers/ui_helper.rb +0 -119
- data/lib/ui_bibz/ui/breadcrumb/breadcrumb.rb +0 -54
- data/lib/ui_bibz/ui/nav/nav.rb +0 -65
- data/lib/ui_bibz/ui/table/components/column.rb +0 -34
- data/lib/ui_bibz/ui/table/components/columns.rb +0 -16
- data/lib/ui_bibz/ui/table/table_pagination.rb +0 -29
- data/lib/ui_bibz/ui/table/table_panel.rb +0 -66
data/lib/ui_bibz/ui/nav/nav.rb
DELETED
@@ -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,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
|