active-list 5.0.1 → 6.0.0

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.
Files changed (40) hide show
  1. data/README.rdoc +2 -40
  2. metadata +19 -130
  3. checksums.yaml +0 -7
  4. data/VERSION +0 -1
  5. data/app/assets/images/active-list.png +0 -0
  6. data/app/assets/images/active-list.svg +0 -415
  7. data/app/assets/javascripts/active_list.jquery.js +0 -136
  8. data/app/assets/stylesheets/active_list.css.scss +0 -7
  9. data/app/assets/stylesheets/active_list/background.scss +0 -39
  10. data/app/assets/stylesheets/active_list/minimal.scss +0 -87
  11. data/app/assets/stylesheets/active_list/theme.scss +0 -189
  12. data/lib/active-list.rb +0 -1
  13. data/lib/active_list.rb +0 -43
  14. data/lib/active_list/action_pack.rb +0 -46
  15. data/lib/active_list/definition.rb +0 -17
  16. data/lib/active_list/definition/abstract_column.rb +0 -54
  17. data/lib/active_list/definition/action_column.rb +0 -76
  18. data/lib/active_list/definition/association_column.rb +0 -80
  19. data/lib/active_list/definition/attribute_column.rb +0 -58
  20. data/lib/active_list/definition/check_box_column.rb +0 -17
  21. data/lib/active_list/definition/data_column.rb +0 -88
  22. data/lib/active_list/definition/empty_column.rb +0 -10
  23. data/lib/active_list/definition/field_column.rb +0 -20
  24. data/lib/active_list/definition/status_column.rb +0 -10
  25. data/lib/active_list/definition/table.rb +0 -159
  26. data/lib/active_list/definition/text_field_column.rb +0 -10
  27. data/lib/active_list/exporters.rb +0 -28
  28. data/lib/active_list/exporters/abstract_exporter.rb +0 -55
  29. data/lib/active_list/exporters/csv_exporter.rb +0 -32
  30. data/lib/active_list/exporters/excel_csv_exporter.rb +0 -38
  31. data/lib/active_list/exporters/open_document_spreadsheet_exporter.rb +0 -82
  32. data/lib/active_list/generator.rb +0 -122
  33. data/lib/active_list/generator/finder.rb +0 -150
  34. data/lib/active_list/helpers.rb +0 -33
  35. data/lib/active_list/rails/engine.rb +0 -13
  36. data/lib/active_list/renderers.rb +0 -25
  37. data/lib/active_list/renderers/abstract_renderer.rb +0 -29
  38. data/lib/active_list/renderers/simple_renderer.rb +0 -356
  39. data/locales/eng.yml +0 -25
  40. data/locales/fra.yml +0 -25
