active_list 6.1.5 → 6.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,9 @@
1
1
  = ActiveList
2
2
  {<img src="https://badge.fury.io/rb/active_list.png" alt="Gem Version" />}[http://badge.fury.io/rb/active_list]
3
- {<img src="https://api.travis-ci.org/burisu/active_list.png?branch=master"/>}[https://travis-ci.org/burisu/active_list]
4
- {<img src="https://gemnasium.com/burisu/active_list.png"/>}[https://gemnasium.com/burisu/active_list]
5
- {<img src="https://codeclimate.com/github/burisu/active_list.png" />}[https://codeclimate.com/github/burisu/active_list]
6
- {<img src="https://coveralls.io/repos/burisu/active_list/badge.png?branch=master" alt="Coverage Status" />}[https://coveralls.io/r/burisu/active_list]
3
+ {<img src="https://api.travis-ci.org/ekylibre/active_list.png?branch=master"/>}[https://travis-ci.org/ekylibre/active_list]
4
+ {<img src="https://gemnasium.com/ekylibre/active_list.png"/>}[https://gemnasium.com/ekylibre/active_list]
5
+ {<img src="https://codeclimate.com/github/ekylibre/active_list.png" />}[https://codeclimate.com/github/ekylibre/active_list]
6
+ {<img src="https://coveralls.io/repos/ekylibre/active_list/badge.png?branch=master" alt="Coverage Status" />}[https://coveralls.io/r/ekylibre/active_list]
7
7
 
8
8
  ActiveList is a simple list widget. It permits to create a controller
9
9
  method and view helper to displays lists.
@@ -102,7 +102,7 @@ ActiveList = {}
102
102
  sizer = $(this)
103
103
  per_page = sizer.data("list-change-page-size")
104
104
  if isNaN(per_page)
105
- alert "@list-change-page-size attribute is not a number: " + per_page
105
+ alert "@list-change-page-size attribute is not a number: #{per_page}"
106
106
  else
107
107
  AL.refresh sizer,
108
108
  per_page: per_page
@@ -115,12 +115,12 @@ ActiveList = {}
115
115
  visibility = ""
116
116
  columnId = element.data("list-toggle-column")
117
117
  list = element.closest("div[data-list-source]")
118
- column = list.find("th[data-list-column=\"" + columnId + "\"]")
118
+ column = list.find("th[data-list-column=\"#{columnId}\"]")
119
119
 
120
120
  #$('#'+columnId);
121
121
  className = column.data("list-column-cells")
122
- className = columnId if className is null
123
- search = "." + className
122
+ className = columnId unless className?
123
+ search = ".#{className}"
124
124
  if column.hasClass("hidden")
125
125
  $(search).removeClass "hidden"
126
126
  column.removeClass "hidden"
@@ -133,8 +133,7 @@ ActiveList = {}
133
133
  element.removeClass "checked"
134
134
  element.addClass "unchecked"
135
135
  visibility = "hidden"
136
- url = list.data("list-source")
137
- $.ajax url,
136
+ $.ajax list.data("list-source"),
138
137
  dataType: "html"
139
138
  data:
140
139
  visibility: visibility
@@ -1,82 +1,73 @@
1
1
  // Minimal style to get a working ActiveList
2
2
 
3
3
  div[data-list-source] {
4
- table.list {
5
- thead {
6
- tr {
7
- th {
8
- &[data-list-column-sort] {
9
- cursor: pointer;
10
- }
4
+ table.list {
5
+ thead {
6
+ tr {
7
+ th {
8
+ &[data-list-column-sort] {
9
+ cursor: pointer;
10
+ }
11
+ &.hidden {
12
+ display: none;
13
+ }
14
+ }
15
+ }
16
+ }
17
+ tbody {
18
+ tr {
19
+ td.hidden {
20
+ display: none;
21
+ }
22
+ }
23
+ }
24
+ }
11
25
 
12
- &.hidden {
13
- display: none;
14
- }
26
+ .pagination {
27
+ a[data-list-move-to-page] {
28
+ cursor: pointer;
29
+ }
30
+ a[data-list-move-to-page][disabled] {
31
+ cursor: default;
32
+ }
33
+ }
15
34
 
16
- }
17
- }
18
- }
19
-
20
- tbody {
21
- tr {
22
- td.hidden {
23
- display: none;
24
- }
25
- }
26
- }
27
- }
28
-
29
- .pagination {
30
- a[data-list-move-to-page] {
31
- cursor: pointer;
32
- }
33
- a[data-list-move-to-page][disabled] {
34
- cursor: default;
35
- }
36
- }
37
-
38
- .settings {
39
- position: relative;
40
- a { cursor: pointer; }
41
- .settings-start {
42
- height: 16px;
43
- padding: 2px;
44
- }
45
- &:hover {
46
- .list-menu-start { z-index:5000; position: relative; top: 0px; }
47
- & > ul { display: block; }
48
- }
49
- ul {
50
- display: none;
51
- position:absolute;
52
- top: 20px;
53
- padding: 1px;
54
- margin:0;
55
- & { right: 0px;}
56
- html[dir="rtl"] & { left: 0px;}
57
- li {
58
- &[data-list-change-page-size], &[data-list-toggle-column] {
59
- cursor: pointer;
60
- display: block;
61
- }
62
- list-style-type: none;
63
- width: 25ex;
64
- position: relative;
65
- a {
66
- display: block;
67
- }
68
- ul {
69
- display: none;
70
- position: absolute;
71
- top: -2px;
72
- & { right: 25ex; }
73
- html[dir="rtl"] & { left: 25ex; }
74
- &:hover { display:block; }
75
- }
76
- &:hover ul { display:block; }
77
- }
78
- }
79
- }
35
+ .settings {
36
+ position: relative;
37
+ a { cursor: pointer; }
38
+ &:hover {
39
+ .settings-start { z-index: 5000; position: relative; top: 0px; }
40
+ & > ul { display: block; }
41
+ }
42
+ ul {
43
+ display: none;
44
+ position: absolute;
45
+ top: 20px;
46
+ margin: 0;
47
+ & { right: 0px;}
48
+ html[dir="rtl"] & { left: 0px;}
49
+ li {
50
+ &[data-list-change-page-size], &[data-list-toggle-column] {
51
+ cursor: pointer;
52
+ display: block;
53
+ }
54
+ list-style-type: none;
55
+ width: 25ex;
56
+ position: relative;
57
+ a {
58
+ display: block;
59
+ }
60
+ ul {
61
+ position: relative;
62
+ top: -1em;
63
+ & { right: 25ex; }
64
+ html[dir="rtl"] & { left: 25ex; }
65
+ &:hover { display:block; }
66
+ }
67
+ &:hover ul { display:block; }
68
+ }
69
+ }
70
+ }
80
71
 
81
72
 
82
73
  }
@@ -80,7 +80,7 @@ module ActiveList
80
80
  # Build content
81
81
  code << "#{var_name(:content)} = ''\n"
82
82
  code << "#{var_name(:content)} << #{extras}\n" unless extras.blank?
83
- code << "#{var_name(:content)} << '<table class=\"list\""
83
+ code << "#{var_name(:content)} << '<div class=\"list-data\"><table class=\"list\""
84
84
  if table.paginate?
85
85
  code << " data-list-current-page=\"' + #{var_name(:page)}.to_s + '\" data-list-page-size=\"' + #{var_name(:limit)}.to_s + '\""
86
86
  end
@@ -91,7 +91,7 @@ module ActiveList
91
91
  code << " #{var_name(:content)} << '<tfoot>' + capture(" + table.columns.collect{|c| {name: c.name, id: c.id}}.inspect + ", &block).to_s + '</tfoot>'\n"
92
92
  code << "end\n"
93
93
  code << "#{var_name(:content)} << #{var_name(:tbody)}\n"
94
- code << "#{var_name(:content)} << '</table>'\n"
94
+ code << "#{var_name(:content)} << '</table></div>'\n"
95
95
  code << "return #{var_name(:content)}.html_safe if options[:only] == 'content'\n"
96
96
 
97
97
  # Build whole
@@ -300,7 +300,7 @@ module ActiveList
300
300
  pagination << "<span class=\"status\">' + 'list.pagination.x_to_y_of_total'.t(x: (#{var_name(:offset)} + (#{var_name(:count)} > 0 ? 1 : 0)), y: ((#{var_name(:last)} == #{var_name(:page)}) ? #{var_name(:count)} : #{var_name(:offset)} + #{var_name(:limit)}), total: #{var_name(:count)}) + '</span>"
301
301
 
302
302
  pagination << "<span class=\"paginator\">"
303
- pagination << "<a href=\"#\" data-list-move-to-page=\"1\" class=\"btn first-page\"' + (#{current_page} != 1 ? '' : ' disabled=\"true\"') + '><i></i>' + ::I18n.translate('list.pagination.first') + '</a>"
303
+ # pagination << "<a href=\"#\" data-list-move-to-page=\"1\" class=\"btn first-page\"' + (#{current_page} != 1 ? '' : ' disabled=\"true\"') + '><i></i>' + ::I18n.translate('list.pagination.first') + '</a>"
304
304
  pagination << "<a href=\"#\" data-list-move-to-page=\"' + (#{current_page} - 1).to_s + '\" class=\"btn previous-page\"' + (#{current_page} != 1 ? '' : ' disabled=\"true\"') + '><i></i>' + ::I18n.translate('list.pagination.previous') + '</a>"
305
305
 
306
306
  x = '@@PAGE-NUMBER@@'
@@ -309,7 +309,7 @@ module ActiveList
309
309
  # pagination << "<input type=\"number\" size=\"4\" data-list-move-to-page=\"value\" value=\"' + #{var_name(:page)}.to_s + '\">"
310
310
 
311
311
  pagination << "<a href=\"#\" data-list-move-to-page=\"' + (#{current_page} + 1).to_s + '\" class=\"btn next-page\"' + (#{current_page} != #{last_page} ? '' : ' disabled=\"true\"') + '><i></i>' + ::I18n.translate('list.pagination.next')+'</a>"
312
- pagination << "<a href=\"#\" data-list-move-to-page=\"' + (#{last_page}).to_s + '\" class=\"btn last-page\"' + (#{current_page} != #{last_page} ? '' : ' disabled=\"true\"') + '><i></i>' + ::I18n.translate('list.pagination.last')+'</a>"
312
+ # pagination << "<a href=\"#\" data-list-move-to-page=\"' + (#{last_page}).to_s + '\" class=\"btn last-page\"' + (#{current_page} != #{last_page} ? '' : ' disabled=\"true\"') + '><i></i>' + ::I18n.translate('list.pagination.last')+'</a>"
313
313
  pagination << "</span>"
314
314
 
315
315
  pagination << "</span>"
@@ -1,5 +1,5 @@
1
1
  module ActiveList
2
2
 
3
- VERSION = "6.1.5"
3
+ VERSION = "6.2.0"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_list
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.5
4
+ version: 6.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-09 00:00:00.000000000 Z
12
+ date: 2014-05-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -203,7 +203,7 @@ files:
203
203
  - test/people_controller_test.rb
204
204
  - test/table_test.rb
205
205
  - test/test_helper.rb
206
- homepage: http://github.com/burisu/active_list
206
+ homepage: http://github.com/ekylibre/active_list
207
207
  licenses:
208
208
  - MIT
209
209
  post_install_message: