mongoid_wice_grid 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/.gitignore +9 -0
  2. data/CHANGELOG +409 -0
  3. data/Gemfile +17 -0
  4. data/Gemfile.lock +140 -0
  5. data/MIT-LICENSE +20 -0
  6. data/README.rdoc +1188 -0
  7. data/Rakefile +40 -0
  8. data/SAVED_QUERIES_HOWTO.rdoc +123 -0
  9. data/VERSION +1 -0
  10. data/lib/filter_conditions_generators.rb +126 -0
  11. data/lib/generators/wice_grid/templates/calendarview.css +107 -0
  12. data/lib/generators/wice_grid/templates/calendarview.js +1168 -0
  13. data/lib/generators/wice_grid/templates/icons/arrow_down.gif +0 -0
  14. data/lib/generators/wice_grid/templates/icons/arrow_up.gif +0 -0
  15. data/lib/generators/wice_grid/templates/icons/calendar_view_month.png +0 -0
  16. data/lib/generators/wice_grid/templates/icons/delete.png +0 -0
  17. data/lib/generators/wice_grid/templates/icons/expand.png +0 -0
  18. data/lib/generators/wice_grid/templates/icons/page_white_excel.png +0 -0
  19. data/lib/generators/wice_grid/templates/icons/page_white_find.png +0 -0
  20. data/lib/generators/wice_grid/templates/icons/table.png +0 -0
  21. data/lib/generators/wice_grid/templates/icons/table_refresh.png +0 -0
  22. data/lib/generators/wice_grid/templates/icons/tick_all.png +0 -0
  23. data/lib/generators/wice_grid/templates/icons/untick_all.png +0 -0
  24. data/lib/generators/wice_grid/templates/wice_grid.css +173 -0
  25. data/lib/generators/wice_grid/templates/wice_grid.yml +269 -0
  26. data/lib/generators/wice_grid/templates/wice_grid_config.rb +215 -0
  27. data/lib/generators/wice_grid/templates/wice_grid_jquery.js +161 -0
  28. data/lib/generators/wice_grid/templates/wice_grid_prototype.js +153 -0
  29. data/lib/generators/wice_grid/wice_grid_assets_jquery_generator.rb +32 -0
  30. data/lib/generators/wice_grid/wice_grid_assets_prototype_generator.rb +34 -0
  31. data/lib/grid_output_buffer.rb +52 -0
  32. data/lib/grid_renderer.rb +547 -0
  33. data/lib/helpers/js_calendar_helpers.rb +183 -0
  34. data/lib/helpers/wice_grid_misc_view_helpers.rb +113 -0
  35. data/lib/helpers/wice_grid_serialized_queries_view_helpers.rb +82 -0
  36. data/lib/helpers/wice_grid_view_helpers.rb +761 -0
  37. data/lib/js_adaptors/jquery_adaptor.rb +145 -0
  38. data/lib/js_adaptors/js_adaptor.rb +12 -0
  39. data/lib/js_adaptors/prototype_adaptor.rb +168 -0
  40. data/lib/mongoid_field.rb +50 -0
  41. data/lib/tasks/wice_grid_tasks.rake +28 -0
  42. data/lib/view_columns.rb +464 -0
  43. data/lib/views/create.rjs +13 -0
  44. data/lib/views/delete.rjs +12 -0
  45. data/lib/wice_grid.rb +521 -0
  46. data/lib/wice_grid_controller.rb +165 -0
  47. data/lib/wice_grid_core_ext.rb +179 -0
  48. data/lib/wice_grid_misc.rb +99 -0
  49. data/lib/wice_grid_serialized_queries_controller.rb +77 -0
  50. data/lib/wice_grid_serialized_query.rb +14 -0
  51. data/lib/wice_grid_spreadsheet.rb +33 -0
  52. data/test/.gitignore +2 -0
  53. data/test/blueprint.rb +17 -0
  54. data/test/database.yml +21 -0
  55. data/test/public/javascripts/jquery-1.4.2.min.js +154 -0
  56. data/test/public/javascripts/wice_grid.js +163 -0
  57. data/test/rails_mongoid_test.rb +104 -0
  58. data/test/rails_test_app.rb +71 -0
  59. data/test/require_gems.rb +19 -0
  60. data/test/schema.rb +33 -0
  61. data/test/spec_helper.rb +22 -0
  62. data/test/test_helper.rb +89 -0
  63. data/test/views/projects_and_people_grid.html.erb +12 -0
  64. data/test/views/projects_and_people_grid_invalid.html.erb +12 -0
  65. data/test/views/simple_projects_grid.html.erb +9 -0
  66. data/test/wice_grid_core_ext_test.rb +183 -0
  67. data/test/wice_grid_functional_test.rb +68 -0
  68. data/test/wice_grid_initializer.rb +215 -0
  69. data/test/wice_grid_misc_test.rb +41 -0
  70. data/test/wice_grid_test.rb +42 -0
  71. data/test/wice_grid_view_helper_test.rb +12 -0
  72. metadata +150 -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,269 @@
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
+
92
+ nl:
93
+ date:
94
+ order:
95
+ - :year
96
+ - :month
97
+ - :day
98
+ wice_grid:
99
+ show_filter_tooltip: Filter tonen
100
+ hide_filter_tooltip: Filter verbergen
101
+ csv_export_tooltip: Als CSV exporteren
102
+ filter_tooltip: Filter
103
+ reset_filter_tooltip: Terugstellen
104
+ boolean_filter_true_label: ja
105
+ boolean_filter_false_label: neen
106
+ previous_label: « Vorige
107
+ next_label: Volgende »
108
+ # Title of the icon clicking on which will show the calendar to set the FROM date.
109
+ date_selector_tooltip_from: Vanaf
110
+ # Title of the icon clicking on which will show the calendar to set the TO date.
111
+ date_selector_tooltip_to: Tot
112
+ # The title of the checkox to turn on negation
113
+ negation_checkbox_title: Uitsluiten
114
+ # link to switch to show all records
115
+ show_all_records_label: Alle rijen tonen
116
+ # tooltip for the link to switch to show all records
117
+ show_all_records_tooltip: Alle rijen tonen
118
+ # Warning message shown when the user wants to switch to all-records mode
119
+ all_queries_warning: Bent u zeker dat u alle rijen wilt tonen?
120
+ # link to paginated view
121
+ switch_back_to_paginated_mode_label: Terug naar pagina's
122
+ # tooltip for the link to paginated view
123
+ switch_back_to_paginated_mode_tooltip: Terug naar pagina's
124
+ # Title of the date string.
125
+ date_string_tooltip: Klik om te verwijderen
126
+ saved_query_panel_title: Opgeslagen query's
127
+ save_query_button_label: Query opslaan
128
+ saved_query_deletion_confirmation: Bent u zeker?
129
+ saved_query_deletion_link_title: Query verwijderen
130
+ saved_query_link_title: Query laden
131
+ validates_uniqueness_error: Deze query bestaat reeds
132
+ validates_presence_error: Gelieve de naam van de query in te vullen
133
+ query_deleted_message: Opgeslagen query verwijderd.
134
+ query_saved_message: Query opgeslagen
135
+
136
+ fr:
137
+ date:
138
+ order:
139
+ - :year
140
+ - :month
141
+ - :day
142
+ wice_grid:
143
+ show_filter_tooltip: Afficher le filtre
144
+ hide_filter_tooltip: Cacher le filtrer
145
+ csv_export_tooltip: Exporter en CSV
146
+ filter_tooltip: Filtrer
147
+ reset_filter_tooltip: Effacer
148
+ boolean_filter_true_label: oui
149
+ boolean_filter_false_label: non
150
+ previous_label: « Page précédente
151
+ next_label: Page suivante »
152
+ # Title of the icon clicking on which will show the calendar to set the FROM date.
153
+ date_selector_tooltip_from: De
154
+ # Title of the icon clicking on which will show the calendar to set the TO date.
155
+ date_selector_tooltip_to: à
156
+ # The title of the checkox to turn on negation
157
+ negation_checkbox_title: Exclure
158
+ # link to switch to show all records
159
+ show_all_records_label: Voir tous
160
+ # tooltip for the link to switch to show all records
161
+ show_all_records_tooltip: Voir tous les enregistrements
162
+ # Warning message shown when the user wants to switch to all-records mode
163
+ all_queries_warning: Etes-vous certain de vouloir afficher tous les enregistrements?
164
+ # link to paginated view
165
+ switch_back_to_paginated_mode_label: Retour à la vue paginée
166
+ # tooltip for the link to paginated view
167
+ switch_back_to_paginated_mode_tooltip: Retour à la vue par pages
168
+ # Title of the date string.
169
+ date_string_tooltip: Cliquez pour effacer
170
+ saved_query_panel_title: Requêtes sauvées
171
+ save_query_button_label: Sauver l'état des filtres
172
+ saved_query_deletion_confirmation: Etes vous sûr?
173
+ saved_query_deletion_link_title: Effacer la requête
174
+ saved_query_link_title: Charger la requête
175
+ validates_uniqueness_error: Un requête existante porte déjà ce nom
176
+ validates_presence_error: Veuillez indiquer le nom de la requête que vous souhaitez sauver
177
+ query_deleted_message: La requête a été effacée.
178
+ query_saved_message: La requête a été sauvée.
179
+
180
+ ru:
181
+ date:
182
+ order:
183
+ - :year
184
+ - :month
185
+ - :day
186
+ wice_grid:
187
+ show_filter_tooltip: Показать фильтр
188
+ hide_filter_tooltip: Спрятать фильтр
189
+ csv_export_tooltip: Экспорт в CSV
190
+ filter_tooltip: Фильтровать
191
+ reset_filter_tooltip: Сброс
192
+ boolean_filter_true_label: да
193
+ boolean_filter_false_label: нет
194
+ previous_label: « Предыдущая
195
+ next_label: Следующая »
196
+ # Title of the icon clicking on which will show the calendar to set the FROM date.
197
+ date_selector_tooltip_from: С
198
+ # Title of the icon clicking on which will show the calendar to set the TO date.
199
+ date_selector_tooltip_to: До
200
+ # The title of the checkox to turn on negation
201
+ negation_checkbox_title: Исключая строки
202
+ # link to switch to show all records
203
+ show_all_records_label: показать все
204
+ # tooltip for the link to switch to show all records
205
+ show_all_records_tooltip: Показать все записи
206
+ # Warning message shown when the user wants to switch to all-records mode
207
+ all_queries_warning: Вы уверены в том, что хотите отобразить все записи?
208
+ # link to paginated view
209
+ switch_back_to_paginated_mode_label: Назад к постраничному выводу
210
+ # tooltip for the link to paginated view
211
+ switch_back_to_paginated_mode_tooltip: Назад к постраничному выводу
212
+ # Title of the date string.
213
+ date_string_tooltip: Кликните, чтобы удалить дату
214
+ saved_query_panel_title: Сохранённые фильтры
215
+ save_query_button_label: Сохранить фильтр
216
+ saved_query_deletion_confirmation: Вы уверены?
217
+ saved_query_deletion_link_title: Удалить сохранённый фильтр
218
+ saved_query_link_title: Загрузить сохранённый фильтр
219
+ validates_uniqueness_error: Сохранённый фильтр с таким именем уже существует
220
+ validates_presence_error: Пожалуйста введите имя сохраняемого фильтра
221
+ query_deleted_message: Сохранённый фильтр удалён.
222
+ query_saved_message: Сохранённый фильтр сохранён.
223
+ select_all: Отметить все
224
+ deselect_all: Убрать выделение
225
+
226
+
227
+ pt:
228
+ date:
229
+ order:
230
+ - :year
231
+ - :month
232
+ - :day
233
+ wice_grid:
234
+ show_filter_tooltip: Mostrar o filtro
235
+ hide_filter_tooltip: Esconder o filtro
236
+ csv_export_tooltip: Exportar em CSV
237
+ filter_tooltip: Filtrar
238
+ reset_filter_tooltip: Reinicializar
239
+ boolean_filter_true_label: sim
240
+ boolean_filter_false_label: não
241
+ previous_label: « Página precedente
242
+ next_label: Página seguinte »
243
+ # Title of the icon clicking on which will show the calendar to set the FROM date.
244
+ date_selector_tooltip_from: De
245
+ # Title of the icon clicking on which will show the calendar to set the TO date.
246
+ date_selector_tooltip_to: a
247
+ # The title of the checkox to turn on negation
248
+ negation_checkbox_title: Excluir
249
+ # link to switch to show all records
250
+ show_all_records_label: Ver todos
251
+ # tooltip for the link to switch to show all records
252
+ show_all_records_tooltip: Ver todos os registos
253
+ # Warning message shown when the user wants to switch to all-records mode
254
+ all_queries_warning: Tem a certeza de querer visualizar todos os registos?
255
+ # link to paginated view
256
+ switch_back_to_paginated_mode_label: Retorno à vista paginada
257
+ # tooltip for the link to paginated view
258
+ switch_back_to_paginated_mode_tooltip: Retorno à vista por página
259
+ # Title of the date string.
260
+ date_string_tooltip: Cliquar para apagar
261
+ saved_query_panel_title: Queries gravadas
262
+ save_query_button_label: Gravar o estado dos filtros
263
+ saved_query_deletion_confirmation: Tem a certeza?
264
+ saved_query_deletion_link_title: Apagar a query
265
+ saved_query_link_title: Caregar a query
266
+ validates_uniqueness_error: Já existe uma query com o mesmo nome
267
+ validates_presence_error: Queira indicar o nome da query que deseja gravar
268
+ query_deleted_message: A query foi apagada.
269
+ query_saved_message: A query foi gravada.