@@ -1,136 +0,0 @@
1
- /* -*- Mode: Javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; coding: utf-8 -*- */
2
- /*jslint browser: true */
3
- /* List Javascript Inobtrusive Support for jQuery */
4
-
5
- (function ($) {
6
- "use strict";
7
-
8
- $.ActiveList = {};
9
-
10
- // Main function which reload table with specified data parameters
11
- $.ActiveList.refresh = function (element, new_parameters) {
12
- var source, parameters, url;
13
- // element = $(element);
14
- source = element.closest('div[data-list-source]');
15
- parameters = {
16
- sort: source.data("list-sort-by"),
17
- dir: source.data("list-sort-dir"),
18
- page: source.data("list-current-page"),
19
- per_page: source.data("list-page-size")
20
- };
21
- $.extend(parameters, new_parameters);
22
- url = source.data('list-source');
23
- $.ajax(url, {
24
- data: parameters,
25
- dataType: "html",
26
- success: function (data, status, request) {
27
- source.replaceWith(data);
28
- return true;
29
- }
30
- });
31
- return false;
32
- };
33
-
34
-
35
- $.ActiveList.moveToPage = function (element, page) {
36
- var page_attr;
37
- // element = $(element);
38
- if (page === undefined || page === null || page === '') {
39
- page = element.data('list-move-to-page');
40
- }
41
- if (page === undefined || page === null || page === '') {
42
- alert("Cannot define which page to load: "+page);
43
- }
44
- if (isNaN(page)) {
45
- page_attr = page;
46
- page = element.attr(page_attr);
47
- if (isNaN(page)) {
48
- alert("Cannot define which page to load with attribute " + page_attr + ": "+page);
49
- }
50
- }
51
- $.ActiveList.refresh(element, {page: page});
52
- return false;
53
- };
54
-
55
-
56
- // Sort by one column
57
- $(document).on('click', 'div[data-list-source] th[data-list-column][data-list-column-sort]', function(event) {
58
- var element = $(this);
59
- $.ActiveList.refresh(element, {
60
- sort: element.data('list-column'),
61
- dir: element.data('list-column-sort')
62
- });
63
- return false;
64
- });
65
-
66
-
67
- // Change number of item per page
68
- $(document).on('click', 'div[data-list-source] li[data-list-change-page-size]', function(event) {
69
- var element = $(this), per_page=element.data('list-change-page-size');
70
- if (isNaN(per_page)) {
71
- alert("@list-change-page-size attribute is not a number: "+per_page);
72
- } else {
73
- $.ActiveList.refresh(element, {per_page: per_page});
74
- }
75
- return false;
76
- });
77
-
78
-
79
- // Toggle visibility of a column
80
- $(document).on('click', 'div[data-list-source] li[data-list-toggle-column]', function(event) {
81
- var element = $(this), columnId, column, className, search, visibility = '', url, source;
82
- columnId = element.data('list-toggle-column');
83
- source = element.closest('div[data-list-source]');
84
- column = source.find('th[data-list-column="'+columnId+'"]');
85
- //$('#'+columnId);
86
- className = column.data("list-column-cells");
87
- if (className === null) {
88
- className = columnId;
89
- }
90
- search = '.'+className;
91
- if (column.hasClass("hidden")) {
92
- $(search).removeClass("hidden");
93
- column.removeClass("hidden");
94
- element.removeClass("unchecked");
95
- element.addClass("checked");
96
- visibility = 'shown';
97
- } else {
98
- $(search).addClass("hidden");
99
- column.addClass("hidden");
100
- element.removeClass("checked");
101
- element.addClass("unchecked");
102
- visibility = 'hidden';
103
- }
104
- url = source.data('list-source');
105
- $.ajax(url, {
106
- dataType: "html",
107
- data: {
108
- visibility: visibility,
109
- column: columnId
110
- }
111
- });
112
- return false;
113
- });
114
-
115
- // Change page of table on link clicks
116
- $(document).on('click', 'div[data-list-source] a[data-list-move-to-page]', function(event) {
117
- $.ActiveList.moveToPage($(this));
118
- return false;
119
- });
120
-
121
- // Change page of table on input changes
122
- $(document).on('change', 'div[data-list-source] input[data-list-move-to-page]', function(event) {
123
- $.ActiveList.moveToPage($(this));
124
- return false;
125
- });
126
-
127
-
128
- // Adds title attribute based on link name
129
- $(document).on('hover', 'div[data-list-source] tbody tr td.act a', function (event) {
130
- var element = $(this), title = element.attr('title');
131
- if (title === null || title === undefined) {
132
- element.attr('title', element.html());
133
- }
134
- });
135
-
136
- })(jQuery);
@@ -1,7 +0,0 @@
1
- @import "active_list/minimal";
2
- @import "active_list/background";
3
- @import "active_list/theme";
4
-
5
- .active-list[data-list-source], .active-list {
6
- @include active-list-theme;
7
- }
@@ -1,39 +0,0 @@
1
- // Provides mixin to generate colors for cells backgrounds
2
- //
3
-
4
- @function merge-color($color-1, $color-2) {
5
- $col2: rgb(red($color-2), green($color-2), blue($color-2));
6
- $percent: 100*alpha($color-2);
7
- @return mix($col2, $color-1, $percent);
8
- }
9
-
10
- @function merge-colors($color, $color-1: rgba(0, 0, 0, 0), $color-2: rgba(0, 0, 0, 0), $color-3: rgba(0, 0, 0, 0), $color-4: rgba(0, 0, 0, 0), $color-5: rgba(0, 0, 0, 0), $color-6: rgba(0, 0, 0, 0), $color-7: rgba(0, 0, 0, 0), $color-8: rgba(0, 0, 0, 0), $color-9: rgba(0, 0, 0, 0), $color-10: rgba(0, 0, 0, 0)) {
11
- @return merge-color(merge-color(merge-color(merge-color(merge-color(merge-color(merge-color(merge-color(merge-color(merge-color($color, $color-1), $color-2), $color-3), $color-4), $color-5), $color-6), $color-7), $color-8), $color-9), $color-10);
12
- }
13
-
14
- $list-line-backgrounds: ("&" rgba(#FFF, 0)) ("&.error, &.undone" rgba(red, 0.12)) ("&.warning, &.in_progress" rgba(orange, 0.12));
15
- $list-column-backgrounds: ("&" rgba(#FFF, 0)) ("&.act" rgba(#F90, 0.01)) ("&.sor" rgba(#05A, 0.05));
16
- $list-hover-backgrounds: ("&" rgba(#FFF, 0)) ("&:hover" rgba(blue, 0.05));
17
-
18
- @mixin list-colors($bgcolor: #000000, $selector: '&') {
19
- tr {
20
- #{$selector} {
21
- @each $line-background in $list-line-backgrounds {
22
- #{nth($line-background, 1)} {
23
- @each $hover-background in $list-hover-backgrounds {
24
- #{nth($hover-background, 1)} {
25
- @each $col-background in $list-column-backgrounds {
26
- td {
27
- #{nth($col-background, 1)} {
28
- background-color: merge-colors($bgcolor, nth($line-background, 2), nth($col-background, 2), nth($hover-background, 2));
29
- }
30
- }
31
- }
32
- }
33
- }
34
- }
35
- }
36
- }
37
- }
38
- }
39
-
@@ -1,87 +0,0 @@
1
- // Minimal style to get a working ActiveList
2
-
3
- div[data-list-source] {
4
- table.list {
5
- thead {
6
- tr {
7
- th {
8
- &[data-list-column-sort] {
9
- cursor: pointer;
10
- }
11
-
12
- &.spe {
13
- padding: 0;
14
- .list-menu {
15
- position: relative;
16
- a { cursor: pointer; }
17
- .list-menu-start {
18
- display: block;
19
- height: 16px;
20
- padding: 2px;
21
- }
22
- &:hover {
23
- .list-menu-start { z-index:5000; position: relative; top: 0px; }
24
- & > ul { display: block; }
25
- }
26
- ul {
27
- display: none;
28
- position:absolute;
29
- top: 20px;
30
- padding: 1px;
31
- margin:0;
32
- & { right: 0px;}
33
- html[dir="rtl"] & { left: 0px;}
34
- li {
35
- &[data-list-change-page-size], &[data-list-toggle-column] {
36
- cursor: pointer;
37
- display: block;
38
- }
39
- list-style-type: none;
40
- width: 25ex;
41
- position: relative;
42
- a {
43
- display: block;
44
- }
45
- ul {
46
- display: none;
47
- position: absolute;
48
- top: -2px;
49
- & { right: 25ex; }
50
- html[dir="rtl"] & { left: 25ex; }
51
- &:hover { display:block; }
52
- }
53
- &:hover ul { display:block; }
54
- }
55
- }
56
- }
57
- }
58
-
59
- &.hidden {
60
- display: none;
61
- }
62
-
63
- }
64
- }
65
- }
66
-
67
- tbody {
68
- tr {
69
- td.hidden {
70
- display: none;
71
- }
72
- }
73
- }
74
-
75
- }
76
-
77
- div.extras {
78
- .pagination {
79
- a[data-list-move-to-page] {
80
- cursor: pointer;
81
- }
82
- a[data-list-move-to-page][disabled] {
83
- cursor: default;
84
- }
85
- }
86
- }
87
- }
@@ -1,189 +0,0 @@
1
- // Default style for ActiveList
2
- @import "compass/css3";
3
- @import "compass/typography/text/replacement";
4
-
5
-
6
-
7
- // Because Compass sprites do not seems to work well in gems
8
- @mixin active-list-sprite($name, $size: 16px) {
9
- background-image: image-url("active-list.png");
10
- background-repeat: no-repeat;
11
- height: $size;
12
- width: $size;
13
- $i: 0;
14
- @each $icon in menu check columns export pages first-page previous-page previous-line next-line next-page last-page sort sort-down sort-up true false {
15
- @if $icon == $name {
16
- background-position: (-$i * $size) 0;
17
- }
18
- $i: $i + 1;
19
- }
20
- }
21
-
22
-
23
- @mixin active-list-theme($theme-color: #777777) {
24
- $default-border-color: mix($theme-color, #FFF, 30%);
25
- $menu-width: 250px;
26
- table.list {
27
- border-collapse: collapse;
28
- width: 100%;
29
- border: 1px solid $default-border-color;
30
- z-index: 2;
31
- @include box-shadow(0 0 7px rgba(0, 0, 0, 0.15));
32
- thead {
33
- th {
34
- border: 1px solid $default-border-color;
35
- padding: 2px 3px;
36
- @include background($theme-color linear-gradient(top, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.8)));
37
- &[data-list-column-sort] {
38
- .icon {
39
- @include active-list-sprite(sort);
40
- @include inline-block;
41
- margin: 0 2px;
42
- }
43
- &.sor[data-list-column-sort="desc"] .icon {
44
- @include active-list-sprite(sort-down); }
45
- &.sor[data-list-column-sort="asc"] .icon {
46
- @include active-list-sprite(sort-up); }
47
- }
48
- & { text-align: left; }
49
- html[dir="rtl"] & { text-align: right; }
50
- &.spe {
51
- width: 16px;
52
- height: 16px;
53
- .list-menu {
54
- position: relative;
55
- background: none;
56
- .list-menu-start {
57
- padding: 2px;
58
- width: 16px;
59
- height: 16px;
60
- .icon { @include active-list-sprite(menu); display: block; }
61
- .text { display: none; }
62
- }
63
- &:hover {
64
- .list-menu-start {
65
- background-color: white;
66
- z-index:5000;
67
- }
68
- }
69
- ul {
70
- width: $menu-width;
71
- border: 1px solid $default-border-color;
72
- background: #FFF;
73
- @include box-shadow(0 0 5px rgba(0, 0, 0, 0.3));
74
- li {
75
- width: $menu-width;
76
- padding: 0;
77
- ul {
78
- & { right: $menu-width; }
79
- html[dir="rtl"] & { left: $menu-width; }
80
- }
81
- }
82
- }
83
- & > ul {
84
- top: 19px;
85
- }
86
- li {
87
- padding: 0;
88
- display: block;
89
- a {
90
- display: block;
91
- padding: 2px;
92
- .icon {
93
- @include inline-block;
94
- height:16px;
95
- width: 16px;
96
- & { margin-right: 4px; }
97
- html[dir="rtl"] & { margin-left: 4px; }
98
- }
99
- .text {
100
- @include inline-block;
101
- width: $menu-width - 24px;
102
- line-height: 18px;
103
- font-weight: normal;
104
- }
105
- & * {
106
- vertical-align: middle;
107
- }
108
- &.pages .icon { @include active-list-sprite(pages); }
109
- &.columns .icon { @include active-list-sprite(columns); }
110
- }
111
- &.export .icon { @include active-list-sprite(export); }
112
- &.check .icon { @include active-list-sprite(check); }
113
- &.checked .icon { @include active-list-sprite(true); }
114
- &.unchecked .icon { @include active-list-sprite(false); }
115
- &:hover {
116
- text-decoration: none;
117
- background: mix($theme-color, #FFF, 10%);
118
- }
119
- &.separator {
120
- padding: 0;
121
- height: 1px;
122
- width: $menu-width - 6px;
123
- margin: 3px;
124
- background: $default-border-color;
125
- }
126
- }
127
-
128
- }
129
- }
130
- }
131
- }
132
- tbody {
133
- tr {
134
- td {
135
- padding: 2px 3px;
136
- border-top: 1px solid mix($theme-color, #FFF, 10%);
137
- border-bottom: none;
138
- border-left: none;
139
- border-right: none;
140
- &.chk,&.act, &.dld, &.bln, &.dat, &.web { text-align:center }
141
- &.dec, &.flt, &.int {
142
- & { text-align: right; }
143
- html[dir="rtl"] & { text-align: left; }
144
- }
145
- &.country { white-space: nowrap; }
146
- &.color { color: white; text-shadow: 0 0 2px #000; width: 6ex; text-align: center; }
147
- }
148
- &:first-child td {
149
- border-top: none;
150
- }
151
- }
152
- }
153
-
154
- @include list-colors(#FFFFFF);
155
- }
156
- .extras {
157
- z-index: 0;
158
- @include background(transparentize(mix($theme-color, #FFF, 40%), 0.7));
159
- .pagination {
160
- & { text-align: left; }
161
- html[dir="rtl"] & { text-align: right; }
162
- & > * {
163
- margin: 0 2px;
164
- }
165
- .first-page, .previous-page, .next-page, .last-page {
166
- @include inline-block;
167
- @include squish-text;
168
- }
169
- html[dir="rtl"] & .last-page, & .first-page {
170
- @include active-list-sprite(first-page);
171
- }
172
- html[dir="rtl"] & .first-page, & .last-page {
173
- @include active-list-sprite(last-page);
174
- }
175
- html[dir="rtl"] & .next-page, & .previous-page {
176
- @include active-list-sprite(previous-page);
177
- }
178
- html[dir="rtl"] & .previous-page, & .next-page {
179
- @include active-list-sprite(next-page);
180
- }
181
- .separator {
182
- @include inline-block;
183
- width: 2px;
184
- height: 1.2em;
185
- background: transparentize($theme-color, 0.7);
186
- }
187
- }
188
- }
189
- }