it-logica-application-backbone 1.1.8 → 1.2.0
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.
- data/VERSION +1 -1
- data/app/assets/javascripts/backbone_js/bootstrap_modal.js +234 -0
- data/app/assets/javascripts/backbone_js/ladas_breadcrumb.js.coffee +15 -2
- data/app/assets/javascripts/backbone_js/ladas_editable_table_aligner.js.coffee +243 -0
- data/app/assets/javascripts/backbone_js/ladas_editable_table_builder.js.coffee +341 -0
- data/app/assets/javascripts/backbone_js/ladas_editable_table_modal_dialog.js.coffee +93 -0
- data/app/assets/javascripts/backbone_js/ladas_functions.js +8 -0
- data/app/assets/javascripts/backbone_js/ladas_saving.js +6 -0
- data/app/assets/javascripts/backbone_js/ladas_table_builder.js.coffee +1 -1
- data/app/assets/stylesheets/backbone_css/bootstrap_modal.css +139 -0
- data/app/assets/stylesheets/backbone_css/design.css +1 -1
- data/app/assets/stylesheets/backbone_css/editable_tables.css.scss +108 -0
- data/app/views/helpers/editable_table/_build_ajax_callback_code.html.erb +3 -0
- data/app/views/helpers/editable_table/_build_table.html.erb +128 -0
- data/app/views/helpers/editable_table/_build_table_data.html.erb +14 -0
- data/app/views/helpers/editable_table/_build_table_filter.html.erb +70 -0
- data/app/views/helpers/editable_table/_build_table_header.html.erb +136 -0
- data/app/views/helpers/editable_table/_build_table_pager.html.erb +31 -0
- data/app/views/helpers/editable_table/_build_table_text_description.html.erb +66 -0
- data/app/views/helpers/editable_table/_build_table_wrapper.html.erb +106 -0
- data/it-logica-application-backbone.gemspec +16 -2
- data/lib/model_mixins/table_builder_class_methods.rb +49 -0
- data/lib/table_settings/table_action.rb +5 -0
- data/lib/table_settings/table_column.rb +11 -0
- data/lib/view_mixins/table.rb +5 -0
- metadata +29 -15
@@ -0,0 +1,136 @@
|
|
1
|
+
<div class="scrollTarget">
|
2
|
+
<table class="table table-bordered table-condensed table_special">
|
3
|
+
<thead>
|
4
|
+
<tr class="filtering_tr" data-row-count-number="row_with_filters">
|
5
|
+
<% if !settings[:checkboxes].blank? && settings[:checkboxes] %>
|
6
|
+
<th class="chbox filtering_th <%= "headcol" if !settings[:static_columns_left_side].blank? %>" data-width-align-id="special_checbox_filtering">
|
7
|
+
</th>
|
8
|
+
<% end %>
|
9
|
+
<% if !settings[:row].blank? && !settings[:row][:functions].blank? %>
|
10
|
+
<th class="filtering_th <%= "headcol" if !settings[:static_columns_left_side].blank? %>" data-width-align-id="special_functions"></th>
|
11
|
+
<% end %>
|
12
|
+
<% order_by_arr = settings[:params][:order_by].downcase.split(",") unless settings[:params][:order_by].blank? %>
|
13
|
+
<% settings[:columns].each do |col| %>
|
14
|
+
<% width_align_id = col[:table].blank? ? "" : col[:table]
|
15
|
+
width_align_id += col[:name].blank? ? "" : ("___" + col[:name])
|
16
|
+
%>
|
17
|
+
|
18
|
+
|
19
|
+
<th class="filtering_th <%= col[:class] unless col[:class].blank? %> <%= col[:header_class] unless col[:header_class].blank? %>
|
20
|
+
<%= "headcol" if !settings[:static_columns_left_side].blank? && settings[:static_columns_left_side].include?(col[:name]) %>"
|
21
|
+
data-width-align-id="<%= width_align_id %>">
|
22
|
+
<% if settings[:display_method].blank? %>
|
23
|
+
<% case col[:filter] %>
|
24
|
+
<% when :find %>
|
25
|
+
<div class="inputs clearfix small_padding">
|
26
|
+
<% saved_param = (!settings[:params].blank? && !settings[:params]['find'].blank? && !settings[:params]['find']["#{col[:table]}.#{col[:name]}"].blank?) ? settings[:params]['find']["#{col[:table]}.#{col[:name]}"] : "" %>
|
27
|
+
<%= text_field_tag "find[#{col[:table]}.#{col[:name]}]", saved_param,
|
28
|
+
{:class => "text first #{settings[:form_id] + '_column_find'}"} %>
|
29
|
+
</div>
|
30
|
+
<% when :find_exact %>
|
31
|
+
<div class="inputs clearfix small_padding">
|
32
|
+
<% 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]}"] : "" %>
|
33
|
+
<%= text_field_tag "find_exact[#{col[:table]}.#{col[:name]}]", saved_param,
|
34
|
+
{:class => "text first #{settings[:form_id] + '_column_find'}"} %>
|
35
|
+
</div>
|
36
|
+
<% when :multichoice %>
|
37
|
+
<div class="inputs clearfix">
|
38
|
+
<% saved_param = (!settings[:params].blank? && !settings[:params]['multichoice'].blank? && !settings[:params]['multichoice']["#{col[:table]}.#{col[:name]}"].blank?) ? settings[:params]['multichoice']["#{col[:table]}.#{col[:name]}"] : [] %>
|
39
|
+
<%= select_tag("multichoice[#{col[:table]}.#{col[:name]}]", options_for_select(col[:filter_data], saved_param),
|
40
|
+
:onchange => "form_submit_watcher('#{settings[:form_id]}')",
|
41
|
+
:multiple => true,
|
42
|
+
:class => "multiselect_class") %>
|
43
|
+
</div>
|
44
|
+
<% when :number %>
|
45
|
+
<div class="inputs range clearfix small_padding">
|
46
|
+
<% saved_param = (!settings[:params].blank? && !settings[:params]['date_from'].blank? && !settings[:params]['date_from']["#{col[:table]}.#{col[:name]}"].blank?) ? settings[:params]['date_from']["#{col[:table]}.#{col[:name]}"] : "" %>
|
47
|
+
|
48
|
+
<%= text_field_tag "number_from[#{col[:table]}.#{col[:name]}]", saved_param, {:class => "text first #{settings[:form_id] + '_column_find'}",
|
49
|
+
:onchange => "form_submit_watcher('#{settings[:form_id]}')",
|
50
|
+
:placeholder => "min.",
|
51
|
+
:title => "Hodnota musí být vetší nebo rovna zadané hodnotě"} %>
|
52
|
+
<% saved_param = (!settings[:params].blank? && !settings[:params]['date_to'].blank? && !settings[:params]['date_to']["#{col[:table]}.#{col[:name]}"].blank?) ? settings[:params]['date_to']["#{col[:table]}.#{col[:name]}"] : "" %>
|
53
|
+
<%#= label_tag "date_to[#{col[:table]}.#{col[:name]}]", "Do", :class => "datetime_class_label" %>
|
54
|
+
<%= text_field_tag "number_to[#{col[:table]}.#{col[:name]}]", saved_param, {:class => "text #{settings[:form_id] + '_column_find'}",
|
55
|
+
:onchange => "form_submit_watcher('#{settings[:form_id]}')",
|
56
|
+
:placeholder => "max.",
|
57
|
+
:title => "Hodnota musí být menší nebo rovna zadané hodnotě"} %>
|
58
|
+
</div>
|
59
|
+
<% when :date %>
|
60
|
+
<div class="inputs range clearfix small_padding">
|
61
|
+
<% saved_param = (!settings[:params].blank? && !settings[:params]['date_from'].blank? && !settings[:params]['date_from']["#{col[:table]}.#{col[:name]}"].blank?) ? settings[:params]['date_from']["#{col[:table]}.#{col[:name]}"] : "" %>
|
62
|
+
<%#= label_tag "date_from[#{col[:table]}.#{col[:name]}]", "Od", :class => "datetime_class_label" %>
|
63
|
+
<%= text_field_tag "date_from[#{col[:table]}.#{col[:name]}]", saved_param, {:class => "text datetime_class first",
|
64
|
+
:onchange => "form_submit_watcher('#{settings[:form_id]}')",
|
65
|
+
:placeholder => "od",
|
66
|
+
:title => "Datum od"} %>
|
67
|
+
<% saved_param = (!settings[:params].blank? && !settings[:params]['date_to'].blank? && !settings[:params]['date_to']["#{col[:table]}.#{col[:name]}"].blank?) ? settings[:params]['date_to']["#{col[:table]}.#{col[:name]}"] : "" %>
|
68
|
+
<%#= label_tag "date_to[#{col[:table]}.#{col[:name]}]", "Do", :class => "datetime_class_label" %>
|
69
|
+
<%= text_field_tag "date_to[#{col[:table]}.#{col[:name]}]", saved_param, {:class => "text datetime_class",
|
70
|
+
:onchange => "form_submit_watcher('#{settings[:form_id]}')",
|
71
|
+
:placeholder => "do",
|
72
|
+
:title => "Datum do"} %>
|
73
|
+
</div>
|
74
|
+
<% else %>
|
75
|
+
<% end %>
|
76
|
+
|
77
|
+
<% end %>
|
78
|
+
</th>
|
79
|
+
|
80
|
+
<% end %>
|
81
|
+
</tr>
|
82
|
+
|
83
|
+
<tr class="sorting_tr" data-row-count-number="row_with_sorting">
|
84
|
+
<% if !settings[:checkboxes].blank? && settings[:checkboxes] %>
|
85
|
+
<th class="chbox <%= "headcol" if !settings[:static_columns_left_side].blank? %>">
|
86
|
+
<input type="checkbox" title="Označit/odznačit vše na stránce" onclick="CheckboxPool.check_or_uncheck_page(this, '<%= settings[:form_id] %>')" id=""/>
|
87
|
+
</th>
|
88
|
+
<% end %>
|
89
|
+
<% if !settings[:row].blank? && !settings[:row][:functions].blank? %>
|
90
|
+
<th class="<%= "headcol" if !settings[:static_columns_left_side].blank? %>"></th>
|
91
|
+
<% end %>
|
92
|
+
<% order_by_arr = settings[:params][:order_by].downcase.split(",") unless settings[:params][:order_by].blank? %>
|
93
|
+
<% settings[:columns].each do |col| %>
|
94
|
+
<% order_id = (col[:table].blank? || col[:name].blank?) ? "" : (col[:table] + "___" + col[:name] + "") %>
|
95
|
+
<% order_asc_id = (col[:table].blank? || col[:name].blank?) ? "" : (col[:table] + "___" + col[:name] + "___asc") %>
|
96
|
+
<% order_desc_id = (col[:table].blank? || col[:name].blank?) ? "" : (col[:table] + "___" + col[:name] + "___desc") %>
|
97
|
+
|
98
|
+
<%
|
99
|
+
sorted_class = ""
|
100
|
+
if col[:column_method].blank? && col[:row_method].blank? && !col[:name].blank?
|
101
|
+
sorted_class += "sorting_th "
|
102
|
+
|
103
|
+
sorting_onclick = "TableSorting.force_toggled_change_sorting('#{settings[:form_id]}','#{col[:table] + "." +col[:name]}', this); return false;"
|
104
|
+
sorting_mouseover = "TableSorting.mouse_over_hover_sorting('#{settings[:form_id]}','#{col[:table] + "." +col[:name]}', this); return false;"
|
105
|
+
sorting_mouseout = "TableSorting.mouse_out_hover_sorting('#{settings[:form_id]}','#{col[:table] + "." +col[:name]}', this); return false;"
|
106
|
+
|
107
|
+
if (order_by_arr.include?(col[:table] + "." + col[:name] + " desc"))
|
108
|
+
sorted_class +="sorted sorted_desc"
|
109
|
+
elsif (order_by_arr.include?(col[:table] + "." + col[:name] + " asc"))
|
110
|
+
sorted_class +="sorted sorted_asc"
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
%>
|
115
|
+
|
116
|
+
<th class="<%= order_asc_id %> <%= order_desc_id %> <%= col[:class] unless col[:class].blank? %> <%= sorted_class %> <%= col[:header_class] unless col[:header_class].blank? %>
|
117
|
+
<%= "headcol" if !settings[:static_columns_left_side].blank? && settings[:static_columns_left_side].include?(col[:name]) %>"
|
118
|
+
onmouseover="<%= sorting_mouseover %>"
|
119
|
+
onmouseout="<%= sorting_mouseout %>"
|
120
|
+
onclick="<%= sorting_onclick %>"
|
121
|
+
title="<%= col[:title].html_safe unless col[:title].blank? %>"
|
122
|
+
>
|
123
|
+
<div class="th_label">
|
124
|
+
<strong>
|
125
|
+
<span><%= col[:label].html_safe %></span>
|
126
|
+
</strong>
|
127
|
+
</div>
|
128
|
+
</th>
|
129
|
+
|
130
|
+
<% end %>
|
131
|
+
</tr>
|
132
|
+
|
133
|
+
|
134
|
+
</thead>
|
135
|
+
</table>
|
136
|
+
</div>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<div class="filter-paging clearfix <%= placement if defined? placement %>">
|
2
|
+
<div class="reset">
|
3
|
+
<%= ajax_post_link_to "Smazat filtr", settings[:filter_path],
|
4
|
+
"data-content_id" => settings[:content_id].blank? ? "" : settings[:content_id],
|
5
|
+
:class => "btn",
|
6
|
+
"data-post" => {:clear => true}.to_json %>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<% if settings[:data_paginate].total_pages > 1 %>
|
10
|
+
<div id="<%= settings[:form_id] %>_pagination" class="paging <%= settings[:form_id] %>_pager">
|
11
|
+
<div class="goToPage">
|
12
|
+
<input type="text" class="own_page" value="<%= settings[:params].blank? ? 1 : settings[:params]["page"] %>"
|
13
|
+
placeholder="Strana"
|
14
|
+
onkeypress="paginate_by_enter('<%= settings[:form_id] %>', this, event);">
|
15
|
+
<button class="btn" onclick='$("#" + "<%= settings[:form_id] %>" + "_page").val($(this).prev("input").val()); $("#" + "<%= settings[:form_id] %>").submit(); return false;'>Přejít</button>
|
16
|
+
</div>
|
17
|
+
<div class="pages">
|
18
|
+
<%= will_paginate settings[:data_paginate], {:container => false, :inner_window => 1, :outer_window => 1} %>
|
19
|
+
<%= page_entries_info settings[:data_paginate] %>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<% else %>
|
24
|
+
<div id="<%= settings[:form_id] %>_pagination" class="paging <%= settings[:form_id] %>_pager">
|
25
|
+
<div class="pages">
|
26
|
+
<%= page_entries_info settings[:data_paginate] %>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
<% end %>
|
30
|
+
</div>
|
31
|
+
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<%
|
2
|
+
#load_text
|
3
|
+
text = settings[:description] unless settings[:description].blank?
|
4
|
+
text_obj = nil
|
5
|
+
edit_right = false
|
6
|
+
edit_description_path = {}
|
7
|
+
|
8
|
+
if text.blank? &&
|
9
|
+
defined?(ModelMixins::TableBuilderClassMethods::DESCRIPTION_CLASS) &&
|
10
|
+
defined?(ModelMixins::TableBuilderClassMethods::DESCRIPTION_METHOD) &&
|
11
|
+
defined?(ModelMixins::TableBuilderClassMethods::DESCRIPTION_IDENTIFIER)
|
12
|
+
desc_class = ModelMixins::TableBuilderClassMethods::DESCRIPTION_CLASS
|
13
|
+
desc_method = ModelMixins::TableBuilderClassMethods::DESCRIPTION_METHOD
|
14
|
+
desc_id = ModelMixins::TableBuilderClassMethods::DESCRIPTION_IDENTIFIER
|
15
|
+
text_obj = desc_class.where(desc_id => settings[:form_id]).first
|
16
|
+
|
17
|
+
text = text_obj.send(desc_method) unless text_obj.blank?
|
18
|
+
|
19
|
+
|
20
|
+
# find out if there is edit right for current request
|
21
|
+
|
22
|
+
edit_right = true if settings[:can_edit_description]
|
23
|
+
|
24
|
+
if defined?(ModelMixins::TableBuilderClassMethods.can_edit_description)
|
25
|
+
ModelMixins::TableBuilderClassMethods.can_edit_description &&
|
26
|
+
edit_right = true
|
27
|
+
end
|
28
|
+
|
29
|
+
# load edit description path
|
30
|
+
|
31
|
+
edit_description_path = settings[:edit_description_path].blank? if settings[:edit_description_path].blank?
|
32
|
+
|
33
|
+
if defined?(ModelMixins::TableBuilderClassMethods::EDIT_DESCRIPTION_PATH)
|
34
|
+
edit_description_path = ModelMixins::TableBuilderClassMethods::EDIT_DESCRIPTION_PATH.dup
|
35
|
+
end
|
36
|
+
|
37
|
+
# adding id fot edit path
|
38
|
+
unless edit_description_path.blank?
|
39
|
+
unless text_obj.blank?
|
40
|
+
edit_description_path[:symlink_id] = text_obj.send(desc_class.primary_key)
|
41
|
+
edit_description_path[:symlink_action] = :edit
|
42
|
+
else
|
43
|
+
edit_description_path[:symlink_action] = :new
|
44
|
+
edit_description_path[:symlink_params] = "?form_id="+settings[:form_id]
|
45
|
+
edit_description_path[:no_tracking] = true
|
46
|
+
end
|
47
|
+
edit_description_path[:symlink_remote] = true
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
%>
|
52
|
+
|
53
|
+
<% if settings[:display_method].blank? %>
|
54
|
+
<% if !edit_description_path.blank? && !edit_right.blank? && edit_right %>
|
55
|
+
<div class="table_text_description_edit_button">
|
56
|
+
<a href="#" onclick="load_page(<%= edit_description_path.to_json %>); return false;" class="btn primary">Editovat
|
57
|
+
popisek</a>
|
58
|
+
</div>
|
59
|
+
<% end %>
|
60
|
+
<% end %>
|
61
|
+
|
62
|
+
<% unless text.blank? %>
|
63
|
+
<div class="table_text_description">
|
64
|
+
<%= text.html_safe %>
|
65
|
+
</div>
|
66
|
+
<% end %>
|
@@ -0,0 +1,106 @@
|
|
1
|
+
<div class="tableContainer" id="table_container_id">
|
2
|
+
|
3
|
+
<% unless settings[:static_columns_left_side].blank? %>
|
4
|
+
<div class="fixedLeftColumn" style="float:left">
|
5
|
+
<div class="scrollTargetContainter">
|
6
|
+
<table class="table table-bordered table-condensed table_special table_head">
|
7
|
+
<thead>
|
8
|
+
</thead>
|
9
|
+
</table>
|
10
|
+
</div>
|
11
|
+
<div class="detachedTableContainer">
|
12
|
+
<div class="detachedTable">
|
13
|
+
<table class="table table-bordered table-condensed table_special table_body">
|
14
|
+
<tbody>
|
15
|
+
</tbody>
|
16
|
+
<tfoot>
|
17
|
+
<!--<tr>-->
|
18
|
+
<!--<th colspan="100" class="<%#= settings[:form_id] + '_ajax_pager' %>">-->
|
19
|
+
<!--<%#= render :partial => 'helpers/build_table_pager', :locals => {:settings => settings} %>-->
|
20
|
+
<!--</th>-->
|
21
|
+
<!--</tr>-->
|
22
|
+
</tfoot>
|
23
|
+
</table>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
<% end %>
|
28
|
+
<div class="centerContainer" style="float:left">
|
29
|
+
<div class="scrollTargetContainter">
|
30
|
+
<%= render :partial => "/helpers/editable_table/build_table_header", :locals => {:settings => settings, :static_columns_left_side => nil} %>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<div class="detachedTableContainer">
|
34
|
+
<div class="detachedTable">
|
35
|
+
<table class="table table-bordered table-condensed table_special">
|
36
|
+
<tbody id="<%= settings[:form_id] %>_ajax_content">
|
37
|
+
<% unless settings[:template].blank? %>
|
38
|
+
<%= render :partial => settings[:template], :locals => {:settings => settings} %>
|
39
|
+
<% end %>
|
40
|
+
</tbody>
|
41
|
+
<tfoot>
|
42
|
+
<!--<tr>-->
|
43
|
+
<!--<th colspan="100" class="<%#= settings[:form_id] + '_ajax_pager' %>">-->
|
44
|
+
<!--<%#= render :partial => 'helpers/build_table_pager', :locals => {:settings => settings} %>-->
|
45
|
+
<!--</th>-->
|
46
|
+
<!--</tr>-->
|
47
|
+
</tfoot>
|
48
|
+
</table>
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
<div style="clear:both"></div>
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
56
|
+
<script type="text/javascript">
|
57
|
+
$('.<%= settings[:form_id] + "_column_find" %>').livesearch({
|
58
|
+
searchCallback:function (searchTerm) {
|
59
|
+
FilterChangeMarker.mark_active_filters('<%= settings[:form_id] %>');
|
60
|
+
$('#<%= settings[:form_id] %>').submit();
|
61
|
+
},
|
62
|
+
queryDelay:1000,
|
63
|
+
innerText:"",
|
64
|
+
minimumSearchLength:1
|
65
|
+
});
|
66
|
+
</script>
|
67
|
+
|
68
|
+
|
69
|
+
<script type="text/javascript">
|
70
|
+
$.datepicker.setDefaults($.datepicker.regional[ "cs" ]);
|
71
|
+
$('.datetime_class').datetimepicker({
|
72
|
+
dateFormat:"yy-mm-dd",
|
73
|
+
timeFormat:'hh:mm',
|
74
|
+
separator:' ',
|
75
|
+
changeYear:true,
|
76
|
+
yearRange:'<%= Date.today.year - 100 %>:<%= Date.today.year + 30 %>',
|
77
|
+
changeMonth:true
|
78
|
+
});
|
79
|
+
</script>
|
80
|
+
|
81
|
+
|
82
|
+
<script type="text/javascript">
|
83
|
+
$('.multiselect_class').multiselect({
|
84
|
+
selectedText:'<span class="active_multiselect">***</span>',
|
85
|
+
noneSelectedText:"",
|
86
|
+
checkAllText:"Označit vše",
|
87
|
+
uncheckAllText:"Zrušit vše",
|
88
|
+
minWidth:100
|
89
|
+
},function () {
|
90
|
+
form_submit_watcher('<%=settings[:form_id] %>');
|
91
|
+
}).multiselectfilter();
|
92
|
+
//$('#filled_value_' + fid + '_' + rid).multiselect("open");
|
93
|
+
$(".ui-multiselect-menu").css("width", "240px");
|
94
|
+
// $("button.ui-multiselect").css("width", "55px");
|
95
|
+
$("button.ui-multiselect").css("width", "100%");
|
96
|
+
$("button.ui-multiselect").css("min-width", "22px");
|
97
|
+
$("button.ui-multiselect").css("max-width", "55px");
|
98
|
+
$("button.ui-multiselect").css("height", "22px");
|
99
|
+
|
100
|
+
$('.multiselect_class').bind("multiselectcheckall", function (event, ui) {
|
101
|
+
form_submit_watcher('<%=settings[:form_id] %>');
|
102
|
+
});
|
103
|
+
$('.multiselect_class').bind("multiselectuncheckall", function (event, ui) {
|
104
|
+
form_submit_watcher('<%=settings[:form_id] %>');
|
105
|
+
});
|
106
|
+
</script>
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "it-logica-application-backbone"
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ladas"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-11-05"
|
13
13
|
s.description = "longer description of your gem"
|
14
14
|
s.email = "ladislav.smola@it-logica.cz"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -134,6 +134,7 @@ Gem::Specification.new do |s|
|
|
134
134
|
"app/assets/images/backbone_images/temp-userphoto-large.jpg",
|
135
135
|
"app/assets/images/backbone_images/temp-userphoto.jpg",
|
136
136
|
"app/assets/images/backbone_images/vrchovina-logo.png",
|
137
|
+
"app/assets/javascripts/backbone_js/bootstrap_modal.js",
|
137
138
|
"app/assets/javascripts/backbone_js/index.js",
|
138
139
|
"app/assets/javascripts/backbone_js/jquery-ui-timepicker-addon.js",
|
139
140
|
"app/assets/javascripts/backbone_js/jquery-ui-timepicker-cs.js",
|
@@ -150,6 +151,9 @@ Gem::Specification.new do |s|
|
|
150
151
|
"app/assets/javascripts/backbone_js/jquery.ui.widget.js",
|
151
152
|
"app/assets/javascripts/backbone_js/ladas_alert.js.coffee",
|
152
153
|
"app/assets/javascripts/backbone_js/ladas_breadcrumb.js.coffee",
|
154
|
+
"app/assets/javascripts/backbone_js/ladas_editable_table_aligner.js.coffee",
|
155
|
+
"app/assets/javascripts/backbone_js/ladas_editable_table_builder.js.coffee",
|
156
|
+
"app/assets/javascripts/backbone_js/ladas_editable_table_modal_dialog.js.coffee",
|
153
157
|
"app/assets/javascripts/backbone_js/ladas_form_submitter.js",
|
154
158
|
"app/assets/javascripts/backbone_js/ladas_functions.js",
|
155
159
|
"app/assets/javascripts/backbone_js/ladas_initialize_history.js",
|
@@ -462,7 +466,9 @@ Gem::Specification.new do |s|
|
|
462
466
|
"app/assets/javascripts/backbone_js/tinymce/jscripts/tiny_mce/utils/validate.js",
|
463
467
|
"app/assets/javascripts/backbone_js/tmpl.min.js",
|
464
468
|
"app/assets/stylesheets/backbone_css/bootstrap_and_overrides.css.scss",
|
469
|
+
"app/assets/stylesheets/backbone_css/bootstrap_modal.css",
|
465
470
|
"app/assets/stylesheets/backbone_css/design.css",
|
471
|
+
"app/assets/stylesheets/backbone_css/editable_tables.css.scss",
|
466
472
|
"app/assets/stylesheets/backbone_css/index.css.scss",
|
467
473
|
"app/assets/stylesheets/backbone_css/jquery.fileupload-ui.css",
|
468
474
|
"app/assets/stylesheets/backbone_css/jquery_datetime_picker.css.scss",
|
@@ -490,6 +496,14 @@ Gem::Specification.new do |s|
|
|
490
496
|
"app/views/helpers/_build_table_pager.html.erb",
|
491
497
|
"app/views/helpers/_build_table_text_description.html.erb",
|
492
498
|
"app/views/helpers/_build_table_wrapper.html.erb",
|
499
|
+
"app/views/helpers/editable_table/_build_ajax_callback_code.html.erb",
|
500
|
+
"app/views/helpers/editable_table/_build_table.html.erb",
|
501
|
+
"app/views/helpers/editable_table/_build_table_data.html.erb",
|
502
|
+
"app/views/helpers/editable_table/_build_table_filter.html.erb",
|
503
|
+
"app/views/helpers/editable_table/_build_table_header.html.erb",
|
504
|
+
"app/views/helpers/editable_table/_build_table_pager.html.erb",
|
505
|
+
"app/views/helpers/editable_table/_build_table_text_description.html.erb",
|
506
|
+
"app/views/helpers/editable_table/_build_table_wrapper.html.erb",
|
493
507
|
"it-logica-application-backbone.gemspec",
|
494
508
|
"lib/backbone_css/engine.rb",
|
495
509
|
"lib/backbone_images/engine.rb",
|
@@ -105,6 +105,9 @@ module ModelMixins
|
|
105
105
|
template_items = object.where("#{settings[:row][:id]}" => all_items_row_ids)
|
106
106
|
end
|
107
107
|
|
108
|
+
# loading colors for editable table
|
109
|
+
editable_table_load_colors(settings, object, all_items_row_ids)
|
110
|
+
|
108
111
|
template_items = template_items.includes(settings[:includes])
|
109
112
|
|
110
113
|
#template_items.all
|
@@ -561,5 +564,51 @@ module ModelMixins
|
|
561
564
|
end
|
562
565
|
params[:real_order_by] = order_by_arr*","
|
563
566
|
end
|
567
|
+
|
568
|
+
|
569
|
+
def editable_table_load_colors(settings, object, all_items_row_ids)
|
570
|
+
if object.respond_to?(:klass)
|
571
|
+
object_class = object.klass
|
572
|
+
else
|
573
|
+
object_class = object
|
574
|
+
end
|
575
|
+
|
576
|
+
# if model has cell colors
|
577
|
+
if (object_class.new.respond_to?(:editable_table_cell_colors))
|
578
|
+
if defined? EditableTableCellColor
|
579
|
+
cell_colors = EditableTableCellColor.where(:owner_type => object_class.to_s, :owner_id => all_items_row_ids).all
|
580
|
+
cell_colors_for_settings = {}
|
581
|
+
cell_colors.each do |c|
|
582
|
+
cell_colors_for_settings[c.owner_id] ||= {}
|
583
|
+
cell_colors_for_settings[c.owner_id][c.cell_name] ||= {}
|
584
|
+
cell_colors_for_settings[c.owner_id][c.cell_name]["color"] = c.color
|
585
|
+
cell_colors_for_settings[c.owner_id][c.cell_name]["background_color"] = c.background_color
|
586
|
+
end
|
587
|
+
unless cell_colors_for_settings.blank?
|
588
|
+
settings.merge!({:cell_colors => cell_colors_for_settings})
|
589
|
+
end
|
590
|
+
end
|
591
|
+
end
|
592
|
+
|
593
|
+
# if model has row colors
|
594
|
+
if (object_class.new.respond_to?(:editable_table_row_colors))
|
595
|
+
if defined? EditableTableRowColor
|
596
|
+
row_colors = EditableTableRowColor.where(:owner_type => object_class.to_s, :owner_id => all_items_row_ids)
|
597
|
+
row_colors_for_settings = {}
|
598
|
+
row_colors.each do |c|
|
599
|
+
row_colors_for_settings[c.owner_id] ||= {}
|
600
|
+
row_colors_for_settings[c.owner_id]["color"] = c.color
|
601
|
+
row_colors_for_settings[c.owner_id]["background_color"] = c.background_color
|
602
|
+
end
|
603
|
+
unless row_colors_for_settings.blank?
|
604
|
+
settings.merge!({:row_colors => row_colors_for_settings})
|
605
|
+
end
|
606
|
+
end
|
607
|
+
end
|
608
|
+
end
|
609
|
+
|
610
|
+
|
564
611
|
end
|
565
612
|
end
|
613
|
+
|
614
|
+
|