wice_grid 3.0.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/.gitignore +1 -0
  2. data/CHANGELOG +412 -0
  3. data/MIT-LICENSE +20 -0
  4. data/README.rdoc +1179 -0
  5. data/Rakefile +42 -0
  6. data/SAVED_QUERIES_HOWTO.rdoc +123 -0
  7. data/VERSION +1 -0
  8. data/lib/generators/wice_grid/templates/calendarview.css +107 -0
  9. data/lib/generators/wice_grid/templates/calendarview.js +1168 -0
  10. data/lib/generators/wice_grid/templates/icons/arrow_down.gif +0 -0
  11. data/lib/generators/wice_grid/templates/icons/arrow_up.gif +0 -0
  12. data/lib/generators/wice_grid/templates/icons/calendar_view_month.png +0 -0
  13. data/lib/generators/wice_grid/templates/icons/delete.png +0 -0
  14. data/lib/generators/wice_grid/templates/icons/expand.png +0 -0
  15. data/lib/generators/wice_grid/templates/icons/page_white_excel.png +0 -0
  16. data/lib/generators/wice_grid/templates/icons/page_white_find.png +0 -0
  17. data/lib/generators/wice_grid/templates/icons/table.png +0 -0
  18. data/lib/generators/wice_grid/templates/icons/table_refresh.png +0 -0
  19. data/lib/generators/wice_grid/templates/icons/tick_all.png +0 -0
  20. data/lib/generators/wice_grid/templates/icons/untick_all.png +0 -0
  21. data/lib/generators/wice_grid/templates/wice_grid.css +173 -0
  22. data/lib/generators/wice_grid/templates/wice_grid.yml +279 -0
  23. data/lib/generators/wice_grid/templates/wice_grid_config.rb +154 -0
  24. data/lib/generators/wice_grid/templates/wice_grid_jquery.js +161 -0
  25. data/lib/generators/wice_grid/templates/wice_grid_prototype.js +153 -0
  26. data/lib/generators/wice_grid/wice_grid_assets_jquery_generator.rb +32 -0
  27. data/lib/generators/wice_grid/wice_grid_assets_prototype_generator.rb +34 -0
  28. data/lib/grid_output_buffer.rb +52 -0
  29. data/lib/grid_renderer.rb +535 -0
  30. data/lib/helpers/js_calendar_helpers.rb +183 -0
  31. data/lib/helpers/wice_grid_misc_view_helpers.rb +113 -0
  32. data/lib/helpers/wice_grid_serialized_queries_view_helpers.rb +91 -0
  33. data/lib/helpers/wice_grid_view_helpers.rb +781 -0
  34. data/lib/js_adaptors/jquery_adaptor.rb +145 -0
  35. data/lib/js_adaptors/js_adaptor.rb +12 -0
  36. data/lib/js_adaptors/prototype_adaptor.rb +168 -0
  37. data/lib/table_column_matrix.rb +51 -0
  38. data/lib/tasks/wice_grid_tasks.rake +28 -0
  39. data/lib/view_columns.rb +486 -0
  40. data/lib/views/create.rjs +13 -0
  41. data/lib/views/create_jq.rjs +31 -0
  42. data/lib/views/delete.rjs +12 -0
  43. data/lib/views/delete_jq.rjs +26 -0
  44. data/lib/wice_grid.rb +827 -0
  45. data/lib/wice_grid_controller.rb +165 -0
  46. data/lib/wice_grid_core_ext.rb +179 -0
  47. data/lib/wice_grid_misc.rb +98 -0
  48. data/lib/wice_grid_serialized_queries_controller.rb +86 -0
  49. data/lib/wice_grid_serialized_query.rb +15 -0
  50. data/lib/wice_grid_spreadsheet.rb +33 -0
  51. data/test/.gitignore +2 -0
  52. data/test/database.yml +21 -0
  53. data/test/schema.rb +33 -0
  54. data/test/test_helper.rb +89 -0
  55. data/test/views/projects_and_people_grid.html.erb +12 -0
  56. data/test/views/projects_and_people_grid_invalid.html.erb +12 -0
  57. data/test/views/simple_projects_grid.html.erb +9 -0
  58. data/test/wice_grid_core_ext_test.rb +183 -0
  59. data/test/wice_grid_functional_test.rb +68 -0
  60. data/test/wice_grid_misc_test.rb +41 -0
  61. data/test/wice_grid_test.rb +42 -0
  62. data/test/wice_grid_view_helper_test.rb +12 -0
  63. data/wice_grid.gemspec +111 -0
  64. metadata +153 -0
