widget_list 1.3.4 → 1.3.5

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 (47) hide show
  1. data/.gitignore +35 -35
  2. data/Gemfile +3 -3
  3. data/LICENSE.txt +21 -21
  4. data/README.md +736 -728
  5. data/Rakefile +1 -1
  6. data/app/views/widget_list/_condition_fields.html.erb +0 -0
  7. data/app/views/widget_list/_ransack_fields.html.erb +0 -0
  8. data/app/views/widget_list/_ransack_widget_list_advanced_search.html.erb +0 -0
  9. data/app/views/widget_list/administration/_button_row.html.erb +13 -13
  10. data/app/views/widget_list/administration/_checkbox_row.html.erb +18 -18
  11. data/app/views/widget_list/administration/_field_row.html.erb +11 -11
  12. data/app/views/widget_list/administration/_output.html.erb +1100 -1100
  13. data/app/views/widget_list/administration/_output_save.html.erb +1 -1
  14. data/app/views/widget_list/list_partials/_col.html.erb +0 -0
  15. data/app/views/widget_list/list_partials/_list_description.html.erb +2 -2
  16. data/app/views/widget_list/list_partials/_no_sort_column.html.erb +0 -0
  17. data/app/views/widget_list/list_partials/_outer_shell.html.erb +0 -0
  18. data/app/views/widget_list/list_partials/_pagination_jump_active.html.erb +0 -0
  19. data/app/views/widget_list/list_partials/_pagination_jump_unactive.html.erb +0 -0
  20. data/app/views/widget_list/list_partials/_pagination_next_active.html.erb +0 -0
  21. data/app/views/widget_list/list_partials/_pagination_next_disabled.html.erb +0 -0
  22. data/app/views/widget_list/list_partials/_pagination_previous_active.html.erb +0 -0
  23. data/app/views/widget_list/list_partials/_pagination_previous_disabled.html.erb +0 -0
  24. data/app/views/widget_list/list_partials/_pagination_wrapper.html.erb +0 -0
  25. data/app/views/widget_list/list_partials/_row.html.erb +0 -0
  26. data/app/views/widget_list/list_partials/_sequence.html.erb +0 -0
  27. data/app/views/widget_list/list_partials/_sort_column.html.erb +0 -0
  28. data/checkin_gem.sh +0 -0
  29. data/lib/extensions/action_controller_base.rb +33 -33
  30. data/lib/widget_list.rb +4685 -4389
  31. data/lib/widget_list/engine.rb +8 -8
  32. data/lib/widget_list/hash.rb +113 -113
  33. data/lib/widget_list/md5.rb +18 -18
  34. data/lib/widget_list/railtie.rb +42 -42
  35. data/lib/widget_list/sequel.rb +287 -218
  36. data/lib/widget_list/string.rb +41 -41
  37. data/lib/widget_list/tpl.rb +185 -185
  38. data/lib/widget_list/utils.rb +92 -92
  39. data/lib/widget_list/version.rb +3 -3
  40. data/lib/widget_list/widgets.rb +756 -756
  41. data/publish_gem.sh +37 -37
  42. data/vendor/assets/images/gobblecons/README.rtf +127 -127
  43. data/vendor/assets/javascripts/widget_list.js +795 -795
  44. data/vendor/assets/stylesheets/widget_list.css +813 -813
  45. data/vendor/assets/stylesheets/widgets.css +116 -116
  46. data/widget_list.gemspec +38 -38
  47. metadata +63 -54
data/Rakefile CHANGED
@@ -1 +1 @@
1
- require "bundler/gem_tasks"
1
+ require "bundler/gem_tasks"
@@ -1,14 +1,14 @@
1
- <tr>
2
- <td>
3
- <!--TEXT_DESC-->:&#160;<input type="text" class="<!--SUBJECT-->_<!--TEXT_KEY-->" style="width:170px" onblur="jQuery(this).attr('value',jQuery(this).val().trim());<!--ONBLUR1-->" name="<!--SUBJECT-->[<!--TEXT_KEY-->][]" id="<!--SUBJECT-->[<!--TEXT_KEY-->][]" value="<!--BUTTON_TEXT-->"/><%= raw WidgetList::Widgets::widget_button('?', {'onclick' => "alert('<!--TEXT_HELP-->')", 'innerClass' => "default <!--SUBJECT-->_<!--TEXT_KEY-->_button" }, true ) %>
4
- </td>
5
- <td>
6
- <!--URL_DESC-->:&#160;<input type="text" class="<!--SUBJECT-->_<!--URL_KEY-->" style="width:170px" onblur="jQuery(this).attr('value',jQuery(this).val().trim());<!--ONBLUR2-->" name="<!--SUBJECT-->[<!--URL_KEY-->][]" id="<!--SUBJECT-->[<!--URL_KEY-->][]" value="<!--BUTTON_URL-->"/><%= raw WidgetList::Widgets::widget_button('?', {'onclick' => "alert('<!--2_HELP->')", 'innerClass' => "default <!--SUBJECT-->_<!--URL_KEY-->_button" }, true ) %>
7
- </td>
8
- <td>
9
- <!--COLOR_DESC-->:&#160;<input type="text" class="<!--SUBJECT-->_<!--COLOR_KEY-->" style="width:170px" onblur="jQuery(this).attr('value',jQuery(this).val().trim());<!--ONBLUR3-->" name="<!--SUBJECT-->[<!--COLOR_KEY-->][]" id="<!--SUBJECT-->[<!--COLOR_KEY-->][]" value="<!--BUTTON_CLASS-->"/><%= raw WidgetList::Widgets::widget_button('?', {'onclick' => "alert('<!--COLOR_HELP-->')", 'innerClass' => "default <!--SUBJECT-->_<!--COLOR_KEY-->_button" }, true ) %>
10
- </td>
11
- <td>
12
- <!--REMOVE_FIELD_BUTTON-->
13
- </td>
1
+ <tr>
2
+ <td>
3
+ <!--TEXT_DESC-->:&#160;<input type="text" class="<!--SUBJECT-->_<!--TEXT_KEY-->" style="width:170px" onblur="jQuery(this).attr('value',jQuery(this).val().trim());<!--ONBLUR1-->" name="<!--SUBJECT-->[<!--TEXT_KEY-->][]" id="<!--SUBJECT-->[<!--TEXT_KEY-->][]" value="<!--BUTTON_TEXT-->"/><%= raw WidgetList::Widgets::widget_button('?', {'onclick' => "alert('<!--TEXT_HELP-->')", 'innerClass' => "default <!--SUBJECT-->_<!--TEXT_KEY-->_button" }, true ) %>
4
+ </td>
5
+ <td>
6
+ <!--URL_DESC-->:&#160;<input type="text" class="<!--SUBJECT-->_<!--URL_KEY-->" style="width:170px" onblur="jQuery(this).attr('value',jQuery(this).val().trim());<!--ONBLUR2-->" name="<!--SUBJECT-->[<!--URL_KEY-->][]" id="<!--SUBJECT-->[<!--URL_KEY-->][]" value="<!--BUTTON_URL-->"/><%= raw WidgetList::Widgets::widget_button('?', {'onclick' => "alert('<!--2_HELP->')", 'innerClass' => "default <!--SUBJECT-->_<!--URL_KEY-->_button" }, true ) %>
7
+ </td>
8
+ <td>
9
+ <!--COLOR_DESC-->:&#160;<input type="text" class="<!--SUBJECT-->_<!--COLOR_KEY-->" style="width:170px" onblur="jQuery(this).attr('value',jQuery(this).val().trim());<!--ONBLUR3-->" name="<!--SUBJECT-->[<!--COLOR_KEY-->][]" id="<!--SUBJECT-->[<!--COLOR_KEY-->][]" value="<!--BUTTON_CLASS-->"/><%= raw WidgetList::Widgets::widget_button('?', {'onclick' => "alert('<!--COLOR_HELP-->')", 'innerClass' => "default <!--SUBJECT-->_<!--COLOR_KEY-->_button" }, true ) %>
10
+ </td>
11
+ <td>
12
+ <!--REMOVE_FIELD_BUTTON-->
13
+ </td>
14
14
  </tr>
@@ -1,18 +1,18 @@
1
- <tr style="<!--CHECKBOX_STYLE-->">
2
- <td style="padding-left:100px">
3
- <!--1_DESC-->:&#160;
4
- <input type="hidden" name="<!--SUBJECT-->[<!--1_KEY-->][]" id="<!--SUBJECT-->[<!--1_KEY-->][]" value="<!--1_VALUE-->"/>
5
- <input type="checkbox" class="<!--SUBJECT-->_<!--1_KEY-->" onchange="FakeCheck(this);" name="<!--SUBJECT-->_fake[<!--1_KEY-->][]" id="<!--SUBJECT-->_fake[<!--1_KEY-->][]" <!--1_VALUE-->/>
6
-
7
- </td>
8
- <td>
9
- <!--2_DESC-->:&#160;<input type="hidden" name="<!--SUBJECT-->[<!--2_KEY-->][]" id="<!--SUBJECT-->[<!--2_KEY-->][]" value="<!--2_VALUE-->"/>
10
- <input type="checkbox" class="<!--SUBJECT-->_<!--2_KEY-->" onchange="FakeCheck(this);" name="<!--SUBJECT-->_fake[<!--2_KEY-->][]" id="<!--SUBJECT-->_fake[<!--2_KEY-->][]" <!--2_VALUE-->/>
11
- <%= raw WidgetList::Widgets::widget_button('?', {'onclick' => "alert('<!--2_HELP-->')", 'innerClass' => "default" }, true ) %>
12
- </td>
13
- <td>
14
- <!--3_DESC-->:&#160;
15
- <input type="hidden" name="<!--SUBJECT-->[<!--3_KEY-->][]" id="<!--SUBJECT-->[<!--3_KEY-->][]" value="<!--3_VALUE-->"/>
16
- <input type="checkbox" class="<!--SUBJECT-->_<!--3_KEY-->" onchange="FakeCheck(this);" name="<!--SUBJECT-->_fake[<!--3_KEY-->][]" id="<!--SUBJECT-->_fake[<!--3_KEY-->][]" <!--3_VALUE-->/>
17
- </td>
18
- </tr>
1
+ <tr style="<!--CHECKBOX_STYLE-->">
2
+ <td style="padding-left:100px">
3
+ <!--1_DESC-->:&#160;
4
+ <input type="hidden" name="<!--SUBJECT-->[<!--1_KEY-->][]" id="<!--SUBJECT-->[<!--1_KEY-->][]" value="<!--1_VALUE-->"/>
5
+ <input type="checkbox" class="<!--SUBJECT-->_<!--1_KEY-->" onchange="FakeCheck(this);" name="<!--SUBJECT-->_fake[<!--1_KEY-->][]" id="<!--SUBJECT-->_fake[<!--1_KEY-->][]" <!--1_VALUE-->/>
6
+
7
+ </td>
8
+ <td>
9
+ <!--2_DESC-->:&#160;<input type="hidden" name="<!--SUBJECT-->[<!--2_KEY-->][]" id="<!--SUBJECT-->[<!--2_KEY-->][]" value="<!--2_VALUE-->"/>
10
+ <input type="checkbox" class="<!--SUBJECT-->_<!--2_KEY-->" onchange="FakeCheck(this);" name="<!--SUBJECT-->_fake[<!--2_KEY-->][]" id="<!--SUBJECT-->_fake[<!--2_KEY-->][]" <!--2_VALUE-->/>
11
+ <%= raw WidgetList::Widgets::widget_button('?', {'onclick' => "alert('<!--2_HELP-->')", 'innerClass' => "default" }, true ) %>
12
+ </td>
13
+ <td>
14
+ <!--3_DESC-->:&#160;
15
+ <input type="hidden" name="<!--SUBJECT-->[<!--3_KEY-->][]" id="<!--SUBJECT-->[<!--3_KEY-->][]" value="<!--3_VALUE-->"/>
16
+ <input type="checkbox" class="<!--SUBJECT-->_<!--3_KEY-->" onchange="FakeCheck(this);" name="<!--SUBJECT-->_fake[<!--3_KEY-->][]" id="<!--SUBJECT-->_fake[<!--3_KEY-->][]" <!--3_VALUE-->/>
17
+ </td>
18
+ </tr>
@@ -1,12 +1,12 @@
1
- <tr style="<!--TR_STYLE-->">
2
- <td style="<!--TR1_STYLE-->">
3
- <!--FIELD-->:&#160;<input type="text" style="width:350px" class="<!--SUBJECT-->_keys" onblur="jQuery(this).attr('value',jQuery(this).val().trim());<!--ONBLUR1-->" name="<!--SUBJECT-->[key][]" id="<!--SUBJECT-->[key][]" value="<!--FIELD_VALUE-->"/>
4
- </td>
5
- <td>
6
- <!--DESC-->:&#160;<input <!--DISABLED--> type="text" style="width:350px" class="<!--SUBJECT-->_descriptions" onblur="jQuery(this).attr('value',jQuery(this).val().trim());<!--ONBLUR2-->" name="<!--SUBJECT-->[description][]" id="<!--SUBJECT-->[description][]" value="<!--FIELD_DESC-->"/>
7
- </td>
8
- <td>
9
- <!--REMOVE_FIELD_BUTTON-->
10
- </td>
11
- </tr>
1
+ <tr style="<!--TR_STYLE-->">
2
+ <td style="<!--TR1_STYLE-->">
3
+ <!--FIELD-->:&#160;<input type="text" style="width:350px" class="<!--SUBJECT-->_keys" onblur="jQuery(this).attr('value',jQuery(this).val().trim());<!--ONBLUR1-->" name="<!--SUBJECT-->[key][]" id="<!--SUBJECT-->[key][]" value="<!--FIELD_VALUE-->"/>
4
+ </td>
5
+ <td>
6
+ <!--DESC-->:&#160;<input <!--DISABLED--> type="text" style="width:350px" class="<!--SUBJECT-->_descriptions" onblur="jQuery(this).attr('value',jQuery(this).val().trim());<!--ONBLUR2-->" name="<!--SUBJECT-->[description][]" id="<!--SUBJECT-->[description][]" value="<!--FIELD_DESC-->"/>
7
+ </td>
8
+ <td>
9
+ <!--REMOVE_FIELD_BUTTON-->
10
+ </td>
11
+ </tr>
12
12
  <!--EXTRA-->
