it-logica-application-backbone 1.0.45 → 1.0.46
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/assets/javascripts/backbone_js/ladas_table_sorting.js.coffee +79 -6
- data/app/assets/stylesheets/backbone_css/overrides_of_lach_design.css.scss +49 -0
- data/app/views/helpers/_build_table_wrapper.html.erb +55 -65
- data/it-logica-application-backbone.gemspec +1 -1
- metadata +14 -14
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.46
|
@@ -45,22 +45,22 @@ class TableSorting
|
|
45
45
|
|
46
46
|
$("#" + form_id + " .sort_button").each (index, element) =>
|
47
47
|
$(element).removeClass("btn-success")
|
48
|
-
|
49
|
-
|
48
|
+
#$(element).addClass("inactive") # give all disabled class
|
49
|
+
|
50
50
|
|
51
51
|
new_order_by_val = ""
|
52
52
|
for element in order_by_array
|
53
53
|
if (new_order_by_val != "")
|
54
54
|
new_order_by_val += ","
|
55
|
-
|
55
|
+
|
56
56
|
#console.log(element)
|
57
57
|
new_order_by_val += element
|
58
|
-
|
58
|
+
|
59
59
|
order_by_button_id = "#" + element.replace(" ", "___").replace(".", "___")
|
60
60
|
#console.log(order_by_button_id)
|
61
61
|
#$(order_by_button_id).removeClass("inactive")
|
62
62
|
$(order_by_button_id).addClass("btn-success")
|
63
|
-
|
63
|
+
|
64
64
|
#console.log(new_order_by_val)
|
65
65
|
|
66
66
|
$(order_by_id).val(new_order_by_val)
|
@@ -78,7 +78,7 @@ class TableSorting
|
|
78
78
|
|
79
79
|
$("#" + form_id + " .sort_button").each (index, element) =>
|
80
80
|
$(element).removeClass("btn-success")
|
81
|
-
|
81
|
+
#$(element).addClass("inactive") # give all disabled class
|
82
82
|
|
83
83
|
element = order_by_value + " " + dir
|
84
84
|
order_by_button_id = "#" + element.replace(" ", "___").replace(".", "___")
|
@@ -91,6 +91,79 @@ class TableSorting
|
|
91
91
|
form_submit_watcher(form_id)
|
92
92
|
|
93
93
|
|
94
|
+
@force_toggled_change_sorting: (form_id, order_by_value, obj) ->
|
95
|
+
order_by_value = order_by_value.toLowerCase()
|
96
|
+
|
97
|
+
parent_th = $(obj)
|
98
|
+
if parent_th.hasClass("sorted")
|
99
|
+
if parent_th.hasClass("sorted_asc")
|
100
|
+
dir = "desc"
|
101
|
+
else
|
102
|
+
dir = "asc"
|
103
|
+
else
|
104
|
+
dir = "asc"
|
105
|
+
|
106
|
+
order_by_id = '#' + form_id + '_order_by'
|
107
|
+
|
108
|
+
$("#" + form_id + " .sorting_th").each (index, element) =>
|
109
|
+
$(element).removeClass("sorted").removeClass("sorted_desc").removeClass("sorted_asc")
|
110
|
+
$(element).removeClass("sorted_desc_hover").removeClass("sorted_asc_hover")
|
111
|
+
|
112
|
+
element = order_by_value + " " + dir
|
113
|
+
order_by_button_class = "." + element.replace(" ", "___").replace(".", "___")
|
114
|
+
#$(order_by_button_id).removeClass("inactive")
|
115
|
+
$(order_by_button_class).addClass("sorted").addClass("sorted_" + dir)
|
116
|
+
;
|
117
|
+
|
118
|
+
$(order_by_id).val(element)
|
119
|
+
|
120
|
+
#$('#' + form_id).submit()
|
121
|
+
form_submit_watcher(form_id)
|
122
|
+
|
123
|
+
|
124
|
+
@mouse_over_hover_sorting: (form_id, order_by_value, obj) ->
|
125
|
+
order_by_value = order_by_value.toLowerCase()
|
126
|
+
|
127
|
+
parent_th = $(obj)
|
128
|
+
if parent_th.hasClass("sorted")
|
129
|
+
if parent_th.hasClass("sorted_asc")
|
130
|
+
dir = "desc"
|
131
|
+
else
|
132
|
+
dir = "asc"
|
133
|
+
else
|
134
|
+
dir = "asc"
|
135
|
+
|
136
|
+
order_by_id = '#' + form_id + '_order_by'
|
137
|
+
|
138
|
+
$("#" + form_id + " .sorting_th").each (index, element) =>
|
139
|
+
$(element).removeClass("sorted_desc_hover").removeClass("sorted_asc_hover")
|
140
|
+
|
141
|
+
element = order_by_value + " " + dir
|
142
|
+
order_by_button_class = "." + element.replace(" ", "___").replace(".", "___")
|
143
|
+
#$(order_by_button_id).removeClass("inactive")
|
144
|
+
$(order_by_button_class).addClass("sorted_" + dir + "_hover")
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
@mouse_out_hover_sorting: (form_id, order_by_value, obj) ->
|
149
|
+
order_by_value = order_by_value.toLowerCase()
|
150
|
+
|
151
|
+
parent_th = $(obj)
|
152
|
+
if parent_th.hasClass("sorted")
|
153
|
+
if parent_th.hasClass("sorted_asc")
|
154
|
+
dir = "desc"
|
155
|
+
else
|
156
|
+
dir = "asc"
|
157
|
+
else
|
158
|
+
dir = "asc"
|
159
|
+
|
160
|
+
order_by_id = '#' + form_id + '_order_by'
|
161
|
+
|
162
|
+
$("#" + form_id + " .sorting_th").each (index, element) =>
|
163
|
+
$(element).removeClass("sorted_desc_hover").removeClass("sorted_asc_hover")
|
164
|
+
|
165
|
+
|
166
|
+
|
94
167
|
|
95
168
|
window.TableSorting = TableSorting
|
96
169
|
|
@@ -45,3 +45,52 @@ li.active > a {
|
|
45
45
|
min-height: 49px;
|
46
46
|
}
|
47
47
|
|
48
|
+
|
49
|
+
.dataGrid table thead th.sorted_desc_hover {
|
50
|
+
background-image: url('/assets/backbone_images/control_icons/sort_desc_hover.png') !important;
|
51
|
+
background-repeat: no-repeat;
|
52
|
+
background-position: right top;
|
53
|
+
background-color: #F5F3EF;
|
54
|
+
}
|
55
|
+
|
56
|
+
.dataGrid table thead th.sorted_asc_hover {
|
57
|
+
background-image: url('/assets/backbone_images/control_icons/sort_asc_hover.png') !important;
|
58
|
+
background-repeat: no-repeat;
|
59
|
+
background-position: right top;
|
60
|
+
background-color: #F5F3EF;
|
61
|
+
}
|
62
|
+
|
63
|
+
.dataGrid table thead th.sorted_asc {
|
64
|
+
background-image: url('/assets/backbone_images/control_icons/sort_asc.png');
|
65
|
+
background-repeat: no-repeat;
|
66
|
+
background-position: right top;
|
67
|
+
background-color: #F1FADF;
|
68
|
+
}
|
69
|
+
|
70
|
+
.dataGrid table thead th.sorted_desc {
|
71
|
+
background-image: url('/assets/backbone_images/control_icons/sort_desc.png');
|
72
|
+
background-repeat: no-repeat;
|
73
|
+
background-position: right top;
|
74
|
+
background-color: #F1FADF;
|
75
|
+
}
|
76
|
+
|
77
|
+
.dataGrid table thead th.sorting_th {
|
78
|
+
cursor: pointer;
|
79
|
+
}
|
80
|
+
|
81
|
+
.dataGrid table th.filtering_th {
|
82
|
+
border: 1px solid #CCC;
|
83
|
+
padding: 4px 12px;
|
84
|
+
}
|
85
|
+
|
86
|
+
.dataGrid table thead th .inputs.small_padding input.text {
|
87
|
+
padding: 1px;
|
88
|
+
}
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
@@ -1,84 +1,26 @@
|
|
1
1
|
<table class="table table-bordered table-condensed table_special">
|
2
2
|
<thead>
|
3
|
-
|
4
|
-
<!--<th colspan="100" class="<%#= settings[:form_id] + '_ajax_pager' %>">-->
|
5
|
-
<!--<%#= render :partial => 'helpers/build_table_pager', :locals => {:settings => settings} %>-->
|
6
|
-
<!--</th>-->
|
7
|
-
<!--</tr>-->
|
8
|
-
<tr>
|
3
|
+
<tr class="filtering_tr">
|
9
4
|
<% if !settings[:checkboxes].blank? && settings[:checkboxes] %>
|
10
|
-
<th class="chbox">
|
11
|
-
|
12
|
-
<!--<div class="checkboxes_filtered">-->
|
13
|
-
<!--Filtrováno položek:-->
|
14
|
-
<!--<span id="<%#= settings[:form_id]+ "_active_checkboxes_count" %>">-->
|
15
|
-
<!--<%#= !settings[:params]["checkbox_pool"].blank? ? settings[:params]["checkbox_pool"].split(",").count : 0 %>-->
|
16
|
-
<!--</span>-->
|
17
|
-
<!--<a onclick="CheckboxPool.clear_by_form_id('<%#= settings[:form_id] %>')" class="btn uncheck">Odznačit vše</a>-->
|
18
|
-
<!--</div>-->
|
19
|
-
|
20
|
-
<!--<span title="Počet označených řádků na všech stránkách" id="<%#= settings[:form_id]+ "_active_checkboxes_count" %>">-->
|
21
|
-
<!--<%#= !settings[:params]["checkbox_pool"].blank? ? settings[:params]["checkbox_pool"].split(",").count : 0 %>-->
|
22
|
-
<!--</span>-->
|
23
|
-
<!--<br/>-->
|
24
|
-
<input type="checkbox" title="Označit/odznačit vše na stránce" onclick="CheckboxPool.check_or_uncheck_page(this, '<%= settings[:form_id] %>')" id=""/>
|
25
|
-
|
26
|
-
<!--<div class="checkboxes_menu">-->
|
27
|
-
<!--<a onclick="CheckboxPool.uncheck_page('<%#= settings[:form_id] %>')" class="btn">Odznačit vše</a>-->
|
28
|
-
<!--<a onclick="CheckboxPool.check_page('<%#= settings[:form_id] %>')" class="btn">Označit vše</a>-->
|
29
|
-
<!--</div>-->
|
30
|
-
|
31
|
-
|
5
|
+
<th class="chbox filtering_th">
|
32
6
|
</th>
|
33
7
|
<% end %>
|
34
8
|
<% if !settings[:row].blank? && !settings[:row][:functions].blank? %>
|
35
|
-
<th></th>
|
9
|
+
<th class="filtering_th"></th>
|
36
10
|
<% end %>
|
37
11
|
<% order_by_arr = settings[:params][:order_by].downcase.split(",") unless settings[:params][:order_by].blank? %>
|
38
12
|
<% settings[:columns].each do |col| %>
|
39
|
-
|
40
|
-
<% order_desc_id = (col[:table].blank? || col[:name].blank?) ? "" : (col[:table] + "___" + col[:name] + "___desc") %>
|
41
|
-
<th class="<%= col[:class] %>">
|
42
|
-
<div class="th_label">
|
43
|
-
<strong>
|
44
|
-
<span><%= col[:label].html_safe %></span>
|
45
|
-
</strong>
|
46
|
-
</div>
|
47
|
-
|
13
|
+
<th class="filtering_th">
|
48
14
|
<% if settings[:display_method].blank? %>
|
49
|
-
<div class="sortable clearfix">
|
50
|
-
<% if col[:column_method].blank? && col[:row_method].blank? && !col[:name].blank? %>
|
51
|
-
<a href="#"
|
52
|
-
onclick="TableSorting.force_change_sorting('<%= settings[:form_id] %>','<%= col[:table] + "." +col[:name] %>', 'asc', this); return false;"
|
53
|
-
ondblclick="TableSorting.force_change_sorting('<%= settings[:form_id] %>','<%= col[:table] + "." +col[:name] %>', 'asc', this); return false;"
|
54
|
-
title="Seřadit od nejnižší hodnoty"
|
55
|
-
class="btn first sort_button <%= (order_by_arr.include?(col[:table] + "." + col[:name] + " asc")) ? "btn-success" : "" %>"
|
56
|
-
id="<%= order_asc_id %>">
|
57
|
-
<i class="icon-arrow-up"></i>
|
58
|
-
</a>
|
59
|
-
|
60
|
-
<a href="#"
|
61
|
-
onclick="TableSorting.force_change_sorting('<%= settings[:form_id] %>','<%= col[:table] + "." +col[:name] %>', 'desc', this); return false;"
|
62
|
-
ondblclick="TableSorting.force_change_sorting('<%= settings[:form_id] %>','<%= col[:table] + "." +col[:name] %>', 'desc', this); return false;"
|
63
|
-
title="Seřadit od nejvyšší hodnoty"
|
64
|
-
class="btn sort_button <%= (order_by_arr.include?(col[:table] + "." + col[:name] + " desc")) ? "btn-success" : "" %>"
|
65
|
-
id="<%= order_desc_id %>">
|
66
|
-
<i class="icon-arrow-down"></i>
|
67
|
-
</a>
|
68
|
-
<% end %>
|
69
|
-
</div>
|
70
|
-
|
71
|
-
|
72
|
-
|
73
15
|
<% case col[:filter] %>
|
74
16
|
<% when :find %>
|
75
|
-
<div class="inputs clearfix">
|
17
|
+
<div class="inputs clearfix small_padding">
|
76
18
|
<% saved_param = (!settings[:params].blank? && !settings[:params]['find'].blank? && !settings[:params]['find']["#{col[:table]}.#{col[:name]}"].blank?) ? settings[:params]['find']["#{col[:table]}.#{col[:name]}"] : "" %>
|
77
19
|
<%= text_field_tag "find[#{col[:table]}.#{col[:name]}]", saved_param,
|
78
20
|
{:class => "text first #{settings[:form_id] + '_column_find'}"} %>
|
79
21
|
</div>
|
80
22
|
<% when :find_exact %>
|
81
|
-
<div class="inputs clearfix">
|
23
|
+
<div class="inputs clearfix small_padding">
|
82
24
|
<% saved_param = (!settings[:params].blank? && !settings[:params]['find_exact'].blank? && !settings[:params]['find_exact']["#{col[:table]}.#{col[:name]}"].blank?) ? settings[:params]['find_exact']["#{col[:table]}.#{col[:name]}"] : "" %>
|
83
25
|
<%= text_field_tag "find_exact[#{col[:table]}.#{col[:name]}]", saved_param,
|
84
26
|
{:class => "text first #{settings[:form_id] + '_column_find_exact'}"} %>
|
@@ -130,6 +72,54 @@
|
|
130
72
|
<% end %>
|
131
73
|
</tr>
|
132
74
|
|
75
|
+
<tr class="sorting_tr">
|
76
|
+
<% if !settings[:checkboxes].blank? && settings[:checkboxes] %>
|
77
|
+
<th class="chbox">
|
78
|
+
<input type="checkbox" title="Označit/odznačit vše na stránce" onclick="CheckboxPool.check_or_uncheck_page(this, '<%= settings[:form_id] %>')" id=""/>
|
79
|
+
</th>
|
80
|
+
<% end %>
|
81
|
+
<% if !settings[:row].blank? && !settings[:row][:functions].blank? %>
|
82
|
+
<th></th>
|
83
|
+
<% end %>
|
84
|
+
<% order_by_arr = settings[:params][:order_by].downcase.split(",") unless settings[:params][:order_by].blank? %>
|
85
|
+
<% settings[:columns].each do |col| %>
|
86
|
+
<% order_id = (col[:table].blank? || col[:name].blank?) ? "" : (col[:table] + "___" + col[:name] + "") %>
|
87
|
+
<% order_asc_id = (col[:table].blank? || col[:name].blank?) ? "" : (col[:table] + "___" + col[:name] + "___asc") %>
|
88
|
+
<% order_desc_id = (col[:table].blank? || col[:name].blank?) ? "" : (col[:table] + "___" + col[:name] + "___desc") %>
|
89
|
+
|
90
|
+
<%
|
91
|
+
sorted_class = ""
|
92
|
+
if col[:column_method].blank? && col[:row_method].blank? && !col[:name].blank?
|
93
|
+
sorted_class += "sorting_th "
|
94
|
+
|
95
|
+
sorting_onclick = "TableSorting.force_toggled_change_sorting('#{settings[:form_id]}','#{col[:table] + "." +col[:name]}', this); return false;"
|
96
|
+
sorting_mouseover = "TableSorting.mouse_over_hover_sorting('#{settings[:form_id]}','#{col[:table] + "." +col[:name]}', this); return false;"
|
97
|
+
sorting_mouseout = "TableSorting.mouse_out_hover_sorting('#{settings[:form_id]}','#{col[:table] + "." +col[:name]}', this); return false;"
|
98
|
+
|
99
|
+
if (order_by_arr.include?(col[:table] + "." + col[:name] + " desc"))
|
100
|
+
sorted_class +="sorted sorted_desc"
|
101
|
+
elsif (order_by_arr.include?(col[:table] + "." + col[:name] + " asc"))
|
102
|
+
sorted_class +="sorted sorted_asc"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
%>
|
107
|
+
|
108
|
+
<th class="<%= order_asc_id %> <%= order_desc_id %> <%= col[:class] %> <%= sorted_class %>"
|
109
|
+
onmouseover="<%= sorting_mouseover %>"
|
110
|
+
onmouseout="<%= sorting_mouseout %>"
|
111
|
+
onclick="<%= sorting_onclick %>">
|
112
|
+
<div class="th_label">
|
113
|
+
<strong>
|
114
|
+
<span><%= col[:label].html_safe %></span>
|
115
|
+
</strong>
|
116
|
+
</div>
|
117
|
+
</th>
|
118
|
+
|
119
|
+
<% end %>
|
120
|
+
</tr>
|
121
|
+
|
122
|
+
|
133
123
|
</thead>
|
134
124
|
<tbody id="<%= settings[:form_id] %>_ajax_content">
|
135
125
|
<% unless settings[:template].blank? %>
|
@@ -183,7 +173,7 @@
|
|
183
173
|
//$('#filled_value_' + fid + '_' + rid).multiselect("open");
|
184
174
|
$(".ui-multiselect-menu").css("width", "240px");
|
185
175
|
$("button.ui-multiselect").css("width", "55px");
|
186
|
-
$("button.ui-multiselect").css("height", "
|
176
|
+
$("button.ui-multiselect").css("height", "22px");
|
187
177
|
|
188
178
|
$('.multiselect_class').bind("multiselectcheckall", function (event, ui) {
|
189
179
|
form_submit_watcher('<%=settings[:form_id] %>');
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: it-logica-application-backbone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.46
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-09-24 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: htmlentities
|
16
|
-
requirement: &
|
16
|
+
requirement: &72533030 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *72533030
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: shoulda
|
27
|
-
requirement: &
|
27
|
+
requirement: &72532630 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *72532630
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rdoc
|
38
|
-
requirement: &
|
38
|
+
requirement: &72532240 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '3.12'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *72532240
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
|
-
requirement: &
|
49
|
+
requirement: &72531840 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.1.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *72531840
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: jeweler
|
60
|
-
requirement: &
|
60
|
+
requirement: &72531470 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.8.4
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *72531470
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: simplecov
|
71
|
-
requirement: &
|
71
|
+
requirement: &72118340 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *72118340
|
80
80
|
description: longer description of your gem
|
81
81
|
email: ladislav.smola@it-logica.cz
|
82
82
|
executables: []
|
@@ -591,7 +591,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
591
591
|
version: '0'
|
592
592
|
segments:
|
593
593
|
- 0
|
594
|
-
hash:
|
594
|
+
hash: 93727633
|
595
595
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
596
596
|
none: false
|
597
597
|
requirements:
|