@@ -0,0 +1,173 @@
1
+ /* This is just an example, so feel free to re-style it completely */
2
+
3
+ .wice_grid {
4
+ border: 1px solid #ccc;
5
+ border-collapse: collapse;
6
+ border-spacing: 0px
7
+ }
8
+
9
+ .wice_grid .clickable{
10
+ cursor: pointer;
11
+ }
12
+
13
+ .wice_grid th {
14
+ background-color: #dfdfdf;
15
+ font-weight: bold;
16
+ text-shadow: rgb(204, 204, 204) 0px 1px 0px;
17
+ height: 2em;
18
+ padding: 0 1em;
19
+
20
+ }
21
+ .wice_grid th a {
22
+ color: #000;
23
+ }
24
+ .wice_grid th a:hover {
25
+ color: #333;
26
+ }
27
+
28
+ .wice_grid tr.wice_grid_title_row th,
29
+ .wice_grid tr.wice_grid_filter_row th{
30
+ background-color: #dddddd;
31
+ vertical-align: top;
32
+ }
33
+
34
+
35
+
36
+ .wice_grid th.filter_icons, .wice_grid th.hide_show_icon {
37
+ text-align: right ;
38
+ }
39
+
40
+ .wice_grid thead {
41
+ border-bottom: 1px solid #666;
42
+ }
43
+
44
+ .wice_grid tr.odd {
45
+ background-color: #fff;
46
+ }
47
+
48
+ .wice_grid tr.even {
49
+ background-color: #eeeeee;
50
+ }
51
+
52
+ .wice_grid td {
53
+ border-bottom: 1px dotted #9999CC;
54
+ height: 2.5em;
55
+ padding: 0 1em;
56
+ }
57
+
58
+ .wice_grid .desc, .wice_grid .asc{
59
+ padding-right: 18px;
60
+ text-decoration:none;
61
+ }
62
+
63
+ .wice_grid .desc {
64
+ background: transparent url(/images/icons/grid/arrow_down.gif) right no-repeat
65
+ }
66
+ .wice_grid .asc {
67
+ background: transparent url(/images/icons/grid/arrow_up.gif) right no-repeat
68
+ }
69
+
70
+ .wice_grid th div.date-filter {
71
+ text-align: left;
72
+ }
73
+
74
+ .wice_grid tr.even td.active_filter { background-color: #ddddff; }
75
+ .wice_grid tr.odd td.active_filter { background-color: #eeeeff; }
76
+
77
+ .wice_grid tr.even td.sorted { background-color: #ffffcc; }
78
+ .wice_grid tr.odd td.sorted { background-color: #ffffee; }
79
+
80
+
81
+ .wice_grid a.date_label {text-decoration: none;}
82
+ .wice_grid a.date_label:hover {text-decoration: line-through;}
83
+
84
+ .wice_grid td.sel{
85
+ text-align: center;
86
+ }
87
+
88
+ .wice_grid_container .pagination {
89
+ float: left;
90
+ }
91
+
92
+ .wice_grid_container .pagination_status {
93
+ font-weight: bold;
94
+ float: right;
95
+ }
96
+
97
+ .wice_grid_container .pagination_status .show_all_link a {
98
+ text-decoration: none;
99
+ font-size: 80%;
100
+ }
101
+
102
+ .wice_grid .custom_dropdown_container { position: relative; padding-right: 9px;}
103
+ .wice_grid .custom_dropdown_container .toggle_multi_select_icon { position:absolute; top:0; right:0; }
104
+
105
+ .wice_grid .text_filter_container { position: relative; padding-right: 13px;}
106
+ .wice_grid .text_filter_container .negation_checkbox { position:absolute; top:0; right:0; }
107
+
108
+
109
+ /* Saved Queries */
110
+
111
+ .wice_grid_container h3 {
112
+ font-family: 'Lucida Grande';
113
+ font-size: 16px;
114
+ font-style: normal;
115
+ font-weight: bold;
116
+ margin-bottom: 2px;
117
+ }
118
+
119
+ .wice_grid_query_panel {
120
+ width: 400px;
121
+ border:1px solid #ddd;
122
+ margin-top : 10px;
123
+ margin-bottom : 10px;
124
+ padding : 5px;
125
+ }
126
+
127
+
128
+ .wice_grid_query_panel .query_list{
129
+ list-style-image: none;
130
+ list-style-position: outside;
131
+ list-style-type: none;
132
+ margin-left : 0px;
133
+ }
134
+
135
+ .wice_grid_query_panel .query_list li a.query_load_link {
136
+ text-decoration: none;
137
+ }
138
+
139
+
140
+ .wice_grid_query_panel .query_list li a.current {
141
+ font-weight: bold;
142
+ text-decoration: underline;
143
+ }
144
+
145
+
146
+ .wice_grid_query_panel .query_list li a.query_load_link:hover {
147
+ text-decoration: underline;
148
+ }
149
+
150
+
151
+ .wice_grid_query_panel .wice_grid_notice {
152
+ padding:.4em;
153
+ margin-bottom:1em;
154
+ border:2px solid #ddd;
155
+ background:#FFF6BF;
156
+ color:#514721;
157
+ border-color:#FFD324;
158
+ }
159
+
160
+
161
+ .wice_grid_query_panel .errorExplanation {
162
+ padding:.4em;
163
+ margin-bottom:1em;
164
+ border:2px solid #ddd;
165
+ background:#FBE3E4;
166
+ color:#8a1f11;
167
+ border-color:#FBC2C4;
168
+ list-style-image: none;
169
+ list-style-position: outside;
170
+ list-style-type: none;
171
+ margin-left : 0px;
172
+ }
173
+
@@ -0,0 +1,279 @@
1
+ en:
2
+ date:
3
+ order:
4
+ - :year
5
+ - :month
6
+ - :day
7
+ wice_grid:
8
+ show_filter_tooltip: Show filter
9
+ hide_filter_tooltip: Hide filter
10
+ csv_export_tooltip: Export to CSV
11
+ filter_tooltip: Filter
12
+ reset_filter_tooltip: Reset
13
+ boolean_filter_true_label: "yes"
14
+ boolean_filter_false_label: "no"
15
+ previous_label: « Previous
16
+ next_label: Next »
17
+ # Title of the icon clicking on which will show the calendar to set the FROM date.
18
+ date_selector_tooltip_from: From
19
+ # Title of the icon clicking on which will show the calendar to set the TO date.
20
+ date_selector_tooltip_to: To
21
+ # The title of the checkox to turn on negation
22
+ negation_checkbox_title: Exclude
23
+ # link to switch to show all records
24
+ show_all_records_label: show all
25
+ # tooltip for the link to switch to show all records
26
+ show_all_records_tooltip: Show all records
27
+ # Warning message shown when the user wants to switch to all-records mode
28
+ all_queries_warning: Are you sure you want to display all records?
29
+ # link to paginated view
30
+ switch_back_to_paginated_mode_label: back to paginated view
31
+ # tooltip for the link to paginated view
32
+ switch_back_to_paginated_mode_tooltip: Switch back to the view with pages
33
+ # Title of the date string.
34
+ date_string_tooltip: Click to delete
35
+ saved_query_panel_title: Saved Queries
36
+ save_query_button_label: Save the state of filters
37
+ saved_query_deletion_confirmation: Are you sure?
38
+ saved_query_deletion_link_title: Delete query
39
+ saved_query_link_title: Load query
40
+ validates_uniqueness_error: A query with this name already exists
41
+ validates_presence_error: Please submit the name of the custom query
42
+ query_deleted_message: Saved query deleted.
43
+ query_saved_message: Query saved.
44
+ select_all: Select all
45
+ deselect_all: Remove selection
46
+
47
+
48
+ is:
49
+ date:
50
+ order:
51
+ - :year
52
+ - :month
53
+ - :day
54
+ wice_grid:
55
+ show_filter_tooltip: Sýna síumöguleika
56
+ hide_filter_tooltip: Fela síumoguleika
57
+ csv_export_tooltip: Flytja út CSV
58
+ filter_tooltip: Sía
59
+ reset_filter_tooltip: Hreinsa
60
+ boolean_filter_true_label: Já
61
+ boolean_filter_false_label: Nei
62
+ previous_label: « Fyrri síða
63
+ next_label: Næsta síða »
64
+ # Title of the icon clicking on which will show the calendar to set the FROM date.
65
+ date_selector_tooltip_from: Frá
66
+ # Title of the icon clicking on which will show the calendar to set the TO date.
67
+ date_selector_tooltip_to: Til
68
+ # The title of the checkox to turn on negation
69
+ negation_checkbox_title: Undanskilja
70
+ # link to switch to show all records
71
+ show_all_records_label: Sýna allt
72
+ # tooltip for the link to switch to show all records
73
+ show_all_records_tooltip: Sýna öll gögn
74
+ # Warning message shown when the user wants to switch to all-records mode
75
+ all_queries_warning: Ertu viss um að þú viljir láta sýna öll gögn?
76
+ # link to paginated view
77
+ switch_back_to_paginated_mode_label: Aftur til síðuhorfs
78
+ # tooltip for the link to paginated view
79
+ switch_back_to_paginated_mode_tooltip: Aftur til síðuhorfs
80
+ # Title of the date string.
81
+ date_string_tooltip: Smella á til að eyða
82
+ saved_query_panel_title: Vistaðar leitarskipanir
83
+ save_query_button_label: Vista síuval
84
+ saved_query_deletion_confirmation: Ertu viss?
85
+ saved_query_deletion_link_title: Eyða leitarskipun
86
+ saved_query_link_title: Hlaða leitarskipun
87
+ validates_uniqueness_error: Leitarskipun með þessu nafni er þegar til
88
+ validates_presence_error: Vinsamlegast gefið heiti fyrir leitarskipun
89
+ query_deleted_message: Vistaðri leitarskipun hefur verið eytt
90
+ query_saved_message: leitaskipun hefur verið vistuð
91
+ # To do: translate
92
+ select_all: Select all
93
+ deselect_all: Remove selection
94
+
95
+ nl:
96
+ date:
97
+ order:
98
+ - :year
99
+ - :month
100
+ - :day
101
+ wice_grid:
102
+ show_filter_tooltip: Filter tonen
103
+ hide_filter_tooltip: Filter verbergen
104
+ csv_export_tooltip: Als CSV exporteren
105
+ filter_tooltip: Filter
106
+ reset_filter_tooltip: Terugstellen
107
+ boolean_filter_true_label: ja
108
+ boolean_filter_false_label: neen
109
+ previous_label: « Vorige
110
+ next_label: Volgende »
111
+ # Title of the icon clicking on which will show the calendar to set the FROM date.
112
+ date_selector_tooltip_from: Vanaf
113
+ # Title of the icon clicking on which will show the calendar to set the TO date.
114
+ date_selector_tooltip_to: Tot
115
+ # The title of the checkox to turn on negation
116
+ negation_checkbox_title: Uitsluiten
117
+ # link to switch to show all records
118
+ show_all_records_label: Alle rijen tonen
119
+ # tooltip for the link to switch to show all records
120
+ show_all_records_tooltip: Alle rijen tonen
121
+ # Warning message shown when the user wants to switch to all-records mode
122
+ all_queries_warning: Bent u zeker dat u alle rijen wilt tonen?
123
+ # link to paginated view
124
+ switch_back_to_paginated_mode_label: Terug naar pagina's
125
+ # tooltip for the link to paginated view
126
+ switch_back_to_paginated_mode_tooltip: Terug naar pagina's
127
+ # Title of the date string.
128
+ date_string_tooltip: Klik om te verwijderen
129
+ saved_query_panel_title: Opgeslagen query's
130
+ save_query_button_label: Query opslaan
131
+ saved_query_deletion_confirmation: Bent u zeker?
132
+ saved_query_deletion_link_title: Query verwijderen
133
+ saved_query_link_title: Query laden
134
+ validates_uniqueness_error: Deze query bestaat reeds
135
+ validates_presence_error: Gelieve de naam van de query in te vullen
136
+ query_deleted_message: Opgeslagen query verwijderd.
137
+ query_saved_message: Query opgeslagen
138
+ select_all: Selecteer alle rijen
139
+ deselect_all: Deselecteer alle rijen
140
+
141
+ fr:
142
+ date:
143
+ order:
144
+ - :year
145
+ - :month
146
+ - :day
147
+ wice_grid:
148
+ show_filter_tooltip: Afficher le filtre
149
+ hide_filter_tooltip: Cacher le filtrer
150
+ csv_export_tooltip: Exporter en CSV
151
+ filter_tooltip: Filtrer
152
+ reset_filter_tooltip: Effacer
153
+ boolean_filter_true_label: oui
154
+ boolean_filter_false_label: non
155
+ previous_label: « Page précédente
156
+ next_label: Page suivante »
157
+ # Title of the icon clicking on which will show the calendar to set the FROM date.
158
+ date_selector_tooltip_from: De
159
+ # Title of the icon clicking on which will show the calendar to set the TO date.
160
+ date_selector_tooltip_to: à
161
+ # The title of the checkox to turn on negation
162
+ negation_checkbox_title: Exclure
163
+ # link to switch to show all records
164
+ show_all_records_label: Voir tous
165
+ # tooltip for the link to switch to show all records
166
+ show_all_records_tooltip: Voir tous les enregistrements
167
+ # Warning message shown when the user wants to switch to all-records mode
168
+ all_queries_warning: Etes-vous certain de vouloir afficher tous les enregistrements?
169
+ # link to paginated view
170
+ switch_back_to_paginated_mode_label: Retour à la vue paginée
171
+ # tooltip for the link to paginated view
172
+ switch_back_to_paginated_mode_tooltip: Retour à la vue par pages
173
+ # Title of the date string.
174
+ date_string_tooltip: Cliquez pour effacer
175
+ saved_query_panel_title: Requêtes sauvées
176
+ save_query_button_label: Sauver l'état des filtres
177
+ saved_query_deletion_confirmation: Etes vous sûr?
178
+ saved_query_deletion_link_title: Effacer la requête
179
+ saved_query_link_title: Charger la requête
180
+ validates_uniqueness_error: Un requête existante porte déjà ce nom
181
+ validates_presence_error: Veuillez indiquer le nom de la requête que vous souhaitez sauver
182
+ query_deleted_message: La requête a été effacée.
183
+ query_saved_message: La requête a été sauvée.
184
+ select_all: Sélectionner tout
185
+ deselect_all: Désélectionner tout
186
+
187
+ ru:
188
+ date:
189
+ order:
190
+ - :year
191
+ - :month
192
+ - :day
193
+ wice_grid:
194
+ show_filter_tooltip: Показать фильтр
195
+ hide_filter_tooltip: Спрятать фильтр
196
+ csv_export_tooltip: Экспорт в CSV
197
+ filter_tooltip: Фильтровать
198
+ reset_filter_tooltip: Сброс
199
+ boolean_filter_true_label: да
200
+ boolean_filter_false_label: нет
201
+ previous_label: « Предыдущая
202
+ next_label: Следующая »
203
+ # Title of the icon clicking on which will show the calendar to set the FROM date.
204
+ date_selector_tooltip_from: С
205
+ # Title of the icon clicking on which will show the calendar to set the TO date.
206
+ date_selector_tooltip_to: До
207
+ # The title of the checkox to turn on negation
208
+ negation_checkbox_title: Исключая строки
209
+ # link to switch to show all records
210
+ show_all_records_label: показать все
211
+ # tooltip for the link to switch to show all records
212
+ show_all_records_tooltip: Показать все записи
213
+ # Warning message shown when the user wants to switch to all-records mode
214
+ all_queries_warning: Вы уверены в том, что хотите отобразить все записи?
215
+ # link to paginated view
216
+ switch_back_to_paginated_mode_label: Назад к постраничному выводу
217
+ # tooltip for the link to paginated view
218
+ switch_back_to_paginated_mode_tooltip: Назад к постраничному выводу
219
+ # Title of the date string.
220
+ date_string_tooltip: Кликните, чтобы удалить дату
221
+ saved_query_panel_title: Сохранённые фильтры
222
+ save_query_button_label: Сохранить фильтр
223
+ saved_query_deletion_confirmation: Вы уверены?
224
+ saved_query_deletion_link_title: Удалить сохранённый фильтр
225
+ saved_query_link_title: Загрузить сохранённый фильтр
226
+ validates_uniqueness_error: Сохранённый фильтр с таким именем уже существует
227
+ validates_presence_error: Пожалуйста введите имя сохраняемого фильтра
228
+ query_deleted_message: Сохранённый фильтр удалён.
229
+ query_saved_message: Сохранённый фильтр сохранён.
230
+ select_all: Отметить все
231
+ deselect_all: Убрать выделение
232
+
233
+
234
+ pt:
235
+ date:
236
+ order:
237
+ - :year
238
+ - :month
239
+ - :day
240
+ wice_grid:
241
+ show_filter_tooltip: Mostrar o filtro
242
+ hide_filter_tooltip: Esconder o filtro
243
+ csv_export_tooltip: Exportar em CSV
244
+ filter_tooltip: Filtrar
245
+ reset_filter_tooltip: Reinicializar
246
+ boolean_filter_true_label: sim
247
+ boolean_filter_false_label: não
248
+ previous_label: « Página precedente
249
+ next_label: Página seguinte »
250
+ # Title of the icon clicking on which will show the calendar to set the FROM date.
251
+ date_selector_tooltip_from: De
252
+ # Title of the icon clicking on which will show the calendar to set the TO date.
253
+ date_selector_tooltip_to: a
254
+ # The title of the checkox to turn on negation
255
+ negation_checkbox_title: Excluir
256
+ # link to switch to show all records
257
+ show_all_records_label: Ver todos
258
+ # tooltip for the link to switch to show all records
259
+ show_all_records_tooltip: Ver todos os registos
260
+ # Warning message shown when the user wants to switch to all-records mode
261
+ all_queries_warning: Tem a certeza de querer visualizar todos os registos?
262
+ # link to paginated view
263
+ switch_back_to_paginated_mode_label: Retorno à vista paginada
264
+ # tooltip for the link to paginated view
265
+ switch_back_to_paginated_mode_tooltip: Retorno à vista por página
266
+ # Title of the date string.
267
+ date_string_tooltip: Cliquar para apagar
268
+ saved_query_panel_title: Queries gravadas
269
+ save_query_button_label: Gravar o estado dos filtros
270
+ saved_query_deletion_confirmation: Tem a certeza?
271
+ saved_query_deletion_link_title: Apagar a query
272
+ saved_query_link_title: Caregar a query
273
+ validates_uniqueness_error: Já existe uma query com o mesmo nome
274
+ validates_presence_error: Queira indicar o nome da query que deseja gravar
275
+ query_deleted_message: A query foi apagada.
276
+ query_saved_message: A query foi gravada.
277
+ # To do: translate
278
+ select_all: Select all
279
+ deselect_all: Remove selection