@@ -1,1101 +1,1101 @@
1
- <style type="text/css">
2
- input[type="text"] {
3
- font-size:25px;
4
- height:33px;
5
- left:0;
6
- line-height:33px;
7
- padding:8px 8px 7px;
8
- top:0;
9
- width:600px;
10
- }
11
-
12
- select {
13
- font-size:25px;
14
- height:50px;
15
- left:0;
16
- line-height:33px;
17
- top:0;
18
- width:600px;
19
- }
20
-
21
- .misc_keys, .misc_descriptions, .misc_links {
22
- font-size:14px !important;
23
- height:15px !important;
24
- left:0 !important;
25
- line-height:14px !important;
26
- width:200px !important;
27
- }
28
-
29
- .buttons_drill_down_name_button {
30
- margin-right: 70px;
31
- }
32
-
33
- .buttons_data_to_pass_from_view_button {
34
- margin-right: 120px;
35
- }
36
- </style>
37
-
38
- <script type="text/javascript">
39
- var all = '.init,.start,.fields,.rows,.search,.footer,.misc_submit';
40
- var all_btns = '#start,#fields,#rows,#search,#footer,#misc_submit';
41
- jQuery(document).ready(function () {
42
- if (jQuery('#view').val() != '') {
43
- jQuery(all_btns).removeClass('disabled');
44
- }
45
- if (jQuery('#preview').attr('src') == '') {
46
- jQuery('#preview').hide();
47
- } else {
48
- jQuery('#preview').show();
49
- }
50
-
51
- window.onbeforeunload = function (evt) {
52
- var message = 'Are you sure you want to abandon this widget_list implementation? Doing so will lose all your work?';
53
- if (typeof evt == 'undefined') {
54
- evt = window.event;
55
- }
56
-
57
- if (evt) {
58
- evt.returnValue = message;
59
- }
60
- if (!isSubmitting) {
61
- return message;
62
- }
63
- }
64
-
65
- });
66
-
67
- function VerifyOK(func_name) {
68
- var ok = true;
69
- if (jQuery('#view').val() == '') {
70
- ok = false;
71
- alert('Please select a Model to use as your base widget_list');
72
- }
73
- else if (jQuery('#rowLimit').val() != '10' && jQuery('#rowLimit').val() != '20' && jQuery('#rowLimit').val() != '50' && jQuery('#rowLimit').val() != '100' && jQuery('#rowLimit').val() != '500' && jQuery('#rowLimit').val() != '1000') {
74
- ok = false;
75
- alert('Invalid Row Limit, please see help button.');
76
- }
77
- return ok;
78
- }
79
-
80
- function ClickTab(which_class,func_name,by_pass) {
81
- if (typeof by_pass == 'undefined') {
82
- var by_pass = false;
83
- }
84
- if (by_pass || VerifyOK(func_name)) {
85
- jQuery('.search_dependent').hide(0,function() {
86
- jQuery(all).hide(0,function() {
87
- jQuery(which_class).fadeIn(0,function() {
88
- if (func_name == 'ShowSearch') {
89
- ShowSearchOptions(function() {
90
- ShowGroupingOptions();
91
- ShowExportOptions();
92
-
93
- });
94
- }
95
- if (func_name == 'ShowFields') {
96
- ShowHiddenOptions();
97
- ShowFunctionOptions();
98
- }
99
- if (func_name == 'ShowSubmit') {
100
- ShowCheckboxOptions();
101
- }
102
- if (func_name == 'ShowRows') {
103
- ShowButtonOptions();
104
- ShowDrillDownOptions();
105
- }
106
- if (func_name == 'ShowFooter') {
107
- ShowFooterOptions();
108
- }
109
- });
110
- });
111
- });
112
-
113
- if (!by_pass) {
114
- SaveChanges();
115
- }
116
-
117
- }
118
- }
119
-
120
- function ShowStart() {
121
- ClickTab('.start',arguments.callee.name);
122
- }
123
-
124
- function ShowFields() {
125
- ClickTab('.fields',arguments.callee.name);
126
- }
127
-
128
- function ShowRows() {
129
- ClickTab('.rows',arguments.callee.name);
130
- }
131
-
132
- function ShowSearch() {
133
- ClickTab('.search',arguments.callee.name);
134
- }
135
-
136
- function ShowFooter() {
137
- ClickTab('.footer',arguments.callee.name);
138
- }
139
-
140
- function ShowSubmit() {
141
- ClickTab('.misc_submit',arguments.callee.name);
142
- }
143
-
144
- function ReplaceColumnsToLinked(obj) {
145
- found = false;
146
- var className = obj.className;
147
- jQuery(obj).css('background-color','white');
148
- jQuery('.fields_keys, .fields_hidden_keys, .fields_function_keys').each(
149
- function(key, value) {
150
- if(jQuery(value).val() == jQuery(obj).val().trim() && jQuery(obj).val().search(/_linked/i) == -1) {
151
- found = true;
152
- var id_original = jQuery(obj).val().trim();
153
- jQuery(value).val(jQuery(obj).val().trim() + '_linked');
154
- jQuery(obj).val(jQuery(obj).val().trim() + '_linked');
155
- jQuery(obj).attr('value',jQuery(this).val().trim());
156
- if (className == 'drill_downs_data_to_pass_from_view') {
157
- jQuery('.drill_downs_column_to_show[value="col_name"]').each(
158
- function(key1, value1) {
159
- jQuery(value1).val(jQuery(obj).val().trim());
160
- jQuery(value1).attr('value',jQuery(value1).val().trim());
161
- return false;
162
- }
163
- )
164
- } else {
165
- jQuery('.drill_downs_data_to_pass_from_view[value="col_name"]').each(
166
- function(key1, value1) {
167
- jQuery(value1).val(jQuery(obj).val().trim());
168
- jQuery(value1).attr('value',jQuery(value1).val().trim());
169
- return false;
170
- }
171
- )
172
- }
173
-
174
- jQuery('.drill_downs_drill_down_name[value="filter_col_name"]').each(
175
- function(key1, value1) {
176
- jQuery(value1).val('filter_by_' + id_original);
177
- jQuery(value1).attr('value','filter_by_' + id_original);
178
- return false;
179
- }
180
- )
181
-
182
-
183
- jQuery('#showHidden').attr('checked',true);
184
- AddHiddenField();
185
- jQuery('.fields_hidden_keys[value=""]').each(
186
- function(key1, value1) {
187
- jQuery(value1).val(id_original);
188
- jQuery(value1).attr('value',id_original);
189
- return false;
190
- }
191
- );
192
- }
193
- }
194
- );
195
-
196
- if (!found && jQuery(obj).val().search(/_linked/i) == -1) {
197
- alert('Invalid Field Name defined. Please change the value');
198
- jQuery(obj).css('background-color','red');
199
- }
200
- }
201
-
202
- function InvalidField(obj) {
203
- found = false;
204
- jQuery(obj).css('background-color','white');
205
- jQuery('.fields_keys, .fields_hidden_keys, .fields_function_keys').each(
206
- function(key, value) {
207
- if(jQuery(value).val() == jQuery(obj).val().trim()) {
208
- found = true;
209
- }
210
- }
211
- );
212
-
213
- if (!found) {
214
- alert('Invalid Field Name defined. Please change the value');
215
- jQuery(obj).css('background-color','red');
216
- }
217
- }
218
-
219
- function GoodClass(obj) {
220
- found = false;
221
- jQuery(obj).css('background-color','white');
222
- if (jQuery(obj).val() == 'primary' || jQuery(obj).val() == 'info' || jQuery(obj).val() == 'success' || jQuery(obj).val() == 'danger' || jQuery(obj).val() == 'disabled' || jQuery(obj).val() == 'default') {
223
- found = true;
224
- }
225
- if (!found) {
226
- alert('Invalid Class Name. Click Help icon for more information.');
227
- jQuery(obj).css('background-color','red');
228
- }
229
- }
230
-
231
-
232
- function ShowSearchOptions(callback) {
233
- if (jQuery('#showSearch').is(':checked')) {
234
- jQuery('.search_dependent').show();
235
- } else {
236
- jQuery('.search_dependent').hide();
237
- }
238
- if (typeof(callback) == 'function') {
239
- (callback)();
240
- }
241
- }
242
-
243
- function ShowGroupingOptions() {
244
- if (jQuery('#useGrouping').is(':checked') && jQuery('#showSearch').is(':checked')) {
245
- jQuery('.grouping_dependent').show();
246
- } else {
247
- jQuery('.grouping_dependent').hide();
248
- }
249
- }
250
-
251
- function ShowRansackOptions() {
252
- if (jQuery('#useRansack').is(':checked') && jQuery('#showSearch').is(':checked')) {
253
- jQuery('.ransack_dependent').show();
254
- } else {
255
- jQuery('.ransack_dependent').hide();
256
- }
257
- }
258
-
259
- function ShowFooterOptions() {
260
- if (jQuery('#footerOn').is(':checked')) {
261
- jQuery('.footer_dependent').show();
262
- } else {
263
- jQuery('.footer_dependent').hide();
264
- }
265
- }
266
-
267
- function ShowExportOptions() {
268
- if (jQuery('#showExport').is(':checked') && jQuery('#showSearch').is(':checked')) {
269
- jQuery('.export_dependent').show();
270
- } else {
271
- jQuery('.export_dependent').hide();
272
- }
273
- }
274
-
275
- function ShowHiddenOptions() {
276
- if (jQuery('#showHidden').is(':checked')) {
277
- if (jQuery('.fields_hidden_keys').length == 0) {
278
- AddHiddenField();
279
- }
280
- jQuery('.hidden_fields_dependent').show();
281
- } else {
282
- jQuery('.hidden_fields_dependent').hide();
283
- }
284
- }
285
-
286
- function ShowButtonOptions() {
287
- if (jQuery('#rowButtonsOn').is(':checked')) {
288
- jQuery('.button_dependent').show();
289
- } else {
290
- jQuery('.button_dependent').hide();
291
- }
292
- }
293
- function ShowDrillDownOptions() {
294
- if (jQuery('#drillDownsOn').is(':checked')) {
295
- if (jQuery('.drill_downs_data_to_pass_from_view').length == 0) {
296
- AddDrillDown();
297
- }
298
- jQuery('.drill_down_dependent').show();
299
- } else {
300
- jQuery('.drill_down_dependent').hide();
301
- }
302
- }
303
-
304
- function ShowFunctionOptions() {
305
- if (jQuery('#fieldFunctionOn').is(':checked')) {
306
- if (jQuery('.fields_function_keys').length == 0) {
307
- AddFieldFunction();
308
- }
309
- jQuery('.function_dependent').show();
310
- } else {
311
- jQuery('.function_dependent').hide();
312
- }
313
- }
314
-
315
- function ShowCheckboxOptions() {
316
- if (jQuery('#checkboxEnabled').is(':checked')) {
317
- jQuery('.checkbox_dependent').show();
318
- } else {
319
- jQuery('.checkbox_dependent').hide();
320
- }
321
- }
322
-
323
- function AddGroupingItem() {
324
- jQuery('#grouping_items').html(jQuery('#grouping_items').html() + jQuery('#grouping_items_default').html());
325
- }
326
-
327
- function AddField() {
328
- jQuery('#field_table').html(jQuery('#field_table').html() + jQuery('#default_field_template').html());
329
- }
330
-
331
- function AddGroupBy() {
332
- jQuery('#grouping_table').html(jQuery('#grouping_table').html() + jQuery('#default_grouping_template').html());
333
- }
334
-
335
- function AddButton() {
336
- jQuery('#button_table').html(jQuery('#button_table').html() + jQuery('#default_button_template').html());
337
- jQuery('.buttons_url').last().val('/' + jQuery('#desiredController').val());
338
- }
339
-
340
- function AddDrillDown() {
341
- jQuery('#drill_down_table').html(jQuery('#drill_down_table').html() + jQuery('#default_drill_down_template').html());
342
- }
343
-
344
- function AddFooterButton() {
345
- jQuery('#footer_table').html(jQuery('#footer_table').html() + jQuery('#default_footer_template').html());
346
- jQuery('.footer_buttons_url').last().val('/' + jQuery('#desiredController').val());
347
- }
348
-
349
- function AddHiddenField() {
350
- jQuery('#hidden_field_table').html(jQuery('#hidden_field_table').html() + jQuery('#default_hidden_field_template').html());
351
- }
352
-
353
- function AddFieldFunction() {
354
- jQuery('#field_function_table').html(jQuery('#field_function_table').html() + jQuery('#default_field_function_template').html());
355
- }
356
-
357
- function FakeCheck(obj) {
358
- jQuery(obj).siblings('input[type="hidden"]').val(jQuery(obj).is(':checked') ? 'checked' : '')
359
- }
360
-
361
- function RemoveField(obj) {
362
- var isHiddenRemoval = false;
363
- if (jQuery(obj).parent().parent().find('input.fields_hidden_keys').length > 0) {
364
- isHiddenRemoval = true;
365
- }
366
- var isFunctionRemoval = false;
367
- if (jQuery(obj).parent().parent().find('input.fields_function_keys').length > 0) {
368
- isFunctionRemoval = true;
369
- }
370
-
371
- var tr1 = jQuery(obj).closest('tr');
372
-
373
-
374
-
375
- var tr2 = tr1.next();
376
- var tr3 = tr2.next();
377
-
378
- tr1.remove();
379
-
380
- if (tr1.find('.fields_keys').length == 1) {
381
- // Remove options TR's
382
- tr2.remove();
383
- tr3.remove();
384
- }
385
-
386
- if (isHiddenRemoval && jQuery('.fields_hidden_keys').length == 0) {
387
- if (jQuery('#showHidden').is(':checked')) {
388
- jQuery('#showHidden').attr('checked',false);
389
- }
390
- jQuery('.hidden_fields_dependent').hide();
391
- }
392
- if (isFunctionRemoval && jQuery('.fields_function_keys').length == 0) {
393
- if (jQuery('#fieldFunctionOn').is(':checked')) {
394
- jQuery('#fieldFunctionOn').attr('checked',false);
395
- }
396
- jQuery('.function_dependent').hide();
397
- }
398
- }
399
-
400
- function MoveField(obj) {
401
-
402
- var field_name = jQuery(obj).parent().parent().find('input.fields_keys').val();
403
- RemoveField(obj);
404
- if (jQuery('#showHidden').not(':checked')) {
405
- jQuery('#showHidden').attr('checked',true);
406
- }
407
- AddHiddenField();
408
- jQuery('.hidden_fields_dependent').show();
409
- jQuery('.fields_hidden_keys[value=""]').each(
410
- function(key1, value1) {
411
- jQuery(value1).val(field_name);
412
- jQuery(value1).attr('value',field_name);
413
- return false;
414
- }
415
- );
416
- }
417
-
418
- function ShowOptions(obj) {
419
- var tr = jQuery(obj).closest('tr').next();
420
- var tr2 = tr.next();
421
- if (tr2.not(':visible') && tr.is(':visible')) {
422
- tr2.show();
423
- tr.show();
424
- }
425
- if (tr.not(':visible') && tr2.is(':visible')) {
426
- tr.show();
427
- tr2.show();
428
- }
429
- if (tr.not(':visible') && tr2.not(':visible')) {
430
- tr.toggle();
431
- tr2.toggle();
432
- }
433
- }
434
-
435
- function AddFunction(obj) {
436
-
437
- var field_name = jQuery(obj).parent().parent().find('input.fields_keys').val();
438
-
439
- if (jQuery('#fieldFunctionOn').not(':checked')) {
440
- jQuery('#fieldFunctionOn').attr('checked',true);
441
- }
442
- var objExists = '.fields_function_keys[value="' + field_name + '"]';
443
- if (jQuery(objExists).length > 0) {
444
- alert('Field Function for ' + field_name + ' already exists, please modify');
445
- jQuery(objExists).css('background-color','pink');
446
- } else {
447
- AddFieldFunction();
448
- jQuery('.function_dependent').show();
449
- jQuery('.fields_function_keys[value=""]').each(
450
- function(key1, value1) {
451
- jQuery(value1).val(field_name);
452
- jQuery(value1).attr('value',field_name);
453
- return false;
454
- }
455
- );
456
- jQuery('.fields_function_descriptions[value=""]').each(
457
- function(key1, value1) {
458
- var out = 'DB_FUNC(' + field_name + ')';
459
- jQuery(value1).val(out);
460
- jQuery(value1).attr('value',out);
461
- return false;
462
- }
463
- );
464
- }
465
- }
466
-
467
- function ShowField(obj) {
468
-
469
- var field_name = jQuery(obj).parent().parent().find('input.fields_hidden_keys').val();
470
- RemoveField(obj);
471
- AddField();
472
- jQuery('.fields_keys[value=""]').each(
473
- function(key1, value1) {
474
- jQuery(value1).val(field_name);
475
- jQuery(value1).attr('value',field_name);
476
- return false;
477
- }
478
- );
479
- jQuery('.fields_descriptions[value=""]').each(
480
- function(key1, value1) {
481
- jQuery(value1).val(field_name);
482
- jQuery(value1).attr('value',field_name);
483
- return false;
484
- }
485
- );
486
-
487
-
488
- if (jQuery('#showHidden').is(':checked') && jQuery('.fields_hidden_keys').length == 0) {
489
- jQuery('#showHidden').attr('checked',false);
490
- }
491
- if (jQuery('.fields_hidden_keys').length == 0) {
492
- jQuery('.hidden_fields_dependent').hide();
493
- }
494
- }
495
-
496
- function ChangeViewModel(obj) {
497
- jQuery(all_btns).addClass('disabled');
498
- if(jQuery(obj).val() != '') {
499
- jQuery.post(jQuery('#widget_list_administration').attr('action'), 'ajax=1&model=' + jQuery(obj).val(), function(response)
500
- {
501
- jQuery('#name').val(jQuery(obj).val().toLowerCase() + '_listing');
502
- jQuery('#field_table').html(response['fields']);
503
- jQuery('#hidden_field_table').html(response['fields_hidden']);
504
- jQuery('#checkboxField').html(response['checked_fields']);
505
- jQuery('#footer_table').html(response['footer_buttons']);
506
- jQuery('#grouping_table').html(response['group_by']);
507
- SaveChanges();
508
- if (jQuery(obj).val() != '') {
509
- jQuery(all_btns).removeClass('disabled');
510
- }
511
-
512
-
513
- jQuery(all_btns).removeClass('disabled');
514
- jQuery('#title').val(jQuery(obj).val() + 's');
515
- jQuery('#listDescription').val('Showing All ' + jQuery(obj).val() + 's');
516
-
517
- if (jQuery(obj).val() != '') {
518
- jQuery('#noDataMessage').val('No ' + jQuery(obj).val() + 's Found Within Your Criteria');
519
- }
520
-
521
- if (jQuery(obj).val() != '' && jQuery('#showExport').is(':checked')) {
522
- jQuery('#exportButtonTitle').val('Export All ' + jQuery(obj).val() + 's');
523
- }
524
- }, "json").error(function(response) {
525
- alert('An error occurred instantiating this model. Check the response for errors.');
526
- });
527
- }
528
- }
529
-
530
- function SaveChanges() {
531
- jQuery(all_btns).addClass('disabled');
532
- jQuery.post(jQuery('#widget_list_administration').attr('action'), 'ajax=1&save=1&' + jQuery('#widget_list_administration').serialize(), function(response)
533
- {
534
- jQuery(all_btns).removeClass('disabled');
535
- jQuery('#preview').show();
536
- jQuery('#preview').attr('src',jQuery('#widget_list_administration').attr('action') + '?iframe=1&desiredController=' + jQuery('#desiredController').val() + '&desiredAction=' + jQuery('#desiredAction').val() );
537
- jQuery('#preview').css('width','100%');
538
- jQuery('#preview').css('height','500px');
539
- }, "json");
540
- }
541
-
542
- var isSubmitting = false;
543
- function Submit() {
544
- if (VerifyOK('')) {
545
- isSubmitting = true;
546
- jQuery('#widget_list_administration').submit();
547
- }
548
- }
549
-
550
- function ChangeController(obj) {
551
- jQuery('.footer_buttons_url').each(function (key,value) {
552
- if (jQuery(value).val() == '/' + jQuery('#desiredControllerOriginal').val() + '/add/') {
553
- jQuery(value).val('/' + jQuery(obj).val() + '/add/');
554
- jQuery(value).attr('value','/' + jQuery(obj).val() + '/add/');
555
- }
556
- });
557
- jQuery('.buttons_url').each(function (key,value) {
558
- if (jQuery(value).val() == '/' + jQuery('#desiredControllerOriginal').val() + '/edit/id/') {
559
- jQuery(value).val('/' + jQuery(obj).val() + '/edit/id/');
560
- jQuery(value).attr('value','/' + jQuery(obj).val() + '/edit/id/');
561
- }
562
- if (jQuery(value).val() == '/' + jQuery('#desiredControllerOriginal').val() + '/delete/id/') {
563
- jQuery(value).val('/' + jQuery(obj).val() + '/delete/id/');
564
- jQuery(value).attr('value','/' + jQuery(obj).val() + '/delete/id/');
565
- }
566
- });
567
- }
568
-
569
- </script>
570
- <form action="<!--POST_URL-->" method="post" id="widget_list_administration">
571
- <h1 style="font-size:24;"><!--TITLE--></h1><div class="horizontal_rule"></div>
572
- <h3>Get started quickly by selecting the features you need for this list</h3>
573
- <table>
574
- <!--BUTTON SECTION-->
575
- <tr id="sections" <!--BUTTON_CSS-->>
576
- <td colspan="3">
577
- <h3><!--BUTTONS--></h3>
578
- </td>
579
- </tr>
580
-
581
- <!--START SECTION-->
582
-
583
- <!--EDIT_OR_ADD_NEW-->
584
-
585
- <tr class="start" <!--START_CSS-->>
586
- <td>
587
- <h3>Primary Connection?:</h3>
588
- </td>
589
- <td>
590
- <input type="checkbox" name="primaryDatabase" id="primaryDatabase" value="1" <!--PRIMARY_CHECKED-->/>
591
- </td>
592
- <td>
593
- &#160;
594
- </td>
595
- </tr>
596
-
597
- <tr class="start" <!--START_CSS-->>
598
- <td>
599
- <h3>Desired Controller Location:</h3>
600
- </td>
601
- <td>
602
- <input type="text" onblur="ChangeController(this);" name="desiredController" id="desiredController" value="<!--CONTROLLER_VALUE-->"/>
603
- <input type="hidden" name="desiredControllerOriginal" id="desiredControllerOriginal" value="<!--CONTROLLER_VALUE-->"/>
604
- </td>
605
- <td>
606
- <!--CONTROLLER_HELP_BUTTON-->
607
- </td>
608
- </tr>
609
-
610
- <tr class="start" <!--START_CSS-->>
611
- <td>
612
- <h3>Desired Action:</h3>
613
- </td>
614
- <td>
615
- <input type="text" name="desiredAction" id="desiredAction" value="<!--ACTION_VALUE-->"/>
616
- </td>
617
- <td>
618
- <!--ACTION_HELP_BUTTON-->
619
- </td>
620
- </tr>
621
-
622
- <tr class="start" <!--START_CSS-->>
623
- <td>
624
- <h3>Internal Name:</h3>
625
- </td>
626
- <td>
627
- <input type="text" name="name" id="name" value="<!--NAME_VALUE-->"/>
628
- </td>
629
- <td>
630
- <!--NAME_HELP_BUTTON-->
631
- </td>
632
- </tr>
633
-
634
- <tr class="start" <!--START_CSS-->>
635
- <td>
636
- <h3>Model:</h3>
637
- </td>
638
- <td>
639
- <select name="view" id="view" onchange="ChangeViewModel(this)">
640
- <!--VIEW_OPTIONS-->
641
- </select>
642
- </td>
643
- <td>
644
- &#160;
645
- </td>
646
- </tr>
647
- <tr class="start" <!--START_CSS-->>
648
- <td>
649
- <h3>Title:</h3>
650
- </td>
651
- <td>
652
- <input type="text" name="title" id="title" value="<!--TITLE_VALUE-->"/>
653
- </td>
654
- <td>
655
- <!--TITLE_HELP_BUTTON-->
656
- </td>
657
- </tr>
658
-
659
- <tr class="start" <!--START_CSS-->>
660
- <td>
661
- <h3>Initial Description:</h3>
662
- </td>
663
- <td>
664
- <input type="text" name="listDescription" id="listDescription" value="<!--DESC_VALUE-->"/>
665
- </td>
666
- <td>
667
- <!--DESC_HELP_BUTTON-->
668
- </td>
669
- </tr>
670
-
671
- <!--FIELDS SECTION-->
672
- <tr class="fields" style="display:none;">
673
- <td>
674
- <h3>Allow Sorting?:</h3>
675
- </td>
676
- <td>
677
- <input type="checkbox" name="useSort" id="useSort" value="1" <!--SORTING_CHECKED-->/>
678
- </td>
679
- <td>
680
- &#160;
681
- </td>
682
- </tr>
683
-
684
- <tr class="fields" style="display:none;">
685
- <td>
686
- <h3>No Data Message:</h3>
687
- </td>
688
- <td>
689
- <input type="text" name="noDataMessage" id="noDataMessage" value="<!--NO_DATA_VALUE-->"/>
690
- </td>
691
- <td>
692
- &#160;
693
- </td>
694
- </tr>
695
-
696
- <tr class="fields" style="display:none;">
697
- <td colspan="3">
698
- <h1>Field Selection:</h1>
699
- <script type="text/plain" id="default_field_template">
700
- <!--FIELD_TEMPLATE-->
701
- </script>
702
- <table style="margin-left:75px;" id="field_table">
703
- <!--ALL_FIELDS-->
704
- </table>
705
- <table style="margin-left:75px;">
706
- <tr>
707
- <td colspan="3">
708
- <!--ADD_FIELD_BUTTON-->
709
- </td>
710
- </tr>
711
- </table>
712
- </td>
713
- </tr>
714
-
715
- <tr class="fields" style="display:none;">
716
- <td style="width:300px;">
717
- <h3>Hidden Fields?:</h3>
718
- </td>
719
- <td>
720
- <input type="checkbox" name="showHidden" onchange="ShowHiddenOptions();" id="showHidden" value="1" <!--SHOW_HIDDEN_CHECKED-->/>
721
- </td>
722
- <td>
723
- <!--HIDDEN_HELP_BUTTON-->
724
- </td>
725
- </tr>
726
-
727
- <tr class="fields hidden_fields_dependent" style="display:none;">
728
-
729
- <td colspan="3">
730
- <h1 style="margin-left: 75px;">Hidden Field Selection:</h1>
731
- <script type="text/plain" id="default_hidden_field_template">
732
- <!--HIDDEN_FIELD_TEMPLATE-->
733
- </script>
734
- <table style="margin-left:150px;" id="hidden_field_table">
735
- <!--ALL_HIDDEN_FIELDS-->
736
- </table>
737
- <table style="margin-left:150px;">
738
- <tr>
739
- <td colspan="3">
740
- <!--ADD_HIDDEN_FIELD_BUTTON-->
741
- </td>
742
- </tr>
743
- </table>
744
- </td>
745
- </tr>
746
-
747
- <tr class="fields" style="display:none;">
748
- <td style="width:300px;">
749
- <h3>Field Function?:</h3>
750
- </td>
751
- <td>
752
- <input type="checkbox" name="fieldFunctionOn" onchange="ShowFunctionOptions();" id="fieldFunctionOn" value="1" <!--SHOW_FUNCTION_CHECKED-->/>
753
- </td>
754
- <td>
755
- <!--FUNC_HELP_BUTTON-->
756
- </td>
757
- </tr>
758
-
759
- <tr class="fields function_dependent" style="display:none;">
760
- <td colspan="3">
761
- <h1 style="margin-left: 75px;">Field Functions To Wrap Around Fields:</h1>
762
- <script type="text/plain" id="default_field_function_template">
763
- <!--FIELD_FUNCTION_TEMPLATE-->
764
- </script>
765
- <table style="margin-left:150px;" id="field_function_table">
766
- <!--ALL_FIELD_FUNCTIONS-->
767
- </table>
768
- <table style="margin-left:150px;">
769
- <tr>
770
- <td colspan="3">
771
- <!--ADD_FIELD_FUNCTION_BUTTON-->
772
- </td>
773
- </tr>
774
- </table>
775
- </td>
776
- </tr>
777
-
778
- <!--ROWS SECTION-->
779
- <tr class="rows" style="display:none;">
780
- <td>
781
- <h3>Row Limit</h3>
782
- </td>
783
- <td>
784
- <input type="text" name="rowLimit" id="rowLimit" value="<!--ROW_LIMIT_VALUE-->"/>
785
- </td>
786
- <td>
787
- <!--ROW_HELP_BUTTON-->
788
- </td>
789
- </tr>
790
-
791
-
792
-
793
- <tr class="rows" style="display:none;">
794
- <td style="width:300px;">
795
- <h3>Row Buttons?:</h3>
796
- </td>
797
- <td>
798
- <input type="checkbox" name="rowButtonsOn" onchange="ShowButtonOptions();" id="rowButtonsOn" value="1" <!--BUTTONS_ON_CHECKED-->/>
799
- </td>
800
- <td>
801
- <!--BUTTON_HELP_BUTTON-->
802
- </td>
803
- </tr>
804
-
805
- <tr class="rows button_dependent" style="display:none;">
806
- <td colspan="3">
807
- <table style="margin-left:75px;">
808
- <tr>
809
- <td>
810
- <h3>Row Button Column Name</h3>
811
- </td>
812
- <td>
813
- <input type="text" name="rowButtonsName" id="rowButtonsName" value="<!--BUTTON_NAME_VALUE-->"/>
814
- </td>
815
- <td>
816
- &#160;
817
- </td>
818
- </tr>
819
- </table>
820
- </td>
821
- </tr>
822
-
823
- <tr class="rows button_dependent" style="display:none;">
824
- <td colspan="3">
825
- <h1 style="margin-left:75px;">Buttons:</h1>
826
- <script type="text/plain" id="default_button_template">
827
- <!--THE_BUTTON_TEMPLATE-->
828
- </script>
829
- <table style="margin-left:150px;" id="button_table">
830
- <!--ALL_BUTTONS-->
831
- </table>
832
- <table style="margin-left:150px;">
833
- <tr>
834
- <td colspan="3">
835
- <!--ADD_THE_BUTTON_BUTTON-->
836
- </td>
837
- </tr>
838
- </table>
839
- </td>
840
- </tr>
841
-
842
-
843
-
844
-
845
- <tr class="rows" style="display:none;">
846
- <td style="width:300px;">
847
- <h3>Drill Down Columns?:</h3>
848
- </td>
849
- <td>
850
- <input type="checkbox" name="drillDownsOn" onchange="ShowDrillDownOptions();" id="drillDownsOn" value="1" <!--DRILL_DOWN_CHECKED-->/>
851
- </td>
852
- <td>
853
- <!--DRILL_DOWN_HELP_BUTTON-->
854
- </td>
855
- </tr>
856
-
857
- <tr class="rows drill_down_dependent" style="display:none;">
858
- <td colspan="3">
859
- <script type="text/plain" id="default_drill_down_template">
860
- <!--THE_DRILL_DOWN_TEMPLATE-->
861
- </script>
862
- <table style="margin-left:150px;" id="drill_down_table">
863
- <!--ALL_DRILL_DOWNS-->
864
- </table>
865
- <table style="margin-left:150px;">
866
- <tr>
867
- <td colspan="3">
868
- <!--ADD_DRILL_DOWN_BUTTON-->
869
- </td>
870
- </tr>
871
- </table>
872
- </td>
873
- </tr>
874
-
875
-
876
- <!--SEARCH SECTION-->
877
- <tr class="search" style="display:none;">
878
- <td style="width:300px;">
879
- <h3>Show Search?:</h3>
880
- </td>
881
- <td>
882
- <input type="checkbox" name="showSearch" onchange="ShowSearchOptions(function() {ShowGroupingOptions();})" id="showSearch" value="1" <!--SHOW_SEARCH_CHECKED-->/>
883
- </td>
884
- <td>
885
- &#160;
886
- </td>
887
- </tr>
888
-
889
- <tr class="search search_dependent" style="display:none;">
890
- <td style="width:300px;">
891
- <h3>Show Export Button?:</h3>
892
- </td>
893
- <td>
894
- <input type="checkbox" name="showExport" onchange="ShowExportOptions();" id="showExport" value="1" <!--SHOW_EXPORT_CHECKED-->/>
895
- </td>
896
- <td>
897
- &#160;
898
- </td>
899
- </tr>
900
-
901
- <tr class="search search_dependent export_dependent" style="display:none;">
902
- <td colspan="3">
903
- <table style="margin-left:75px;">
904
- <tr>
905
- <td>
906
- <h3>Export Button Title:</h3>
907
- </td>
908
- <td>
909
- <input type="text" name="exportButtonTitle" id="exportButtonTitle" value="<!--EXPORT_VALUE-->"/>
910
- </td>
911
- <td>
912
- &#160;
913
- </td>
914
- </tr>
915
- </table>
916
- </td>
917
- </tr>
918
-
919
- <tr class="search search_dependent" style="display:none;">
920
- <td>
921
- <h3>Search Description/Title:</h3>
922
- </td>
923
- <td>
924
- <input type="text" name="searchTitle" id="searchTitle" value="<!--SEARCH_TITLE-->"/>
925
- </td>
926
- <td>
927
- <!--SEARCH_TITLE_BUTTON-->
928
- </td>
929
- </tr>
930
-
931
- <tr class="search search_dependent" style="display:none;">
932
- <td>
933
- <h3>Use Ransack Advanced Search?:</h3>
934
- </td>
935
- <td>
936
- <input type="checkbox" name="useRansack" onchange="ShowRansackOptions()" id="useRansack" value="1" <!--USE_RANSACK-->/>
937
- </td>
938
- <td>
939
- <!--RANSACK_HELP_BUTTON-->
940
- </td>
941
- </tr>
942
-
943
- <tr class="search search_dependent ransack_dependent" style="display:none;">
944
- <td colspan="3">
945
- <table style="margin-left:75px;">
946
- <tr>
947
- <td>
948
- <h3>Customized Ransack Form?:</h3>
949
- </td>
950
- <td>
951
- <input type="checkbox" name="ransackAdvancedForm" id="ransackAdvancedForm" value="1" <!--USE_RANSACK_ADV-->/>
952
- </td>
953
- <td>
954
- <!--ADV_RANSACK_HELP_BUTTON-->
955
- </td>
956
- </tr>
957
- </table>
958
- </td>
959
- </tr>
960
-
961
- <tr class="search search_dependent" style="display:none;">
962
- <td>
963
- <h3>Use Grouping?:</h3>
964
- </td>
965
- <td>
966
- <input type="checkbox" name="useGrouping" onchange="ShowGroupingOptions()" id="useGrouping" value="1" <!--USE_GROUPING-->/>
967
- </td>
968
- <td>
969
- <!--GROUP_BY_HELP_BUTTON-->
970
- </td>
971
- </tr>
972
-
973
- <tr class="search search_dependent grouping_dependent" style="display:none;">
974
- <td colspan="3">
975
- <h1 style="margin-left: 75px;">Custom Items To Group By:</h1>
976
- <table>
977
- <tr>
978
- <td>
979
- <script type="text/plain" id="default_grouping_template">
980
- <!--DEFAULT_GROUPING-->
981
- </script>
982
- <table style="margin-left:150px;" id="grouping_table">
983
- <!--GROUPING_ITEMS-->
984
- </table>
985
- <table style="margin-left:150px;">
986
- <tr>
987
- <td colspan="3">
988
- <!--ADD_GROUP_BY_BUTTON-->
989
- </td>
990
- </tr>
991
- </table>
992
- </td>
993
- </tr>
994
- </table>
995
-
996
- <table style="margin-left:150px;">
997
- <tr>
998
- <td colspan="3">
999
- <!--ADD_GROUPING_BUTTON-->
1000
- </td>
1001
- </tr>
1002
- </table>
1003
- </td>
1004
- </tr>
1005
-
1006
- <!--FOOTER SECTION-->
1007
- <tr class="footer" style="display:none;">
1008
- <td style="width:300px;">
1009
- <h3>Build Customized Footer?:</h3>
1010
- </td>
1011
- <td>
1012
- <input type="checkbox" name="footerOn" onchange="ShowFooterOptions();" id="footerOn" value="1" <!--FOOTER_CHECKED-->/>
1013
- </td>
1014
- <td>
1015
-
1016
- </td>
1017
- </tr>
1018
- <tr class="footer footer_dependent" style="display:none;">
1019
- <td colspan="3">
1020
- <h1 style="margin-left:75px;">Footer Buttons:</h1>
1021
- <script type="text/plain" id="default_footer_template">
1022
- <!--FOOTER_BUTTON_TEMPLATE-->
1023
- </script>
1024
- <table style="margin-left:150px;" id="footer_table">
1025
- <!--ALL_FOOTER_BUTTONS-->
1026
- </table>
1027
- <table style="margin-left:150px;">
1028
- <tr>
1029
- <td colspan="3">
1030
- <!--ADD_THE_FOOTER_BUTTON-->
1031
- </td>
1032
- </tr>
1033
- </table>
1034
- </td>
1035
- </tr>
1036
-
1037
- <tr class="footer" style="display:none;">
1038
- <td style="width:300px;">
1039
- <h3>Show Pagination?:</h3>
1040
- </td>
1041
- <td>
1042
- <input type="checkbox" name="showPagination" id="showPagination" value="1" <!--PAGINATION_CHECKED-->/>
1043
- </td>
1044
- <td>
1045
-
1046
- </td>
1047
- </tr>
1048
-
1049
- <!--MISC & SUBMIT SECTION-->
1050
-
1051
- <tr class="misc_submit" style="display:none;">
1052
- <td style="width:300px;">
1053
- <h3>Add Row Checkbox?:</h3>
1054
- </td>
1055
- <td>
1056
- <input type="checkbox" name="checkboxEnabled" onchange="ShowCheckboxOptions();" id="checkboxEnabled" value="1" <!--SHOW_CHECKBOX_CHECKED-->/>
1057
- </td>
1058
- <td>
1059
- &#160;
1060
- </td>
1061
- </tr>
1062
-
1063
- <tr class="misc_submit checkbox_dependent" style="display:none;">
1064
- <td colspan="3">
1065
- <table style="margin-left:75px;">
1066
- <tr>
1067
- <td>
1068
- <h3>Checkbox Value:</h3>
1069
- </td>
1070
- <td>
1071
- <select name="checkboxField" id="checkboxField">
1072
- <!--CHECKBOX_SELECTED_FIELDS-->
1073
- </select>
1074
- </td>
1075
- <td>
1076
- <!--CHECK_HELP_BUTTON-->
1077
- </td>
1078
- </tr>
1079
- </table>
1080
- </td>
1081
- </tr>
1082
- <tr class="misc_submit" style="display:none;" >
1083
- <td>
1084
- <h3>Submit:</h3>
1085
- </td>
1086
- <td>
1087
- <!--SUBMIT_WIDGET_LIST-->
1088
- </td>
1089
- <td>
1090
- &#160;
1091
- </td>
1092
- </tr>
1093
-
1094
- <tr>
1095
- <td colspan="3">
1096
- <iframe src="" id="preview"></iframe>
1097
- </td>
1098
- </tr>
1099
-
1100
- </table>
1
+ <style type="text/css">
2
+ input[type="text"] {
3
+ font-size:25px;
4
+ height:33px;
5
+ left:0;
6
+ line-height:33px;
7
+ padding:8px 8px 7px;
8
+ top:0;
9
+ width:600px;
10
+ }
11
+
12
+ select {
13
+ font-size:25px;
14
+ height:50px;
15
+ left:0;
16
+ line-height:33px;
17
+ top:0;
18
+ width:600px;
19
+ }
20
+
21
+ .misc_keys, .misc_descriptions, .misc_links {
22
+ font-size:14px !important;
23
+ height:15px !important;
24
+ left:0 !important;
25
+ line-height:14px !important;
26
+ width:200px !important;
27
+ }
28
+
29
+ .buttons_drill_down_name_button {
30
+ margin-right: 70px;
31
+ }
32
+
33
+ .buttons_data_to_pass_from_view_button {
34
+ margin-right: 120px;
35
+ }
36
+ </style>
37
+
38
+ <script type="text/javascript">
39
+ var all = '.init,.start,.fields,.rows,.search,.footer,.misc_submit';
40
+ var all_btns = '#start,#fields,#rows,#search,#footer,#misc_submit';
41
+ jQuery(document).ready(function () {
42
+ if (jQuery('#view').val() != '') {
43
+ jQuery(all_btns).removeClass('disabled');
44
+ }
45
+ if (jQuery('#preview').attr('src') == '') {
46
+ jQuery('#preview').hide();
47
+ } else {
48
+ jQuery('#preview').show();
49
+ }
50
+
51
+ window.onbeforeunload = function (evt) {
52
+ var message = 'Are you sure you want to abandon this widget_list implementation? Doing so will lose all your work?';
53
+ if (typeof evt == 'undefined') {
54
+ evt = window.event;
55
+ }
56
+
57
+ if (evt) {
58
+ evt.returnValue = message;
59
+ }
60
+ if (!isSubmitting) {
61
+ return message;
62
+ }
63
+ }
64
+
65
+ });
66
+
67
+ function VerifyOK(func_name) {
68
+ var ok = true;
69
+ if (jQuery('#view').val() == '') {
70
+ ok = false;
71
+ alert('Please select a Model to use as your base widget_list');
72
+ }
73
+ else if (jQuery('#rowLimit').val() != '10' && jQuery('#rowLimit').val() != '20' && jQuery('#rowLimit').val() != '50' && jQuery('#rowLimit').val() != '100' && jQuery('#rowLimit').val() != '500' && jQuery('#rowLimit').val() != '1000') {
74
+ ok = false;
75
+ alert('Invalid Row Limit, please see help button.');
76
+ }
77
+ return ok;
78
+ }
79
+
80
+ function ClickTab(which_class,func_name,by_pass) {
81
+ if (typeof by_pass == 'undefined') {
82
+ var by_pass = false;
83
+ }
84
+ if (by_pass || VerifyOK(func_name)) {
85
+ jQuery('.search_dependent').hide(0,function() {
86
+ jQuery(all).hide(0,function() {
87
+ jQuery(which_class).fadeIn(0,function() {
88
+ if (func_name == 'ShowSearch') {
89
+ ShowSearchOptions(function() {
90
+ ShowGroupingOptions();
91
+ ShowExportOptions();
92
+
93
+ });
94
+ }
95
+ if (func_name == 'ShowFields') {
96
+ ShowHiddenOptions();
97
+ ShowFunctionOptions();
98
+ }
99
+ if (func_name == 'ShowSubmit') {
100
+ ShowCheckboxOptions();
101
+ }
102
+ if (func_name == 'ShowRows') {
103
+ ShowButtonOptions();
104
+ ShowDrillDownOptions();
105
+ }
106
+ if (func_name == 'ShowFooter') {
107
+ ShowFooterOptions();
108
+ }
109
+ });
110
+ });
111
+ });
112
+
113
+ if (!by_pass) {
114
+ SaveChanges();
115
+ }
116
+
117
+ }
118
+ }
119
+
120
+ function ShowStart() {
121
+ ClickTab('.start',arguments.callee.name);
122
+ }
123
+
124
+ function ShowFields() {
125
+ ClickTab('.fields',arguments.callee.name);
126
+ }
127
+
128
+ function ShowRows() {
129
+ ClickTab('.rows',arguments.callee.name);
130
+ }
131
+
132
+ function ShowSearch() {
133
+ ClickTab('.search',arguments.callee.name);
134
+ }
135
+
136
+ function ShowFooter() {
137
+ ClickTab('.footer',arguments.callee.name);
138
+ }
139
+
140
+ function ShowSubmit() {
141
+ ClickTab('.misc_submit',arguments.callee.name);
142
+ }
143
+
144
+ function ReplaceColumnsToLinked(obj) {
145
+ found = false;
146
+ var className = obj.className;
147
+ jQuery(obj).css('background-color','white');
148
+ jQuery('.fields_keys, .fields_hidden_keys, .fields_function_keys').each(
149
+ function(key, value) {
150
+ if(jQuery(value).val() == jQuery(obj).val().trim() && jQuery(obj).val().search(/_linked/i) == -1) {
151
+ found = true;
152
+ var id_original = jQuery(obj).val().trim();
153
+ jQuery(value).val(jQuery(obj).val().trim() + '_linked');
154
+ jQuery(obj).val(jQuery(obj).val().trim() + '_linked');
155
+ jQuery(obj).attr('value',jQuery(this).val().trim());
156
+ if (className == 'drill_downs_data_to_pass_from_view') {
157
+ jQuery('.drill_downs_column_to_show[value="col_name"]').each(
158
+ function(key1, value1) {
159
+ jQuery(value1).val(jQuery(obj).val().trim());
160
+ jQuery(value1).attr('value',jQuery(value1).val().trim());
161
+ return false;
162
+ }
163
+ )
164
+ } else {
165
+ jQuery('.drill_downs_data_to_pass_from_view[value="col_name"]').each(
166
+ function(key1, value1) {
167
+ jQuery(value1).val(jQuery(obj).val().trim());
168
+ jQuery(value1).attr('value',jQuery(value1).val().trim());
169
+ return false;
170
+ }
171
+ )
172
+ }
173
+
174
+ jQuery('.drill_downs_drill_down_name[value="filter_col_name"]').each(
175
+ function(key1, value1) {
176
+ jQuery(value1).val('filter_by_' + id_original);
177
+ jQuery(value1).attr('value','filter_by_' + id_original);
178
+ return false;
179
+ }
180
+ )
181
+
182
+
183
+ jQuery('#showHidden').attr('checked',true);
184
+ AddHiddenField();
185
+ jQuery('.fields_hidden_keys[value=""]').each(
186
+ function(key1, value1) {
187
+ jQuery(value1).val(id_original);
188
+ jQuery(value1).attr('value',id_original);
189
+ return false;
190
+ }
191
+ );
192
+ }
193
+ }
194
+ );
195
+
196
+ if (!found && jQuery(obj).val().search(/_linked/i) == -1) {
197
+ alert('Invalid Field Name defined. Please change the value');
198
+ jQuery(obj).css('background-color','red');
199
+ }
200
+ }
201
+
202
+ function InvalidField(obj) {
203
+ found = false;
204
+ jQuery(obj).css('background-color','white');
205
+ jQuery('.fields_keys, .fields_hidden_keys, .fields_function_keys').each(
206
+ function(key, value) {
207
+ if(jQuery(value).val() == jQuery(obj).val().trim()) {
208
+ found = true;
209
+ }
210
+ }
211
+ );
212
+
213
+ if (!found) {
214
+ alert('Invalid Field Name defined. Please change the value');
215
+ jQuery(obj).css('background-color','red');
216
+ }
217
+ }
218
+
219
+ function GoodClass(obj) {
220
+ found = false;
221
+ jQuery(obj).css('background-color','white');
222
+ if (jQuery(obj).val() == 'primary' || jQuery(obj).val() == 'info' || jQuery(obj).val() == 'success' || jQuery(obj).val() == 'danger' || jQuery(obj).val() == 'disabled' || jQuery(obj).val() == 'default') {
223
+ found = true;
224
+ }
225
+ if (!found) {
226
+ alert('Invalid Class Name. Click Help icon for more information.');
227
+ jQuery(obj).css('background-color','red');
228
+ }
229
+ }
230
+
231
+
232
+ function ShowSearchOptions(callback) {
233
+ if (jQuery('#showSearch').is(':checked')) {
234
+ jQuery('.search_dependent').show();
235
+ } else {
236
+ jQuery('.search_dependent').hide();
237
+ }
238
+ if (typeof(callback) == 'function') {
239
+ (callback)();
240
+ }
241
+ }
242
+
243
+ function ShowGroupingOptions() {
244
+ if (jQuery('#useGrouping').is(':checked') && jQuery('#showSearch').is(':checked')) {
245
+ jQuery('.grouping_dependent').show();
246
+ } else {
247
+ jQuery('.grouping_dependent').hide();
248
+ }
249
+ }
250
+
251
+ function ShowRansackOptions() {
252
+ if (jQuery('#useRansack').is(':checked') && jQuery('#showSearch').is(':checked')) {
253
+ jQuery('.ransack_dependent').show();
254
+ } else {
255
+ jQuery('.ransack_dependent').hide();
256
+ }
257
+ }
258
+
259
+ function ShowFooterOptions() {
260
+ if (jQuery('#footerOn').is(':checked')) {
261
+ jQuery('.footer_dependent').show();
262
+ } else {
263
+ jQuery('.footer_dependent').hide();
264
+ }
265
+ }
266
+
267
+ function ShowExportOptions() {
268
+ if (jQuery('#showExport').is(':checked') && jQuery('#showSearch').is(':checked')) {
269
+ jQuery('.export_dependent').show();
270
+ } else {
271
+ jQuery('.export_dependent').hide();
272
+ }
273
+ }
274
+
275
+ function ShowHiddenOptions() {
276
+ if (jQuery('#showHidden').is(':checked')) {
277
+ if (jQuery('.fields_hidden_keys').length == 0) {
278
+ AddHiddenField();
279
+ }
280
+ jQuery('.hidden_fields_dependent').show();
281
+ } else {
282
+ jQuery('.hidden_fields_dependent').hide();
283
+ }
284
+ }
285
+
286
+ function ShowButtonOptions() {
287
+ if (jQuery('#rowButtonsOn').is(':checked')) {
288
+ jQuery('.button_dependent').show();
289
+ } else {
290
+ jQuery('.button_dependent').hide();
291
+ }
292
+ }
293
+ function ShowDrillDownOptions() {
294
+ if (jQuery('#drillDownsOn').is(':checked')) {
295
+ if (jQuery('.drill_downs_data_to_pass_from_view').length == 0) {
296
+ AddDrillDown();
297
+ }
298
+ jQuery('.drill_down_dependent').show();
299
+ } else {
300
+ jQuery('.drill_down_dependent').hide();
301
+ }
302
+ }
303
+
304
+ function ShowFunctionOptions() {
305
+ if (jQuery('#fieldFunctionOn').is(':checked')) {
306
+ if (jQuery('.fields_function_keys').length == 0) {
307
+ AddFieldFunction();
308
+ }
309
+ jQuery('.function_dependent').show();
310
+ } else {
311
+ jQuery('.function_dependent').hide();
312
+ }
313
+ }
314
+
315
+ function ShowCheckboxOptions() {
316
+ if (jQuery('#checkboxEnabled').is(':checked')) {
317
+ jQuery('.checkbox_dependent').show();
318
+ } else {
319
+ jQuery('.checkbox_dependent').hide();
320
+ }
321
+ }
322
+
323
+ function AddGroupingItem() {
324
+ jQuery('#grouping_items').html(jQuery('#grouping_items').html() + jQuery('#grouping_items_default').html());
325
+ }
326
+
327
+ function AddField() {
328
+ jQuery('#field_table').html(jQuery('#field_table').html() + jQuery('#default_field_template').html());
329
+ }
330
+
331
+ function AddGroupBy() {
332
+ jQuery('#grouping_table').html(jQuery('#grouping_table').html() + jQuery('#default_grouping_template').html());
333
+ }
334
+
335
+ function AddButton() {
336
+ jQuery('#button_table').html(jQuery('#button_table').html() + jQuery('#default_button_template').html());
337
+ jQuery('.buttons_url').last().val('/' + jQuery('#desiredController').val());
338
+ }
339
+
340
+ function AddDrillDown() {
341
+ jQuery('#drill_down_table').html(jQuery('#drill_down_table').html() + jQuery('#default_drill_down_template').html());
342
+ }
343
+
344
+ function AddFooterButton() {
345
+ jQuery('#footer_table').html(jQuery('#footer_table').html() + jQuery('#default_footer_template').html());
346
+ jQuery('.footer_buttons_url').last().val('/' + jQuery('#desiredController').val());
347
+ }
348
+
349
+ function AddHiddenField() {
350
+ jQuery('#hidden_field_table').html(jQuery('#hidden_field_table').html() + jQuery('#default_hidden_field_template').html());
351
+ }
352
+
353
+ function AddFieldFunction() {
354
+ jQuery('#field_function_table').html(jQuery('#field_function_table').html() + jQuery('#default_field_function_template').html());
355
+ }
356
+
357
+ function FakeCheck(obj) {
358
+ jQuery(obj).siblings('input[type="hidden"]').val(jQuery(obj).is(':checked') ? 'checked' : '')
359
+ }
360
+
361
+ function RemoveField(obj) {
362
+ var isHiddenRemoval = false;
363
+ if (jQuery(obj).parent().parent().find('input.fields_hidden_keys').length > 0) {
364
+ isHiddenRemoval = true;
365
+ }
366
+ var isFunctionRemoval = false;
367
+ if (jQuery(obj).parent().parent().find('input.fields_function_keys').length > 0) {
368
+ isFunctionRemoval = true;
369
+ }
370
+
371
+ var tr1 = jQuery(obj).closest('tr');
372
+
373
+
374
+
375
+ var tr2 = tr1.next();
376
+ var tr3 = tr2.next();
377
+
378
+ tr1.remove();
379
+
380
+ if (tr1.find('.fields_keys').length == 1) {
381
+ // Remove options TR's
382
+ tr2.remove();
383
+ tr3.remove();
384
+ }
385
+
386
+ if (isHiddenRemoval && jQuery('.fields_hidden_keys').length == 0) {
387
+ if (jQuery('#showHidden').is(':checked')) {
388
+ jQuery('#showHidden').attr('checked',false);
389
+ }
390
+ jQuery('.hidden_fields_dependent').hide();
391
+ }
392
+ if (isFunctionRemoval && jQuery('.fields_function_keys').length == 0) {
393
+ if (jQuery('#fieldFunctionOn').is(':checked')) {
394
+ jQuery('#fieldFunctionOn').attr('checked',false);
395
+ }
396
+ jQuery('.function_dependent').hide();
397
+ }
398
+ }
399
+
400
+ function MoveField(obj) {
401
+
402
+ var field_name = jQuery(obj).parent().parent().find('input.fields_keys').val();
403
+ RemoveField(obj);
404
+ if (jQuery('#showHidden').not(':checked')) {
405
+ jQuery('#showHidden').attr('checked',true);
406
+ }
407
+ AddHiddenField();
408
+ jQuery('.hidden_fields_dependent').show();
409
+ jQuery('.fields_hidden_keys[value=""]').each(
410
+ function(key1, value1) {
411
+ jQuery(value1).val(field_name);
412
+ jQuery(value1).attr('value',field_name);
413
+ return false;
414
+ }
415
+ );
416
+ }
417
+
418
+ function ShowOptions(obj) {
419
+ var tr = jQuery(obj).closest('tr').next();
420
+ var tr2 = tr.next();
421
+ if (tr2.not(':visible') && tr.is(':visible')) {
422
+ tr2.show();
423
+ tr.show();
424
+ }
425
+ if (tr.not(':visible') && tr2.is(':visible')) {
426
+ tr.show();
427
+ tr2.show();
428
+ }
429
+ if (tr.not(':visible') && tr2.not(':visible')) {
430
+ tr.toggle();
431
+ tr2.toggle();
432
+ }
433
+ }
434
+
435
+ function AddFunction(obj) {
436
+
437
+ var field_name = jQuery(obj).parent().parent().find('input.fields_keys').val();
438
+
439
+ if (jQuery('#fieldFunctionOn').not(':checked')) {
440
+ jQuery('#fieldFunctionOn').attr('checked',true);
441
+ }
442
+ var objExists = '.fields_function_keys[value="' + field_name + '"]';
443
+ if (jQuery(objExists).length > 0) {
444
+ alert('Field Function for ' + field_name + ' already exists, please modify');
445
+ jQuery(objExists).css('background-color','pink');
446
+ } else {
447
+ AddFieldFunction();
448
+ jQuery('.function_dependent').show();
449
+ jQuery('.fields_function_keys[value=""]').each(
450
+ function(key1, value1) {
451
+ jQuery(value1).val(field_name);
452
+ jQuery(value1).attr('value',field_name);
453
+ return false;
454
+ }
455
+ );
456
+ jQuery('.fields_function_descriptions[value=""]').each(
457
+ function(key1, value1) {
458
+ var out = 'DB_FUNC(' + field_name + ')';
459
+ jQuery(value1).val(out);
460
+ jQuery(value1).attr('value',out);
461
+ return false;
462
+ }
463
+ );
464
+ }
465
+ }
466
+
467
+ function ShowField(obj) {
468
+
469
+ var field_name = jQuery(obj).parent().parent().find('input.fields_hidden_keys').val();
470
+ RemoveField(obj);
471
+ AddField();
472
+ jQuery('.fields_keys[value=""]').each(
473
+ function(key1, value1) {
474
+ jQuery(value1).val(field_name);
475
+ jQuery(value1).attr('value',field_name);
476
+ return false;
477
+ }
478
+ );
479
+ jQuery('.fields_descriptions[value=""]').each(
480
+ function(key1, value1) {
481
+ jQuery(value1).val(field_name);
482
+ jQuery(value1).attr('value',field_name);
483
+ return false;
484
+ }
485
+ );
486
+
487
+
488
+ if (jQuery('#showHidden').is(':checked') && jQuery('.fields_hidden_keys').length == 0) {
489
+ jQuery('#showHidden').attr('checked',false);
490
+ }
491
+ if (jQuery('.fields_hidden_keys').length == 0) {
492
+ jQuery('.hidden_fields_dependent').hide();
493
+ }
494
+ }
495
+
496
+ function ChangeViewModel(obj) {
497
+ jQuery(all_btns).addClass('disabled');
498
+ if(jQuery(obj).val() != '') {
499
+ jQuery.post(jQuery('#widget_list_administration').attr('action'), 'ajax=1&model=' + jQuery(obj).val(), function(response)
500
+ {
501
+ jQuery('#name').val(jQuery(obj).val().toLowerCase() + '_listing');
502
+ jQuery('#field_table').html(response['fields']);
503
+ jQuery('#hidden_field_table').html(response['fields_hidden']);
504
+ jQuery('#checkboxField').html(response['checked_fields']);
505
+ jQuery('#footer_table').html(response['footer_buttons']);
506
+ jQuery('#grouping_table').html(response['group_by']);
507
+ SaveChanges();
508
+ if (jQuery(obj).val() != '') {
509
+ jQuery(all_btns).removeClass('disabled');
510
+ }
511
+
512
+
513
+ jQuery(all_btns).removeClass('disabled');
514
+ jQuery('#title').val(jQuery(obj).val() + 's');
515
+ jQuery('#listDescription').val('Showing All ' + jQuery(obj).val() + 's');
516
+
517
+ if (jQuery(obj).val() != '') {
518
+ jQuery('#noDataMessage').val('No ' + jQuery(obj).val() + 's Found Within Your Criteria');
519
+ }
520
+
521
+ if (jQuery(obj).val() != '' && jQuery('#showExport').is(':checked')) {
522
+ jQuery('#exportButtonTitle').val('Export All ' + jQuery(obj).val() + 's');
523
+ }
524
+ }, "json").error(function(response) {
525
+ alert('An error occurred instantiating this model. Check the response for errors.');
526
+ });
527
+ }
528
+ }
529
+
530
+ function SaveChanges() {
531
+ jQuery(all_btns).addClass('disabled');
532
+ jQuery.post(jQuery('#widget_list_administration').attr('action'), 'ajax=1&save=1&' + jQuery('#widget_list_administration').serialize(), function(response)
533
+ {
534
+ jQuery(all_btns).removeClass('disabled');
535
+ jQuery('#preview').show();
536
+ jQuery('#preview').attr('src',jQuery('#widget_list_administration').attr('action') + '?iframe=1&desiredController=' + jQuery('#desiredController').val() + '&desiredAction=' + jQuery('#desiredAction').val() );
537
+ jQuery('#preview').css('width','100%');
538
+ jQuery('#preview').css('height','500px');
539
+ }, "json");
540
+ }
541
+
542
+ var isSubmitting = false;
543
+ function Submit() {
544
+ if (VerifyOK('')) {
545
+ isSubmitting = true;
546
+ jQuery('#widget_list_administration').submit();
547
+ }
548
+ }
549
+
550
+ function ChangeController(obj) {
551
+ jQuery('.footer_buttons_url').each(function (key,value) {
552
+ if (jQuery(value).val() == '/' + jQuery('#desiredControllerOriginal').val() + '/add/') {
553
+ jQuery(value).val('/' + jQuery(obj).val() + '/add/');
554
+ jQuery(value).attr('value','/' + jQuery(obj).val() + '/add/');
555
+ }
556
+ });
557
+ jQuery('.buttons_url').each(function (key,value) {
558
+ if (jQuery(value).val() == '/' + jQuery('#desiredControllerOriginal').val() + '/edit/id/') {
559
+ jQuery(value).val('/' + jQuery(obj).val() + '/edit/id/');
560
+ jQuery(value).attr('value','/' + jQuery(obj).val() + '/edit/id/');
561
+ }
562
+ if (jQuery(value).val() == '/' + jQuery('#desiredControllerOriginal').val() + '/delete/id/') {
563
+ jQuery(value).val('/' + jQuery(obj).val() + '/delete/id/');
564
+ jQuery(value).attr('value','/' + jQuery(obj).val() + '/delete/id/');
565
+ }
566
+ });
567
+ }
568
+
569
+ </script>
570
+ <form action="<!--POST_URL-->" method="post" id="widget_list_administration">
571
+ <h1 style="font-size:24;"><!--TITLE--></h1><div class="horizontal_rule"></div>
572
+ <h3>Get started quickly by selecting the features you need for this list</h3>
573
+ <table>
574
+ <!--BUTTON SECTION-->
575
+ <tr id="sections" <!--BUTTON_CSS-->>
576
+ <td colspan="3">
577
+ <h3><!--BUTTONS--></h3>
578
+ </td>
579
+ </tr>
580
+
581
+ <!--START SECTION-->
582
+
583
+ <!--EDIT_OR_ADD_NEW-->
584
+
585
+ <tr class="start" <!--START_CSS-->>
586
+ <td>
587
+ <h3>Primary Connection?:</h3>
588
+ </td>
589
+ <td>
590
+ <input type="checkbox" name="primaryDatabase" id="primaryDatabase" value="1" <!--PRIMARY_CHECKED-->/>
591
+ </td>
592
+ <td>
593
+ &#160;
594
+ </td>
595
+ </tr>
596
+
597
+ <tr class="start" <!--START_CSS-->>
598
+ <td>
599
+ <h3>Desired Controller Location:</h3>
600
+ </td>
601
+ <td>
602
+ <input type="text" onblur="ChangeController(this);" name="desiredController" id="desiredController" value="<!--CONTROLLER_VALUE-->"/>
603
+ <input type="hidden" name="desiredControllerOriginal" id="desiredControllerOriginal" value="<!--CONTROLLER_VALUE-->"/>
604
+ </td>
605
+ <td>
606
+ <!--CONTROLLER_HELP_BUTTON-->
607
+ </td>
608
+ </tr>
609
+
610
+ <tr class="start" <!--START_CSS-->>
611
+ <td>
612
+ <h3>Desired Action:</h3>
613
+ </td>
614
+ <td>
615
+ <input type="text" name="desiredAction" id="desiredAction" value="<!--ACTION_VALUE-->"/>
616
+ </td>
617
+ <td>
618
+ <!--ACTION_HELP_BUTTON-->
619
+ </td>
620
+ </tr>
621
+
622
+ <tr class="start" <!--START_CSS-->>
623
+ <td>
624
+ <h3>Internal Name:</h3>
625
+ </td>
626
+ <td>
627
+ <input type="text" name="name" id="name" value="<!--NAME_VALUE-->"/>
628
+ </td>
629
+ <td>
630
+ <!--NAME_HELP_BUTTON-->
631
+ </td>
632
+ </tr>
633
+
634
+ <tr class="start" <!--START_CSS-->>
635
+ <td>
636
+ <h3>Model:</h3>
637
+ </td>
638
+ <td>
639
+ <select name="view" id="view" onchange="ChangeViewModel(this)">
640
+ <!--VIEW_OPTIONS-->
641
+ </select>
642
+ </td>
643
+ <td>
644
+ &#160;
645
+ </td>
646
+ </tr>
647
+ <tr class="start" <!--START_CSS-->>
648
+ <td>
649
+ <h3>Title:</h3>
650
+ </td>
651
+ <td>
652
+ <input type="text" name="title" id="title" value="<!--TITLE_VALUE-->"/>
653
+ </td>
654
+ <td>
655
+ <!--TITLE_HELP_BUTTON-->
656
+ </td>
657
+ </tr>
658
+
659
+ <tr class="start" <!--START_CSS-->>
660
+ <td>
661
+ <h3>Initial Description:</h3>
662
+ </td>
663
+ <td>
664
+ <input type="text" name="listDescription" id="listDescription" value="<!--DESC_VALUE-->"/>
665
+ </td>
666
+ <td>
667
+ <!--DESC_HELP_BUTTON-->
668
+ </td>
669
+ </tr>
670
+
671
+ <!--FIELDS SECTION-->
672
+ <tr class="fields" style="display:none;">
673
+ <td>
674
+ <h3>Allow Sorting?:</h3>
675
+ </td>
676
+ <td>
677
+ <input type="checkbox" name="useSort" id="useSort" value="1" <!--SORTING_CHECKED-->/>
678
+ </td>
679
+ <td>
680
+ &#160;
681
+ </td>
682
+ </tr>
683
+
684
+ <tr class="fields" style="display:none;">
685
+ <td>
686
+ <h3>No Data Message:</h3>
687
+ </td>
688
+ <td>
689
+ <input type="text" name="noDataMessage" id="noDataMessage" value="<!--NO_DATA_VALUE-->"/>
690
+ </td>
691
+ <td>
692
+ &#160;
693
+ </td>
694
+ </tr>
695
+
696
+ <tr class="fields" style="display:none;">
697
+ <td colspan="3">
698
+ <h1>Field Selection:</h1>
699
+ <script type="text/plain" id="default_field_template">
700
+ <!--FIELD_TEMPLATE-->
701
+ </script>
702
+ <table style="margin-left:75px;" id="field_table">
703
+ <!--ALL_FIELDS-->
704
+ </table>
705
+ <table style="margin-left:75px;">
706
+ <tr>
707
+ <td colspan="3">
708
+ <!--ADD_FIELD_BUTTON-->
709
+ </td>
710
+ </tr>
711
+ </table>
712
+ </td>
713
+ </tr>
714
+
715
+ <tr class="fields" style="display:none;">
716
+ <td style="width:300px;">
717
+ <h3>Hidden Fields?:</h3>
718
+ </td>
719
+ <td>
720
+ <input type="checkbox" name="showHidden" onchange="ShowHiddenOptions();" id="showHidden" value="1" <!--SHOW_HIDDEN_CHECKED-->/>
721
+ </td>
722
+ <td>
723
+ <!--HIDDEN_HELP_BUTTON-->
724
+ </td>
725
+ </tr>
726
+
727
+ <tr class="fields hidden_fields_dependent" style="display:none;">
728
+
729
+ <td colspan="3">
730
+ <h1 style="margin-left: 75px;">Hidden Field Selection:</h1>
731
+ <script type="text/plain" id="default_hidden_field_template">
732
+ <!--HIDDEN_FIELD_TEMPLATE-->
733
+ </script>
734
+ <table style="margin-left:150px;" id="hidden_field_table">
735
+ <!--ALL_HIDDEN_FIELDS-->
736
+ </table>
737
+ <table style="margin-left:150px;">
738
+ <tr>
739
+ <td colspan="3">
740
+ <!--ADD_HIDDEN_FIELD_BUTTON-->
741
+ </td>
742
+ </tr>
743
+ </table>
744
+ </td>
745
+ </tr>
746
+
747
+ <tr class="fields" style="display:none;">
748
+ <td style="width:300px;">
749
+ <h3>Field Function?:</h3>
750
+ </td>
751
+ <td>
752
+ <input type="checkbox" name="fieldFunctionOn" onchange="ShowFunctionOptions();" id="fieldFunctionOn" value="1" <!--SHOW_FUNCTION_CHECKED-->/>
753
+ </td>
754
+ <td>
755
+ <!--FUNC_HELP_BUTTON-->
756
+ </td>
757
+ </tr>
758
+
759
+ <tr class="fields function_dependent" style="display:none;">
760
+ <td colspan="3">
761
+ <h1 style="margin-left: 75px;">Field Functions To Wrap Around Fields:</h1>
762
+ <script type="text/plain" id="default_field_function_template">
763
+ <!--FIELD_FUNCTION_TEMPLATE-->
764
+ </script>
765
+ <table style="margin-left:150px;" id="field_function_table">
766
+ <!--ALL_FIELD_FUNCTIONS-->
767
+ </table>
768
+ <table style="margin-left:150px;">
769
+ <tr>
770
+ <td colspan="3">
771
+ <!--ADD_FIELD_FUNCTION_BUTTON-->
772
+ </td>
773
+ </tr>
774
+ </table>
775
+ </td>
776
+ </tr>
777
+
778
+ <!--ROWS SECTION-->
779
+ <tr class="rows" style="display:none;">
780
+ <td>
781
+ <h3>Row Limit</h3>
782
+ </td>
783
+ <td>
784
+ <input type="text" name="rowLimit" id="rowLimit" value="<!--ROW_LIMIT_VALUE-->"/>
785
+ </td>
786
+ <td>
787
+ <!--ROW_HELP_BUTTON-->
788
+ </td>
789
+ </tr>
790
+
791
+
792
+
793
+ <tr class="rows" style="display:none;">
794
+ <td style="width:300px;">
795
+ <h3>Row Buttons?:</h3>
796
+ </td>
797
+ <td>
798
+ <input type="checkbox" name="rowButtonsOn" onchange="ShowButtonOptions();" id="rowButtonsOn" value="1" <!--BUTTONS_ON_CHECKED-->/>
799
+ </td>
800
+ <td>
801
+ <!--BUTTON_HELP_BUTTON-->
802
+ </td>
803
+ </tr>
804
+
805
+ <tr class="rows button_dependent" style="display:none;">
806
+ <td colspan="3">
807
+ <table style="margin-left:75px;">
808
+ <tr>
809
+ <td>
810
+ <h3>Row Button Column Name</h3>
811
+ </td>
812
+ <td>
813
+ <input type="text" name="rowButtonsName" id="rowButtonsName" value="<!--BUTTON_NAME_VALUE-->"/>
814
+ </td>
815
+ <td>
816
+ &#160;
817
+ </td>
818
+ </tr>
819
+ </table>
820
+ </td>
821
+ </tr>
822
+
823
+ <tr class="rows button_dependent" style="display:none;">
824
+ <td colspan="3">
825
+ <h1 style="margin-left:75px;">Buttons:</h1>
826
+ <script type="text/plain" id="default_button_template">
827
+ <!--THE_BUTTON_TEMPLATE-->
828
+ </script>
829
+ <table style="margin-left:150px;" id="button_table">
830
+ <!--ALL_BUTTONS-->
831
+ </table>
832
+ <table style="margin-left:150px;">
833
+ <tr>
834
+ <td colspan="3">
835
+ <!--ADD_THE_BUTTON_BUTTON-->
836
+ </td>
837
+ </tr>
838
+ </table>
839
+ </td>
840
+ </tr>
841
+
842
+
843
+
844
+
845
+ <tr class="rows" style="display:none;">
846
+ <td style="width:300px;">
847
+ <h3>Drill Down Columns?:</h3>
848
+ </td>
849
+ <td>
850
+ <input type="checkbox" name="drillDownsOn" onchange="ShowDrillDownOptions();" id="drillDownsOn" value="1" <!--DRILL_DOWN_CHECKED-->/>
851
+ </td>
852
+ <td>
853
+ <!--DRILL_DOWN_HELP_BUTTON-->
854
+ </td>
855
+ </tr>
856
+
857
+ <tr class="rows drill_down_dependent" style="display:none;">
858
+ <td colspan="3">
859
+ <script type="text/plain" id="default_drill_down_template">
860
+ <!--THE_DRILL_DOWN_TEMPLATE-->
861
+ </script>
862
+ <table style="margin-left:150px;" id="drill_down_table">
863
+ <!--ALL_DRILL_DOWNS-->
864
+ </table>
865
+ <table style="margin-left:150px;">
866
+ <tr>
867
+ <td colspan="3">
868
+ <!--ADD_DRILL_DOWN_BUTTON-->
869
+ </td>
870
+ </tr>
871
+ </table>
872
+ </td>
873
+ </tr>
874
+
875
+
876
+ <!--SEARCH SECTION-->
877
+ <tr class="search" style="display:none;">
878
+ <td style="width:300px;">
879
+ <h3>Show Search?:</h3>
880
+ </td>
881
+ <td>
882
+ <input type="checkbox" name="showSearch" onchange="ShowSearchOptions(function() {ShowGroupingOptions();})" id="showSearch" value="1" <!--SHOW_SEARCH_CHECKED-->/>
883
+ </td>
884
+ <td>
885
+ &#160;
886
+ </td>
887
+ </tr>
888
+
889
+ <tr class="search search_dependent" style="display:none;">
890
+ <td style="width:300px;">
891
+ <h3>Show Export Button?:</h3>
892
+ </td>
893
+ <td>
894
+ <input type="checkbox" name="showExport" onchange="ShowExportOptions();" id="showExport" value="1" <!--SHOW_EXPORT_CHECKED-->/>
895
+ </td>
896
+ <td>
897
+ &#160;
898
+ </td>
899
+ </tr>
900
+
901
+ <tr class="search search_dependent export_dependent" style="display:none;">
902
+ <td colspan="3">
903
+ <table style="margin-left:75px;">
904
+ <tr>
905
+ <td>
906
+ <h3>Export Button Title:</h3>
907
+ </td>
908
+ <td>
909
+ <input type="text" name="exportButtonTitle" id="exportButtonTitle" value="<!--EXPORT_VALUE-->"/>
910
+ </td>
911
+ <td>
912
+ &#160;
913
+ </td>
914
+ </tr>
915
+ </table>
916
+ </td>
917
+ </tr>
918
+
919
+ <tr class="search search_dependent" style="display:none;">
920
+ <td>
921
+ <h3>Search Description/Title:</h3>
922
+ </td>
923
+ <td>
924
+ <input type="text" name="searchTitle" id="searchTitle" value="<!--SEARCH_TITLE-->"/>
925
+ </td>
926
+ <td>
927
+ <!--SEARCH_TITLE_BUTTON-->
928
+ </td>
929
+ </tr>
930
+
931
+ <tr class="search search_dependent" style="display:none;">
932
+ <td>
933
+ <h3>Use Ransack Advanced Search?:</h3>
934
+ </td>
935
+ <td>
936
+ <input type="checkbox" name="useRansack" onchange="ShowRansackOptions()" id="useRansack" value="1" <!--USE_RANSACK-->/>
937
+ </td>
938
+ <td>
939
+ <!--RANSACK_HELP_BUTTON-->
940
+ </td>
941
+ </tr>
942
+
943
+ <tr class="search search_dependent ransack_dependent" style="display:none;">
944
+ <td colspan="3">
945
+ <table style="margin-left:75px;">
946
+ <tr>
947
+ <td>
948
+ <h3>Customized Ransack Form?:</h3>
949
+ </td>
950
+ <td>
951
+ <input type="checkbox" name="ransackAdvancedForm" id="ransackAdvancedForm" value="1" <!--USE_RANSACK_ADV-->/>
952
+ </td>
953
+ <td>
954
+ <!--ADV_RANSACK_HELP_BUTTON-->
955
+ </td>
956
+ </tr>
957
+ </table>
958
+ </td>
959
+ </tr>
960
+
961
+ <tr class="search search_dependent" style="display:none;">
962
+ <td>
963
+ <h3>Use Grouping?:</h3>
964
+ </td>
965
+ <td>
966
+ <input type="checkbox" name="useGrouping" onchange="ShowGroupingOptions()" id="useGrouping" value="1" <!--USE_GROUPING-->/>
967
+ </td>
968
+ <td>
969
+ <!--GROUP_BY_HELP_BUTTON-->
970
+ </td>
971
+ </tr>
972
+
973
+ <tr class="search search_dependent grouping_dependent" style="display:none;">
974
+ <td colspan="3">
975
+ <h1 style="margin-left: 75px;">Custom Items To Group By:</h1>
976
+ <table>
977
+ <tr>
978
+ <td>
979
+ <script type="text/plain" id="default_grouping_template">
980
+ <!--DEFAULT_GROUPING-->
981
+ </script>
982
+ <table style="margin-left:150px;" id="grouping_table">
983
+ <!--GROUPING_ITEMS-->
984
+ </table>
985
+ <table style="margin-left:150px;">
986
+ <tr>
987
+ <td colspan="3">
988
+ <!--ADD_GROUP_BY_BUTTON-->
989
+ </td>
990
+ </tr>
991
+ </table>
992
+ </td>
993
+ </tr>
994
+ </table>
995
+
996
+ <table style="margin-left:150px;">
997
+ <tr>
998
+ <td colspan="3">
999
+ <!--ADD_GROUPING_BUTTON-->
1000
+ </td>
1001
+ </tr>
1002
+ </table>
1003
+ </td>
1004
+ </tr>
1005
+
1006
+ <!--FOOTER SECTION-->
1007
+ <tr class="footer" style="display:none;">
1008
+ <td style="width:300px;">
1009
+ <h3>Build Customized Footer?:</h3>
1010
+ </td>
1011
+ <td>
1012
+ <input type="checkbox" name="footerOn" onchange="ShowFooterOptions();" id="footerOn" value="1" <!--FOOTER_CHECKED-->/>
1013
+ </td>
1014
+ <td>
1015
+
1016
+ </td>
1017
+ </tr>
1018
+ <tr class="footer footer_dependent" style="display:none;">
1019
+ <td colspan="3">
1020
+ <h1 style="margin-left:75px;">Footer Buttons:</h1>
1021
+ <script type="text/plain" id="default_footer_template">
1022
+ <!--FOOTER_BUTTON_TEMPLATE-->
1023
+ </script>
1024
+ <table style="margin-left:150px;" id="footer_table">
1025
+ <!--ALL_FOOTER_BUTTONS-->
1026
+ </table>
1027
+ <table style="margin-left:150px;">
1028
+ <tr>
1029
+ <td colspan="3">
1030
+ <!--ADD_THE_FOOTER_BUTTON-->
1031
+ </td>
1032
+ </tr>
1033
+ </table>
1034
+ </td>
1035
+ </tr>
1036
+
1037
+ <tr class="footer" style="display:none;">
1038
+ <td style="width:300px;">
1039
+ <h3>Show Pagination?:</h3>
1040
+ </td>
1041
+ <td>
1042
+ <input type="checkbox" name="showPagination" id="showPagination" value="1" <!--PAGINATION_CHECKED-->/>
1043
+ </td>
1044
+ <td>
1045
+
1046
+ </td>
1047
+ </tr>
1048
+
1049
+ <!--MISC & SUBMIT SECTION-->
1050
+
1051
+ <tr class="misc_submit" style="display:none;">
1052
+ <td style="width:300px;">
1053
+ <h3>Add Row Checkbox?:</h3>
1054
+ </td>
1055
+ <td>
1056
+ <input type="checkbox" name="checkboxEnabled" onchange="ShowCheckboxOptions();" id="checkboxEnabled" value="1" <!--SHOW_CHECKBOX_CHECKED-->/>
1057
+ </td>
1058
+ <td>
1059
+ &#160;
1060
+ </td>
1061
+ </tr>
1062
+
1063
+ <tr class="misc_submit checkbox_dependent" style="display:none;">
1064
+ <td colspan="3">
1065
+ <table style="margin-left:75px;">
1066
+ <tr>
1067
+ <td>
1068
+ <h3>Checkbox Value:</h3>
1069
+ </td>
1070
+ <td>
1071
+ <select name="checkboxField" id="checkboxField">
1072
+ <!--CHECKBOX_SELECTED_FIELDS-->
1073
+ </select>
1074
+ </td>
1075
+ <td>
1076
+ <!--CHECK_HELP_BUTTON-->
1077
+ </td>
1078
+ </tr>
1079
+ </table>
1080
+ </td>
1081
+ </tr>
1082
+ <tr class="misc_submit" style="display:none;" >
1083
+ <td>
1084
+ <h3>Submit:</h3>
1085
+ </td>
1086
+ <td>
1087
+ <!--SUBMIT_WIDGET_LIST-->
1088
+ </td>
1089
+ <td>
1090
+ &#160;
1091
+ </td>
1092
+ </tr>
1093
+
1094
+ <tr>
1095
+ <td colspan="3">
1096
+ <iframe src="" id="preview"></iframe>
1097
+ </td>
1098
+ </tr>
1099
+
1100
+ </table>
1101
1101
  </form>