Merge branch 'feature/widgets' of https://dev.finn.de/git/reporting-engine into feature/widgets

pull/6827/head
jwollert 14 years ago
commit 24734e0be7
  1. 2
      assets/javascripts/reporting/filters.js
  2. 4
      assets/javascripts/reporting/restore_query.js
  3. 2
      lib/widget/controls/query_name.rb
  4. 4
      lib/widget/filters.rb
  5. 3
      lib/widget/filters/remove_button.rb
  6. 1
      lib/widget/filters/text_box.rb

@ -134,7 +134,7 @@ Reporting.Filters = {
return $("filter_table").childElements().first().select('tr').select(function (tr) {
return tr.visible() === true;
}).collect(function (filter) {
return filter.className;
return filter.getAttribute("data-filter-name");
});
},

@ -66,7 +66,9 @@ Reporting.RestoreQuery = {
// FIXME: rm_xxx values for filters have to be set after re-displaying them
$$("tr[data-selected=true]").each(function (e) {
var rm_box = e.select("input[id^=rm]").first();
rm_box.value = rm_box.getAttribute("data-filter-name");
var filter_name = e.getAttribute("data-filter-name");
rm_box.value = filter_name;
Reporting.Filters.select_option_enabled($("add_filter_select"), filter_name, false);
});
}
};

@ -2,7 +2,7 @@ class Widget::Controls::QueryName < Widget::Base
def render
options = { :id => "query_saved_name", "data-translations" => translations }
if @query.new_record?
name = l(:label_save_this_query)
name = l(:label_new_report)
icon = ""
else
name = @query.name

@ -34,7 +34,9 @@ class Widget::Filters < Widget::Base
def render_filters
active_filters = @query.filters.select { |f| f.class.display? }
engine::Filter.all.collect do |filter|
opts = {:id => "tr_#{filter.underscore_name}", :class => "#{filter.underscore_name} filter"}
opts = {:id => "tr_#{filter.underscore_name}",
:class => "#{filter.underscore_name} filter",
:"data-filter-name" => filter.underscore_name }
active_instance = active_filters.detect { |f| f.class == filter }
if active_instance
opts[:"data-selected"] = true

@ -3,8 +3,7 @@ class Widget::Filters::RemoveButton < Widget::Filters::Base
content_tag :td, :width => "25px" do
tag :input, :id => "rm_#{filter_class.underscore_name}",
:name => "fields[]", :type => "button", :value => "",
:class => "icon filter_rem icon-filter-rem",
:"data-filter-name" => filter_class.underscore_name
:class => "icon filter_rem icon-filter-rem"
end
end
end

@ -3,6 +3,7 @@ class Widget::Filters::TextBox < Widget::Filters::Base
content_tag :td do
content_tag :div, :id => "#{filter_class.underscore_name}_arg_1", :class => "filter_values" do
text_field_tag("values[#{filter_class.underscore_name}]", "",
:size => "6",
:class => "select-small",
:id => "#{filter_class.underscore_name}_arg_1_val",
:'data-filter-name' => filter_class.underscore_name)

Loading…
Cancel
Save