widget_list 1.1.8 → 1.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -0
- data/app/views/widget_list/_ransack_widget_list_advanced_search.html.erb +10 -0
- data/app/views/widget_list/list_partials/_col.html.erb +1 -0
- data/app/views/widget_list/list_partials/_list_description.html.erb +0 -0
- data/app/views/widget_list/list_partials/_no_sort_column.html.erb +1 -0
- data/app/views/widget_list/list_partials/_outer_shell.html.erb +20 -0
- data/app/views/widget_list/list_partials/_pagination_jump_active.html.erb +1 -0
- data/app/views/widget_list/list_partials/_pagination_jump_unactive.html.erb +1 -0
- data/app/views/widget_list/list_partials/_pagination_next_active.html.erb +1 -0
- data/app/views/widget_list/list_partials/_pagination_next_disabled.html.erb +1 -0
- data/app/views/widget_list/list_partials/_pagination_previous_active.html.erb +1 -0
- data/app/views/widget_list/list_partials/_pagination_previous_disabled.html.erb +1 -0
- data/app/views/widget_list/list_partials/_pagination_wrapper.html.erb +7 -0
- data/app/views/widget_list/list_partials/_row.html.erb +1 -0
- data/app/views/widget_list/list_partials/_sequence.html.erb +1 -0
- data/app/views/widget_list/list_partials/_sort_column.html.erb +1 -0
- data/lib/widget_list.rb +108 -127
- data/lib/widget_list/version.rb +1 -1
- data/vendor/assets/javascripts/widget_list.js +7 -1
- data/vendor/assets/stylesheets/widget_list.css +0 -1
- metadata +16 -1
data/README.md
CHANGED
@@ -27,6 +27,9 @@ In rails you have will_paginate and other ones like it using the ActiveRecord ap
|
|
27
27
|
* Buttons for each row and areas on the bottom of the grid where you can add "Action buttons"
|
28
28
|
* Export visible data as CSV
|
29
29
|
* Grouping/Predefined report filter feature
|
30
|
+
* Either use a custom advanced searching form you build, or use the ransack dependency to build out a powerful filtering mechanism on the DOWN ARROW form users click. (See screenshots below)
|
31
|
+
* Granular control over site-wide list parameter defaults using [A WidgetList Helper][1] or by simply copying the desired partial from the gem's app/views/widget_list/list_partials into your app/views/widget_list/list_partials and modifying the template for your "site-wide template" and outer list shells
|
32
|
+
* Support for theme plugins such as [The Blue Sky Basin Theme][2]
|
30
33
|
|
31
34
|
****
|
32
35
|
|
@@ -188,6 +191,8 @@ widget_list features and configurations primarily work by a single large hash pa
|
|
188
191
|
|
189
192
|
`ransackSearch` - If you pass ModelName.search(params[:q]) ransack will show up in your advanced search `default=false`
|
190
193
|
|
194
|
+
`cornerRadius` - Either int number of pixels for radius corners. Or '14px' or whatever you want. `default=15`
|
195
|
+
|
191
196
|
`columnStyle` - Column styles. KEY=column name VALUE= the inline style applied `default={}`
|
192
197
|
|
193
198
|
`columnClass` - Column class. KEY=column name VALUE= the class name `default={}`
|
@@ -624,3 +629,6 @@ distributed under the License is distributed on an "AS IS" BASIS,
|
|
624
629
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
625
630
|
See the License for the specific language governing permissions and
|
626
631
|
limitations under the License.
|
632
|
+
|
633
|
+
[1]: https://github.com/davidrenne/widget_list_example/blob/master/app/helpers/widget_list_helper.rb
|
634
|
+
[2]: https://github.com/davidrenne/widget_list_theme_blue_sky_basin
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div id="advanced-search-container">
|
2
|
+
<div class="widget-search-drilldown-close" onclick="<!--BUTTON_CLOSE-->">X</div>
|
3
|
+
<ul class="advanced-search-container-inline" id="search_columns">
|
4
|
+
<li>
|
5
|
+
<!--RANSACK-->
|
6
|
+
</li>
|
7
|
+
</ul>
|
8
|
+
<br/>
|
9
|
+
<div style="text-align:right;width:100%;height:30px;" class="advanced-search-container-buttons"><!--BUTTON_RESET--><!--BUTTON_SEARCH--></div>
|
10
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<td class="<!--CLASS-->" align="<!--ALIGN-->" title="<!--TITLE-->" onclick="<!--ONCLICK-->" style="<!--STYLE-->"><!--CONTENT--></td>
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
<td style="font-weight:bold;<!--INLINE_STYLE-->" title="<!--TITLE_POPUP-->" id="<!--COL_HEADER_ID-->" class="<!--COL_HEADER_CLASS-->" valign="middle"><span style="background:none;"><!--TITLE--></span></td>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<!--WRAP_START-->
|
2
|
+
<!--HEADER-->
|
3
|
+
<!--CUSTOM_CONTENT_TOP-->
|
4
|
+
<div class="<!--CLASS-->" id="<!--NAME-->">
|
5
|
+
<table class="widget_list <!--TABLE_CLASS-->" style="<!--INLINE_STYLE-->;border:<!--TABLE_BORDER-->;-moz-border-radius-bottomleft:<!--CORNER_RADIUS-->;-webkit-border-bottom-left-radius:<!--CORNER_RADIUS-->;border-bottom-left-radius:<!--CORNER_RADIUS-->;-moz-border-radius-bottomright:<!--CORNER_RADIUS-->;-webkit-border-bottom-right-radius:<!--CORNER_RADIUS-->;border-bottom-right-radius:<!--CORNER_RADIUS-->;-moz-border-radius-topright:<!--CORNER_RADIUS-->;-webkit-border-top-right-radius:<!--CORNER_RADIUS-->;border-top-right-radius:<!--CORNER_RADIUS-->;-moz-border-radius-topleft:<!--CORNER_RADIUS-->;-webkit-border-top-left-radius:<!--CORNER_RADIUS-->;border-top-left-radius:<!--CORNER_RADIUS-->;" width="100%" cellpadding="0" cellspacing="0">
|
6
|
+
<!--LIST_TITLE-->
|
7
|
+
<tr class="widget_list_header" style="background-color:<!--HEADER_COLOR-->;color:<!--HEADER_TXT_COLOR-->;-moz-border-radius-topright:<!--CORNER_RADIUS-->;-webkit-border-top-right-radius:<!--CORNER_RADIUS-->;border-top-right-radius:<!--CORNER_RADIUS-->;-moz-border-radius-topleft:<!--CORNER_RADIUS-->;-webkit-border-top-left-radius:<!--CORNER_RADIUS-->;border-top-left-radius:<!--CORNER_RADIUS-->;"><!--HEADERS--></tr>
|
8
|
+
<!--DATA-->
|
9
|
+
<tr style="-moz-border-radius-bottomleft:<!--CORNER_RADIUS-->;-webkit-border-bottom-left-radius:<!--CORNER_RADIUS-->;border-bottom-left-radius:<!--CORNER_RADIUS-->;-moz-border-radius-bottomright:<!--CORNER_RADIUS-->;-webkit-border-bottom-right-radius:<!--CORNER_RADIUS-->;border-bottom-right-radius:<!--CORNER_RADIUS-->;">
|
10
|
+
<td colspan="<!--COLSPAN_FULL-->" align="left" style="padding:0px;margin:0px;text-align:left">
|
11
|
+
<div style="background-color:<!--FOOTER_COLOR-->;hieght:50px;color:<!--FOOTER_TXT_COLOR-->;-moz-border-radius-bottomleft:<!--CORNER_RADIUS-->;-webkit-border-bottom-left-radius:<!--CORNER_RADIUS-->;border-bottom-left-radius:<!--CORNER_RADIUS-->;-moz-border-radius-bottomright:<!--CORNER_RADIUS-->;-webkit-border-bottom-right-radius:<!--CORNER_RADIUS-->;border-bottom-right-radius:<!--CORNER_RADIUS-->;"><div style="padding:10px"><!--CUSTOM_CONTENT_BOTTOM--></div>
|
12
|
+
</td>
|
13
|
+
</tr>
|
14
|
+
</table>
|
15
|
+
<div class="pagination" style="float:left;text-align:left;width:100%;margin:0px;padding:0px;"><div style="margin:auto;float:left;margin:0px;padding:0px;"><!--PAGINATION_LIST--></div></div>
|
16
|
+
<!--FILTER-->
|
17
|
+
<input type="hidden" name="<!--JUMP_URL_NAME-->" id="<!--JUMP_URL_NAME-->" value="<!--JUMP_URL-->">
|
18
|
+
<input type="hidden" name="<!--NAME-->_radius" id="<!--NAME-->_radius" value="<!--CORNER_RADIUS-->">
|
19
|
+
</div>
|
20
|
+
<!--WRAP_END-->
|
@@ -0,0 +1 @@
|
|
1
|
+
<li><div class="active"><!--SEQUENCE--></div></li>
|
@@ -0,0 +1 @@
|
|
1
|
+
<li onclick="<!--FUNCTION-->('<!--JUMP_URL-->','<!--LIST_NAME-->');<!--FUNCTION_ALL-->"><div><!--SEQUENCE--></div></li>
|
@@ -0,0 +1 @@
|
|
1
|
+
<li><span id="<!--LIST_NAME-->_next" onclick="<!--FUNCTION-->('<!--NEXT_URL-->','<!--LIST_NAME-->');<!--FUNCTION_ALL-->" style="cursor:pointer;background: transparent url(/assets/images/page-next.gif) no-repeat"> </span></li>
|
@@ -0,0 +1 @@
|
|
1
|
+
<li><span id="<!--LIST_NAME-->_next" style="opacity:0.4;filter:alpha(opacity=40);background: transparent url(/assets/images/page-next.gif) no-repeat"> </span></li>
|
@@ -0,0 +1 @@
|
|
1
|
+
<li><span id="<!--LIST_NAME-->_previous" onclick="<!--FUNCTION-->('<!--PREVIOUS_URL-->','<!--LIST_NAME-->');<!--FUNCTION_ALL-->" style="cursor:pointer;background: transparent url(/assets/images/page-back.gif) no-repeat"> </span></li>
|
@@ -0,0 +1 @@
|
|
1
|
+
<li><span id="<!--LIST_NAME-->_previous" style="opacity:0.4;filter:alpha(opacity=40);background: transparent url(/assets/images/page-back.gif) no-repeat"> </span></li>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<ul id="pagination" class="page_legacy">
|
2
|
+
Page <!--PREVIOUS_BUTTON-->
|
3
|
+
<input type="text" value="<!--SEQUENCE-->" size="1" style="width:15px;padding:0px;font-size:10px;" onblur="">
|
4
|
+
<input type="hidden" id="<!--LIST_NAME-->_total_rows" value="<!--TOTAL_ROWS-->">
|
5
|
+
<!--NEXT_BUTTON--> of <!--TOTAL_PAGES--> pages <span style="margin-left:20px">Total <!--TOTAL_ROWS--> records found</span>
|
6
|
+
<span style="padding-left:20px;">Show <!--PAGE_SEQUENCE_JUMP_LIST--> per page</span>
|
7
|
+
</ul>
|
@@ -0,0 +1 @@
|
|
1
|
+
<tr style="background-color:<!--BGCOLOR-->;<!--ROWSTYLE-->" class="<!--ROWCLASS-->"><!--CONTENT--></tr>
|
@@ -0,0 +1 @@
|
|
1
|
+
<!--LIST_SEQUENCE--> of <!--TOTAL_PAGES-->
|
@@ -0,0 +1 @@
|
|
1
|
+
<td style="font-weight:bold;<!--INLINE_STYLE-->" id="<!--COL_HEADER_ID-->" class="<!--COL_HEADER_CLASS-->" title="<!--TITLE_POPUP-->" valign="middle"><span onclick="<!--FUNCTION-->('<!--COLSORTURL-->','<!--NAME-->');<!--FUNCTION_ALL-->" style="cursor:pointer;background:none;"><!--TITLE--><!--COLSORTICON-></span></td>
|
data/lib/widget_list.rb
CHANGED
@@ -13,6 +13,26 @@ require 'extensions/action_controller_base'
|
|
13
13
|
|
14
14
|
module WidgetList
|
15
15
|
|
16
|
+
#
|
17
|
+
# WidgetList Administration/Setup
|
18
|
+
#
|
19
|
+
def self.go!()
|
20
|
+
list = WidgetList::List.new()
|
21
|
+
return list.render()
|
22
|
+
end
|
23
|
+
|
24
|
+
class Administration
|
25
|
+
def show_interface()
|
26
|
+
return '
|
27
|
+
<h1 style="font-size:24px;"><!--TITLE--></h1><div class="horizontal_rule"></div>
|
28
|
+
'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
#
|
34
|
+
# WidgetList Core Logic
|
35
|
+
#
|
16
36
|
if defined?(Rails) && defined?(Rails::Engine)
|
17
37
|
class Engine < ::Rails::Engine
|
18
38
|
require 'widget_list/engine'
|
@@ -23,6 +43,8 @@ module WidgetList
|
|
23
43
|
|
24
44
|
@debug = true
|
25
45
|
|
46
|
+
attr_accessor :isAdministrating
|
47
|
+
|
26
48
|
include ActionView::Helpers::SanitizeHelper
|
27
49
|
|
28
50
|
# @param [Hash] list
|
@@ -30,8 +52,16 @@ module WidgetList
|
|
30
52
|
|
31
53
|
# Defaults for all configs
|
32
54
|
# See https://github.com/davidrenne/widget_list/blob/master/README.md#feature-configurations
|
55
|
+
|
33
56
|
@items = WidgetList::List::get_defaults()
|
34
57
|
|
58
|
+
if list.empty? || list == @items
|
59
|
+
@isAdministrating = true
|
60
|
+
return
|
61
|
+
else
|
62
|
+
@isAdministrating = false
|
63
|
+
end
|
64
|
+
|
35
65
|
@csv = []
|
36
66
|
@csv << []
|
37
67
|
@totalRowCount= 0
|
@@ -49,153 +79,78 @@ module WidgetList
|
|
49
79
|
@results = {}
|
50
80
|
@headerPieces = {}
|
51
81
|
|
52
|
-
|
53
|
-
@items.deep_merge!({'template' =>
|
54
|
-
'
|
55
|
-
<!--WRAP_START-->
|
56
|
-
<!--HEADER-->
|
57
|
-
<!--CUSTOM_CONTENT_TOP-->
|
58
|
-
<div class="<!--CLASS-->" id="<!--NAME-->">
|
59
|
-
<table class="widget_list <!--TABLE_CLASS-->" style="<!--INLINE_STYLE-->;border:<!--TABLE_BORDER-->;" width="100%" cellpadding="0" cellspacing="0">
|
60
|
-
<!--LIST_TITLE-->
|
61
|
-
<tr class="widget_list_header" style="background-color:<!--HEADER_COLOR-->;color:<!--HEADER_TXT_COLOR-->;"><!--HEADERS--></tr>
|
62
|
-
<!--DATA-->
|
63
|
-
<tr>
|
64
|
-
<td colspan="<!--COLSPAN_FULL-->" align="left" style="padding:0px;margin:0px;text-align:left">
|
65
|
-
<div style="background-color:<!--FOOTER_COLOR-->;hieght:50px;color:<!--FOOTER_TXT_COLOR-->;"><div style="padding:10px"><!--CUSTOM_CONTENT_BOTTOM--></div>
|
66
|
-
</td>
|
67
|
-
</tr>
|
68
|
-
</table>
|
69
|
-
<div class="pagination" style="float:left;text-align:left;width:100%;margin:0px;padding:0px;"><div style="margin:auto;float:left;margin:0px;padding:0px;"><!--PAGINATION_LIST--></div></div>
|
70
|
-
<!--FILTER-->
|
71
|
-
<input type="hidden" name="<!--JUMP_URL_NAME-->" id="<!--JUMP_URL_NAME-->" value="<!--JUMP_URL-->">
|
72
|
-
</div>
|
73
|
-
<!--WRAP_END-->
|
74
|
-
'
|
75
|
-
})
|
76
|
-
|
77
|
-
@items.deep_merge!({'row' =>
|
78
|
-
'
|
79
|
-
<tr style="background-color:<!--BGCOLOR-->;<!--ROWSTYLE-->" class="<!--ROWCLASS-->"><!--CONTENT--></tr>
|
80
|
-
'
|
81
|
-
})
|
82
|
+
ac = ActionController::Base.new()
|
82
83
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
})
|
90
|
-
|
91
|
-
@items.deep_merge!({'col' =>
|
92
|
-
'
|
93
|
-
<td class="<!--CLASS-->" align="<!--ALIGN-->" title="<!--TITLE-->" onclick="<!--ONCLICK-->" style="<!--STYLE-->"><!--CONTENT--></td>
|
94
|
-
'
|
95
|
-
})
|
84
|
+
#the main template and outer shell
|
85
|
+
@items.deep_merge!({ 'template' => ac.render_to_string(:partial => 'widget_list/list_partials/outer_shell') })
|
86
|
+
@items.deep_merge!({ 'row' => ac.render_to_string(:partial => 'widget_list/list_partials/row') })
|
87
|
+
@items.deep_merge!({ 'list_description' => ac.render_to_string(:partial => 'widget_list/list_partials/list_description') })
|
88
|
+
@items.deep_merge!({ 'col' => ac.render_to_string(:partial => 'widget_list/list_partials/col') })
|
89
|
+
@items.deep_merge!({ 'templateSequence' => ac.render_to_string(:partial => 'widget_list/list_partials/sequence') })
|
96
90
|
|
97
|
-
@items.deep_merge!({'templateSequence' =>
|
98
|
-
'
|
99
|
-
<!--LIST_SEQUENCE--> of <!--TOTAL_PAGES-->
|
100
|
-
'
|
101
|
-
})
|
102
91
|
#Sorting
|
103
92
|
#
|
104
|
-
@items.deep_merge!({'templateSortColumn' =>
|
105
|
-
|
106
|
-
<td style="font-weight:bold;<!--INLINE_STYLE--><!--INLINE_STYLE-->" id="<!--COL_HEADER_ID-->" class="<!--COL_HEADER_CLASS-->" title="<!--TITLE_POPUP-->" valign="middle"><span onclick="<!--FUNCTION-->(\'<!--COLSORTURL-->\',\'<!--NAME-->\');<!--FUNCTION_ALL-->" style="cursor:pointer;background:none;"><!--TITLE--><!--COLSORTICON-></span></td>
|
107
|
-
'
|
108
|
-
})
|
93
|
+
@items.deep_merge!({ 'templateSortColumn' => ac.render_to_string(:partial => 'widget_list/list_partials/sort_column') })
|
94
|
+
@items.deep_merge!({ 'templateNoSortColumn' => ac.render_to_string(:partial => 'widget_list/list_partials/no_sort_column') })
|
109
95
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
@items.deep_merge!({'
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
96
|
+
#Pagintion
|
97
|
+
#
|
98
|
+
@items.deep_merge!({ 'template_pagination_wrapper' => ac.render_to_string(:partial => 'widget_list/list_partials/pagination_wrapper') })
|
99
|
+
@items.deep_merge!({ 'template_pagination_next_active' => ac.render_to_string(:partial => 'widget_list/list_partials/pagination_next_active') })
|
100
|
+
@items.deep_merge!({ 'template_pagination_next_disabled' => ac.render_to_string(:partial => 'widget_list/list_partials/pagination_next_disabled') })
|
101
|
+
@items.deep_merge!({ 'template_pagination_previous_active' => ac.render_to_string(:partial => 'widget_list/list_partials/pagination_previous_active') })
|
102
|
+
@items.deep_merge!({ 'template_pagination_previous_disabled' => ac.render_to_string(:partial => 'widget_list/list_partials/pagination_previous_disabled') })
|
103
|
+
@items.deep_merge!({ 'template_pagination_jump_active' => ac.render_to_string(:partial => 'widget_list/list_partials/pagination_jump_active') })
|
104
|
+
@items.deep_merge!({ 'template_pagination_jump_unactive' => ac.render_to_string(:partial => 'widget_list/list_partials/pagination_jump_unactive') })
|
105
|
+
|
106
|
+
|
107
|
+
@items.deep_merge!({ 'statement' =>
|
108
|
+
{'select'=>
|
109
|
+
{'view' =>
|
121
110
|
'
|
122
|
-
|
123
|
-
|
111
|
+
SELECT <!--FIELDS--> FROM <!--SOURCE--> <!--WHERE--> <!--GROUPBY--> <!--ORDERBY--> <!--LIMIT-->
|
112
|
+
'
|
113
|
+
}
|
114
|
+
}
|
124
115
|
})
|
125
116
|
|
126
|
-
@items.deep_merge!({'statement' =>
|
127
|
-
|
128
|
-
|
129
|
-
|
117
|
+
@items.deep_merge!({ 'statement' =>
|
118
|
+
{'count'=>
|
119
|
+
{'view' =>
|
120
|
+
'
|
130
121
|
SELECT count(1) total FROM <!--VIEW--> <!--WHERE--> <!--GROUPBY-->
|
131
122
|
'
|
132
|
-
|
133
|
-
|
134
|
-
})
|
135
|
-
|
136
|
-
#Pagintion
|
137
|
-
#
|
138
|
-
|
139
|
-
@items.deep_merge!({'template_pagination_wrapper' =>
|
140
|
-
'
|
141
|
-
<ul id="pagination" class="page_legacy">
|
142
|
-
Page <!--PREVIOUS_BUTTON-->
|
143
|
-
<input type="text" value="<!--SEQUENCE-->" size="1" style="width:15px;padding:0px;font-size:10px;" onblur="">
|
144
|
-
<input type="hidden" id="<!--LIST_NAME-->_total_rows" value="<!--TOTAL_ROWS-->">
|
145
|
-
<!--NEXT_BUTTON--> of <!--TOTAL_PAGES--> pages <span style="margin-left:20px">Total <!--TOTAL_ROWS--> records found</span>
|
146
|
-
<span style="padding-left:20px;">Show <!--PAGE_SEQUENCE_JUMP_LIST--> per page</span>
|
147
|
-
</ul>
|
148
|
-
'
|
149
|
-
})
|
150
|
-
|
151
|
-
@items.deep_merge!({'template_pagination_next_active' =>
|
152
|
-
"
|
153
|
-
<li><span id=\"<!--LIST_NAME-->_next\" onclick=\"<!--FUNCTION-->('<!--NEXT_URL-->','<!--LIST_NAME-->');<!--FUNCTION_ALL-->\" style=\"cursor:pointer;background: transparent url(/assets/images/page-next.gif) no-repeat\"> </span></li>
|
154
|
-
"
|
155
|
-
})
|
156
|
-
|
157
|
-
@items.deep_merge!({'template_pagination_next_disabled' =>
|
158
|
-
"
|
159
|
-
<li><span id=\"<!--LIST_NAME-->_next\" style=\"opacity:0.4;filter:alpha(opacity=40);background: transparent url(/assets/images/page-next.gif) no-repeat\"> </span></li>
|
160
|
-
"
|
161
|
-
})
|
162
|
-
|
163
|
-
@items.deep_merge!({'template_pagination_previous_active' =>
|
164
|
-
"
|
165
|
-
<li><span id=\"<!--LIST_NAME-->_previous\" onclick=\"<!--FUNCTION-->('<!--PREVIOUS_URL-->','<!--LIST_NAME-->');<!--FUNCTION_ALL-->\" style=\"cursor:pointer;background: transparent url(/assets/images/page-back.gif) no-repeat\"> </span></li>
|
166
|
-
"
|
167
|
-
})
|
168
|
-
|
169
|
-
@items.deep_merge!({'template_pagination_previous_disabled' =>
|
170
|
-
"
|
171
|
-
<li><span id=\"<!--LIST_NAME-->_previous\" style=\"opacity:0.4;filter:alpha(opacity=40);background: transparent url(/assets/images/page-back.gif) no-repeat\"> </span></li>
|
172
|
-
"
|
173
|
-
})
|
174
|
-
|
175
|
-
@items.deep_merge!({'template_pagination_jump_active' =>
|
176
|
-
'
|
177
|
-
<li><div class="active"><!--SEQUENCE--></div></li>
|
178
|
-
'
|
179
|
-
})
|
180
|
-
|
181
|
-
@items.deep_merge!({'template_pagination_jump_unactive' =>
|
182
|
-
'
|
183
|
-
<li onclick="<!--FUNCTION-->(\'<!--JUMP_URL-->\',\'<!--LIST_NAME-->\');<!--FUNCTION_ALL-->"><div><!--SEQUENCE--></div></li>
|
184
|
-
'
|
123
|
+
}
|
124
|
+
}
|
185
125
|
})
|
186
|
-
|
187
|
-
|
188
126
|
#inject site wide configs before list specific configs if a helper exists
|
189
127
|
|
190
128
|
if defined?(WidgetListHelper) == 'constant' && WidgetListHelper::SiteDefaults.class == Class && WidgetListHelper::SiteDefaults.respond_to?('get_site_widget_list_defaults')
|
191
129
|
@items = WidgetList::Widgets::populate_items(WidgetListHelper::SiteDefaults::get_site_widget_list_defaults() ,@items)
|
192
130
|
end
|
193
131
|
|
132
|
+
if defined?(WidgetListThemeHelper) == 'constant' && WidgetListThemeHelper::ThemeDefaults.class == Class && WidgetListThemeHelper::ThemeDefaults.respond_to?('get_theme_widget_list_defaults')
|
133
|
+
@items = WidgetList::Widgets::populate_items(WidgetListThemeHelper::ThemeDefaults::get_theme_widget_list_defaults() ,@items)
|
134
|
+
end
|
135
|
+
|
194
136
|
@items = WidgetList::Widgets::populate_items(list,@items)
|
195
137
|
|
196
138
|
# If ransack is used
|
197
139
|
if @items['view'].class.name == 'ActiveRecord::Relation' && @items['ransackSearch'].class.name == 'Ransack::Search'
|
198
140
|
@items['ransackSearch'].build_condition if @items['ransackSearch'].conditions.empty?
|
141
|
+
|
142
|
+
if @items['listSearchForm'].empty?
|
143
|
+
|
144
|
+
#
|
145
|
+
# if no one passed a listSearchForm inject a default one to show the ransack form
|
146
|
+
#
|
147
|
+
fill = {
|
148
|
+
'<!--BUTTON_SEARCH-->' => WidgetList::Widgets::widget_button('Search', {'onclick' => WidgetList::List::build_search_button_click(@items)}),
|
149
|
+
'<!--BUTTON_CLOSE-->' => "HideAdvancedSearch(this)"
|
150
|
+
}
|
151
|
+
@items['listSearchForm'] = WidgetList::Utils::fill( fill , ac.render_to_string(:partial => 'widget_list/ransack_widget_list_advanced_search') )
|
152
|
+
|
153
|
+
end
|
199
154
|
end
|
200
155
|
|
201
156
|
# current_db is a flag of the last known primary or secondary YML used or defaulted when running a list
|
@@ -664,6 +619,7 @@ module WidgetList
|
|
664
619
|
'footerFontColor' => '#494949',
|
665
620
|
'headerFontColor' => '#494949',
|
666
621
|
'tableBorder' => '1',
|
622
|
+
'cornerRadius' => 15,
|
667
623
|
|
668
624
|
#
|
669
625
|
# Row specifics
|
@@ -966,6 +922,10 @@ module WidgetList
|
|
966
922
|
# pass results of $DATABASE.final_results after running a _select query
|
967
923
|
def render(results={})
|
968
924
|
|
925
|
+
if @isAdministrating
|
926
|
+
return WidgetList::Administration.new.show_interface()
|
927
|
+
end
|
928
|
+
|
969
929
|
begin
|
970
930
|
if !results.empty?
|
971
931
|
@items['data'] = results
|
@@ -1012,6 +972,7 @@ module WidgetList
|
|
1012
972
|
listJumpUrl['switch_grouping'] = $_REQUEST['switch_grouping']
|
1013
973
|
end
|
1014
974
|
|
975
|
+
@templateFill['<!--CORNER_RADIUS-->'] = get_radius_value()
|
1015
976
|
@templateFill['<!--CUSTOM_CONTENT_BOTTOM-->']= @items['customFooter']
|
1016
977
|
@templateFill['<!--CUSTOM_CONTENT_TOP-->'] = @items['customHeader']
|
1017
978
|
@templateFill['<!--WRAP_START-->'] = ''
|
@@ -1204,6 +1165,10 @@ module WidgetList
|
|
1204
1165
|
end
|
1205
1166
|
end
|
1206
1167
|
|
1168
|
+
def get_radius_value()
|
1169
|
+
@items['cornerRadius'].to_s.include?('px') ? @items['cornerRadius'].to_s : @items['cornerRadius'].to_s + 'px'
|
1170
|
+
end
|
1171
|
+
|
1207
1172
|
def get_header_pieces()
|
1208
1173
|
@headerPieces
|
1209
1174
|
end
|
@@ -1434,6 +1399,8 @@ module WidgetList
|
|
1434
1399
|
|
1435
1400
|
def build_headers()
|
1436
1401
|
headers = []
|
1402
|
+
|
1403
|
+
ii = 0
|
1437
1404
|
@items['fields'].each { |field, fieldTitle|
|
1438
1405
|
colWidthStyle = '';
|
1439
1406
|
colClass = '';
|
@@ -1511,6 +1478,16 @@ module WidgetList
|
|
1511
1478
|
|
1512
1479
|
end
|
1513
1480
|
|
1481
|
+
#Add in radius
|
1482
|
+
if ii == @items['fields'].length - 1
|
1483
|
+
colWidthStyle += '-moz-border-radius-topright:' + get_radius_value() + ';-webkit-border-top-right-radius:' + get_radius_value() + ';border-top-right-radius:' + get_radius_value() + ';'
|
1484
|
+
|
1485
|
+
end
|
1486
|
+
|
1487
|
+
if ii == 0
|
1488
|
+
colWidthStyle += '-moz-border-radius-topleft:' + get_radius_value() + ';-webkit-border-top-left-radius:' + get_radius_value() + ';border-top-left-radius:' + get_radius_value() + ';'
|
1489
|
+
end
|
1490
|
+
|
1514
1491
|
if (@items['useSort'] && (@items['columnSort'].include?(field) || (@items['columnSort'].key?(field)) && !@items['columnNoSort'].include?(field)) || (@items['columnSort'].empty? && !@items['columnNoSort'].include?(field)))
|
1515
1492
|
|
1516
1493
|
templateIdx = 'templateSortColumn'
|
@@ -1606,6 +1583,7 @@ module WidgetList
|
|
1606
1583
|
headers << WidgetList::Utils::fill(pieces, @items[templateIdx])
|
1607
1584
|
end
|
1608
1585
|
|
1586
|
+
ii = ii + 1
|
1609
1587
|
}
|
1610
1588
|
|
1611
1589
|
@templateFill['<!--COLSPAN_FULL-->'] = headers.count()
|
@@ -1779,7 +1757,11 @@ module WidgetList
|
|
1779
1757
|
#
|
1780
1758
|
# Else assign to variable for view
|
1781
1759
|
#
|
1782
|
-
|
1760
|
+
if list.isAdministrating
|
1761
|
+
return list.render()
|
1762
|
+
else
|
1763
|
+
return ['html', list.render() ]
|
1764
|
+
end
|
1783
1765
|
end
|
1784
1766
|
|
1785
1767
|
end
|
@@ -2061,7 +2043,6 @@ module WidgetList
|
|
2061
2043
|
#
|
2062
2044
|
# For each column (field) in this row
|
2063
2045
|
#
|
2064
|
-
|
2065
2046
|
@items['fields'].each { |column , fieldTitle|
|
2066
2047
|
column = strip_aliases(column)
|
2067
2048
|
|
data/lib/widget_list/version.rb
CHANGED
@@ -150,7 +150,13 @@ function ajaxStatus(eToHide, fadeInOut)
|
|
150
150
|
}
|
151
151
|
else
|
152
152
|
{
|
153
|
-
var
|
153
|
+
var radius = '';
|
154
|
+
if(document.getElementById(eToHide + '_radius'))
|
155
|
+
{
|
156
|
+
var radiusValue = document.getElementById(eToHide + '_radius').value;
|
157
|
+
radius = '-moz-border-radius-bottomleft:' + radiusValue + ';-webkit-border-bottom-left-radius:' + radiusValue + ';border-bottom-left-radius:' + radiusValue + ';-moz-border-radius-bottomright:' + radiusValue + ';-webkit-border-bottom-right-radius:' + radiusValue + ';border-bottom-right-radius:' + radiusValue + ';-moz-border-radius-topright:' + radiusValue + ';-webkit-border-top-right-radius:' + radiusValue + ';border-top-right-radius:' + radiusValue + ';-moz-border-radius-topleft:' + radiusValue + ';-webkit-border-top-left-radius:' + radiusValue + ';border-top-left-radius:' + radiusValue + ';';
|
158
|
+
}
|
159
|
+
var overLay = '<div style="position:relative;top:0px;"><div class="ajaxLoad" id="' + eHider + '" style="height:' + jQuery(elmToHide).height() + 'px;width:' + jQuery(elmToHide).width() + 'px;top:-' + jQuery(elmToHide).height() + 'px;' + radius + '"></div></div>';
|
154
160
|
|
155
161
|
jQuery(elmToHide).append(overLay);
|
156
162
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: widget_list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -68,6 +68,21 @@ files:
|
|
68
68
|
- Rakefile
|
69
69
|
- app/views/widget_list/_condition_fields.html.erb
|
70
70
|
- app/views/widget_list/_ransack_fields.html.erb
|
71
|
+
- app/views/widget_list/_ransack_widget_list_advanced_search.html.erb
|
72
|
+
- app/views/widget_list/list_partials/_col.html.erb
|
73
|
+
- app/views/widget_list/list_partials/_list_description.html.erb
|
74
|
+
- app/views/widget_list/list_partials/_no_sort_column.html.erb
|
75
|
+
- app/views/widget_list/list_partials/_outer_shell.html.erb
|
76
|
+
- app/views/widget_list/list_partials/_pagination_jump_active.html.erb
|
77
|
+
- app/views/widget_list/list_partials/_pagination_jump_unactive.html.erb
|
78
|
+
- app/views/widget_list/list_partials/_pagination_next_active.html.erb
|
79
|
+
- app/views/widget_list/list_partials/_pagination_next_disabled.html.erb
|
80
|
+
- app/views/widget_list/list_partials/_pagination_previous_active.html.erb
|
81
|
+
- app/views/widget_list/list_partials/_pagination_previous_disabled.html.erb
|
82
|
+
- app/views/widget_list/list_partials/_pagination_wrapper.html.erb
|
83
|
+
- app/views/widget_list/list_partials/_row.html.erb
|
84
|
+
- app/views/widget_list/list_partials/_sequence.html.erb
|
85
|
+
- app/views/widget_list/list_partials/_sort_column.html.erb
|
71
86
|
- lib/extensions/action_controller_base.rb
|
72
87
|
- lib/widget_list.rb
|
73
88
|
- lib/widget_list/engine.rb
|