diff --git a/generators/wice_grid_assets/templates/initializers/wice_grid_config.rb b/generators/wice_grid_assets/templates/initializers/wice_grid_config.rb index 82d46a59..c4600e52 100644 --- a/generators/wice_grid_assets/templates/initializers/wice_grid_config.rb +++ b/generators/wice_grid_assets/templates/initializers/wice_grid_config.rb @@ -5,9 +5,8 @@ # +true+ will allow to embed erb content in column (cell) definitions. Wice::Defaults::ERB_MODE = false - # Default number of rows to show per page. - Wice::Defaults::PER_PAGE = 10 + Wice::Defaults::PER_PAGE = 20 # Default order direction Wice::Defaults::ORDER_DIRECTION = 'asc' @@ -23,9 +22,6 @@ Wice::Defaults::SHOW_HIDE_FILTER_ICON = 'icons/grid/page_white_find.png' - Wice::Defaults::SHOW_FILTER_TOOLTIP = 'Show filter' - Wice::Defaults::HIDE_FILTER_TOOLTIP = 'Hide filter' - Wice::Defaults::CSV_EXPORT_TOOLTIP = 'Export to CSV' # Icon to trigger filtering. Wice::Defaults::FILTER_ICON = 'icons/grid/table_refresh.png' @@ -40,14 +36,10 @@ Wice::Defaults::CSV_EXPORT_ICON = "/images/icons/grid/page_white_excel.png" - Wice::Defaults::FILTER_TOOLTIP = "Filter" - Wice::Defaults::RESET_FILTER_TOOLTIP = "Reset" # The label of the first option of a custom dropdown list meaning 'All items' Wice::Defaults::CUSTOM_FILTER_ALL_LABEL = '--' - Wice::Defaults::BOOLEAN_FILTER_TRUE_LABEL = 'yes' - Wice::Defaults::BOOLEAN_FILTER_FALSE_LABEL = 'no' # Allow switching between a single and multiple selection modes in custom filters (dropdown boxes) Wice::Defaults::ALLOW_MULTIPLE_SELECTION = true @@ -63,7 +55,7 @@ # * :when_filtered - when the table is the result of filtering # * :always - show the filter always # * :no - never show the filter - Wice::Defaults::SHOW_FILTER = :when_filtered + Wice::Defaults::SHOW_FILTER = :always # SQL operator used for matching strings in string filters. Wice::Defaults::STRING_MATCHING_OPERATOR = 'LIKE' @@ -78,20 +70,14 @@ 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter' => 'ILIKE' } - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - # will_paginate # - Wice::Defaults::PREVIOUS_LABEL = '« Previous' - Wice::Defaults::NEXT_LABEL = 'Next »' # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Advanced Filters # # Switch of the negation checkbox in all text filters - Wice::Defaults::NEGATION_IN_STRING_FILTERS = true + Wice::Defaults::NEGATION_IN_STRING_FILTERS = false - # The title of the checkox to turn on negation - Wice::Defaults::NEGATION_CHECKBOX_TITLE = 'Exclude' # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @@ -103,20 +89,6 @@ # If number of all queries is more than this value, the user will be given a warning message Wice::Defaults::START_SHOWING_WARNING_FROM = 100 - # link to switch to "ahow all records" - Wice::Defaults::SHOW_ALL_RECORDS_LABEL = 'show all' - - # tooltip for the link to switch to "ahow all records" - Wice::Defaults::SHOW_ALL_RECORDS_TOOLTIP = 'Show all records' - - # Warning message shown when the user wants to switch to all-records mode - Wice::Defaults::ALL_QUERIES_WARNING = 'Are you sure you want to display all records?' - - # link to paginated view - Wice::Defaults::SWITCH_BACK_TO_PAGINATED_MODE_LABEL = "back to paginated view" - - # tooltip for the link to paginated view - Wice::Defaults::SWITCH_BACK_TO_PAGINATED_MODE_TOOLTIP = "Switch back to the view with pages" # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Saving Queries # @@ -128,18 +100,6 @@ # QUERY_STORE_MODEL = 'WiceGridSerializedQuery' Wice::Defaults::QUERY_STORE_MODEL = 'SavedQuery' - Wice::Defaults::SAVED_QUERY_PANEL_TITLE = 'Saved Queries' - Wice::Defaults::SAVE_QUERY_BUTTON_LABEL = 'Save the state of filters' - - Wice::Defaults::SAVED_QUERY_DELETION_CONFIRMATION = 'Are you sure?' - Wice::Defaults::SAVED_QUERY_DELETION_LINK_TITLE = 'Delete query' - Wice::Defaults::SAVED_QUERY_LINK_TITLE = 'Load query' - - Wice::Defaults::VALIDATES_UNIQUENESS_ERROR = "A query with this name already exists" - Wice::Defaults::VALIDATES_PRESENCE_ERROR = "Please sumbit the name of the custom query" - - Wice::Defaults::QUERY_DELETED_MESSAGE = "Saved query deleted." - Wice::Defaults::QUERY_SAVED_MESSAGE = "Query saved." # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Here go settings related to the calendar helpers # @@ -172,11 +132,64 @@ # Icon to popup the calendar. Wice::Defaults::CALENDAR_ICON = "/images/icons/grid/calendar_view_month.png" + + + ######## Messages ######## + + Wice::Defaults::SHOW_FILTER_TOOLTIP = 'Show filter' + Wice::Defaults::HIDE_FILTER_TOOLTIP = 'Hide filter' + Wice::Defaults::CSV_EXPORT_TOOLTIP = 'Export to CSV' + + Wice::Defaults::FILTER_TOOLTIP = "Filter" + Wice::Defaults::RESET_FILTER_TOOLTIP = "Reset" + + Wice::Defaults::BOOLEAN_FILTER_TRUE_LABEL = 'yes' + Wice::Defaults::BOOLEAN_FILTER_FALSE_LABEL = 'no' + + Wice::Defaults::PREVIOUS_LABEL = '« Previous' + Wice::Defaults::NEXT_LABEL = 'Next »' + # Title of the icon clicking on which will show the calendar to set the FROM date. Wice::Defaults::DATE_SELECTOR_TOOLTIP_FROM = 'From' # Title of the icon clicking on which will show the calendar to set the TO date. Wice::Defaults::DATE_SELECTOR_TOOLTIP_TO = 'To' + # The title of the checkox to turn on negation + Wice::Defaults::NEGATION_CHECKBOX_TITLE = 'Exclude' + + # link to switch to "show all records" + Wice::Defaults::SHOW_ALL_RECORDS_LABEL = 'show all' + + # tooltip for the link to switch to "show all records" + Wice::Defaults::SHOW_ALL_RECORDS_TOOLTIP = 'Show all records' + + # Warning message shown when the user wants to switch to all-records mode + Wice::Defaults::ALL_QUERIES_WARNING = 'Are you sure you want to display all records?' + + # link to paginated view + Wice::Defaults::SWITCH_BACK_TO_PAGINATED_MODE_LABEL = "back to paginated view" + + # tooltip for the link to paginated view + Wice::Defaults::SWITCH_BACK_TO_PAGINATED_MODE_TOOLTIP = "Switch back to the view with pages" + # Title of the date string. Wice::Defaults::DATE_STRING_TOOLTIP = 'Click to delete' + + + Wice::Defaults::SAVED_QUERY_PANEL_TITLE = 'Saved Queries' + Wice::Defaults::SAVE_QUERY_BUTTON_LABEL = 'Save the state of filters' + + Wice::Defaults::SAVED_QUERY_DELETION_CONFIRMATION = 'Are you sure?' + Wice::Defaults::SAVED_QUERY_DELETION_LINK_TITLE = 'Delete query' + Wice::Defaults::SAVED_QUERY_LINK_TITLE = 'Load query' + + Wice::Defaults::VALIDATES_UNIQUENESS_ERROR = "A query with this name already exists" + Wice::Defaults::VALIDATES_PRESENCE_ERROR = "Please sumbit the name of the custom query" + + Wice::Defaults::QUERY_DELETED_MESSAGE = "Saved query deleted." + Wice::Defaults::QUERY_SAVED_MESSAGE = "Query saved." + + ######## Messages END ######## + + end \ No newline at end of file diff --git a/generators/wice_grid_assets/templates/locales/wice_grid.yml b/generators/wice_grid_assets/templates/locales/wice_grid.yml new file mode 100644 index 00000000..74a4e056 --- /dev/null +++ b/generators/wice_grid_assets/templates/locales/wice_grid.yml @@ -0,0 +1,155 @@ +en: + wice_grid: + show_filter_tooltip: Show filter + hide_filter_tooltip: Hide filter + csv_export_tooltip: Export to CSV + filter_tooltip: Filter + reset_filter_tooltip: Reset + boolean_filter_true_label: yes + boolean_filter_false_label: no + previous_label: « Previous + next_label: Next » + # Title of the icon clicking on which will show the calendar to set the FROM date. + date_selector_tooltip_from: From + # Title of the icon clicking on which will show the calendar to set the TO date. + date_selector_tooltip_to: To + # The title of the checkox to turn on negation + negation_checkbox_title: Exclude + # link to switch to show all records + show_all_records_label: show all + # tooltip for the link to switch to show all records + show_all_records_tooltip: Show all records + # Warning message shown when the user wants to switch to all-records mode + all_queries_warning: Are you sure you want to display all records? + # link to paginated view + switch_back_to_paginated_mode_label: back to paginated view + # tooltip for the link to paginated view + switch_back_to_paginated_mode_tooltip: Switch back to the view with pages + # Title of the date string. + date_string_tooltip: Click to delete + saved_query_panel_title: Saved Queries + save_query_button_label: Save the state of filters + saved_query_deletion_confirmation: Are you sure? + saved_query_deletion_link_title: Delete query + saved_query_link_title: Load query + validates_uniqueness_error: A query with this name already exists + validates_presence_error: Please sumbit the name of the custom query + query_deleted_message: Saved query deleted. + query_saved_message: Query saved. + +nl: + wice_grid: + show_filter_tooltip: Filter tonen + hide_filter_tooltip: Filter verbergen + csv_export_tooltip: Als CSV exporteren + filter_tooltip: Filter + reset_filter_tooltip: Terugstellen + boolean_filter_true_label: ja + boolean_filter_false_label: neen + previous_label: « Vorige + next_label: Volgende » + # Title of the icon clicking on which will show the calendar to set the FROM date. + date_selector_tooltip_from: Vanaf + # Title of the icon clicking on which will show the calendar to set the TO date. + date_selector_tooltip_to: Tot + # The title of the checkox to turn on negation + negation_checkbox_title: Uitsluiten + # link to switch to show all records + show_all_records_label: Alle rijen tonen + # tooltip for the link to switch to show all records + show_all_records_tooltip: Alle rijen tonen + # Warning message shown when the user wants to switch to all-records mode + all_queries_warning: Bent u zeker dat u alle rijen wilt tonen? + # link to paginated view + switch_back_to_paginated_mode_label: Terug naar pagina's + # tooltip for the link to paginated view + switch_back_to_paginated_mode_tooltip: Terug naar pagina's + # Title of the date string. + date_string_tooltip: Klik om te verwijderen + saved_query_panel_title: Opgeslagen query's + save_query_button_label: Query opslaan + saved_query_deletion_confirmation: Bent u zeker? + saved_query_deletion_link_title: Query verwijderen + saved_query_link_title: Query laden + validates_uniqueness_error: Deze query bestaat reeds + validates_presence_error: Gelieve de naam van de query in te vullen + query_deleted_message: Opgeslagen query verwijderd. + query_saved_message: Query opgeslagen + +fr: + wice_grid: + show_filter_tooltip: Afficher le filtre + hide_filter_tooltip: Cacher le filtrer + csv_export_tooltip: Exporter en CSV + filter_tooltip: Filtrer + reset_filter_tooltip: Reset + boolean_filter_true_label: oui + boolean_filter_false_label: non + previous_label: « Page précédente + next_label: Page suivante » + # Title of the icon clicking on which will show the calendar to set the FROM date. + date_selector_tooltip_from: De + # Title of the icon clicking on which will show the calendar to set the TO date. + date_selector_tooltip_to: à + # The title of the checkox to turn on negation + negation_checkbox_title: Exclure + # link to switch to show all records + show_all_records_label: Voir tous + # tooltip for the link to switch to show all records + show_all_records_tooltip: Voir tous les enregistrements + # Warning message shown when the user wants to switch to all-records mode + all_queries_warning: Etes-vous certain de vouloir afficher tous les enregistrements? + # link to paginated view + switch_back_to_paginated_mode_label: Retour à la vue paginée + # tooltip for the link to paginated view + switch_back_to_paginated_mode_tooltip: Retour à la vue par pages + # Title of the date string. + date_string_tooltip: Cliquez pour effacer + saved_query_panel_title: Requêtes sauvées + save_query_button_label: Sauver l'état des filtres + saved_query_deletion_confirmation: Etes vous sûr? + saved_query_deletion_link_title: Effacer la requête + saved_query_link_title: Charger la requête + validates_uniqueness_error: Un requête existante porte déjà ce nom + validates_presence_error: Veuillez indiquer le nom de la requête que vous souhaitez sauver + query_deleted_message: La requête a été effacée. + query_saved_message: La requête a été sauvée. + +ru: + wice_grid: + show_filter_tooltip: Показать фильтр + hide_filter_tooltip: Спрятать фильтр + csv_export_tooltip: Экспорт в CSV + filter_tooltip: Фильтровать + reset_filter_tooltip: Сброс + boolean_filter_true_label: да + boolean_filter_false_label: нет + previous_label: « Предыдущая + next_label: Следующая » + # Title of the icon clicking on which will show the calendar to set the FROM date. + date_selector_tooltip_from: С + # Title of the icon clicking on which will show the calendar to set the TO date. + date_selector_tooltip_to: До + # The title of the checkox to turn on negation + negation_checkbox_title: Исключая строки + # link to switch to show all records + show_all_records_label: показать все + # tooltip for the link to switch to show all records + show_all_records_tooltip: Показать все записи + # Warning message shown when the user wants to switch to all-records mode + all_queries_warning: Вы уверены в том, что хотите отобразить все записи? + # link to paginated view + switch_back_to_paginated_mode_label: Назад к постраничному выводу + # tooltip for the link to paginated view + switch_back_to_paginated_mode_tooltip: Назад к постраничному выводу + # Title of the date string. + date_string_tooltip: Кликните, чтобы удалить дату + saved_query_panel_title: Сохранённые фильтры + save_query_button_label: Сохранить фильтр + saved_query_deletion_confirmation: Вы уверены? + saved_query_deletion_link_title: Удалить сохранённый фильтр + saved_query_link_title: Загрузить сохранённый фильтр + validates_uniqueness_error: Сохранённый фильтр с таким именем уже существует + validates_presence_error: Пожалуйста введите имя сохраняемого фильтра + query_deleted_message: Сохранённый фильтр удалён. + query_saved_message: Сохранённый фильтр сохранён. diff --git a/generators/wice_grid_assets/wice_grid_assets_generator.rb b/generators/wice_grid_assets/wice_grid_assets_generator.rb index 4df2d5c2..261ee258 100644 --- a/generators/wice_grid_assets/wice_grid_assets_generator.rb +++ b/generators/wice_grid_assets/wice_grid_assets_generator.rb @@ -5,6 +5,10 @@ def manifest m.directory "config/initializers" m.file "initializers/wice_grid_config.rb", "config/initializers/wice_grid_config.rb" + # wice_grid locales + m.directory "config/locales" + m.file "locales/wice_grid.yml", "config/locales/wice_grid.yml" + # wice_grid js & css m.file "javascripts/wice_grid.js", "public/javascripts/wice_grid.js" m.file "stylesheets/wice_grid.css", "public/stylesheets/wice_grid.css" diff --git a/lib/grid_renderer.rb b/lib/grid_renderer.rb index 5770dc6e..9cc5bb95 100644 --- a/lib/grid_renderer.rb +++ b/lib/grid_renderer.rb @@ -79,10 +79,11 @@ def each_column_with_attribute #:nodoc: def csv_export_icon #:nodoc: if @grid.export_to_csv_enabled + tooltip = WiceGridNlMessageProvider.get_message(:CSV_EXPORT_TOOLTIP) link_to_function( image_tag(Defaults::CSV_EXPORT_ICON, - :title => Defaults::CSV_EXPORT_TOOLTIP, - :alt => Defaults::CSV_EXPORT_TOOLTIP), "#{grid.name}.export_to_csv()") + :title => tooltip, + :alt => tooltip), "#{grid.name}.export_to_csv()") else nil end @@ -210,8 +211,8 @@ def column(opts = {}, &block) :allow_multiple_selection => Defaults::ALLOW_MULTIPLE_SELECTION, :allow_ordering => true, :attribute_name => nil, - :boolean_filter_false_label => Defaults::BOOLEAN_FILTER_FALSE_LABEL, - :boolean_filter_true_label => Defaults::BOOLEAN_FILTER_TRUE_LABEL, + :boolean_filter_false_label => WiceGridNlMessageProvider.get_message(:BOOLEAN_FILTER_FALSE_LABEL), + :boolean_filter_true_label => WiceGridNlMessageProvider.get_message(:BOOLEAN_FILTER_TRUE_LABEL), :class => nil, :column_name => '', :custom_filter => nil, diff --git a/lib/js_calendar_helpers.rb b/lib/js_calendar_helpers.rb index 3ebfb526..eabb224a 100644 --- a/lib/js_calendar_helpers.rb +++ b/lib/js_calendar_helpers.rb @@ -3,7 +3,28 @@ module JSCalendarHelpers #:nodoc: include ActionView::Helpers::AssetTagHelper - def calendar_constructor(popup_trigger_icon_id, dom_id, date_format, date_span_id, with_time) #:nodoc: + def calendar_constructor(popup_trigger_icon_id, dom_id, date_format, date_span_id, with_time) + + javascript = '' + + unless @_wg_date_picker_language_initialized + lang = Object.const_defined?(:I18n) ? I18n.locale : nil + javascript << %| Calendar.language = '#{lang}';\n| unless lang.blank? + @_wg_date_picker_language_initialized = true + end + + javascript << %| new Calendar({\n | + javascript << %| popupTriggerElement : "#{popup_trigger_icon_id}",\n | + javascript << %| initialDate : $('#{dom_id}').value,\n | + javascript << %| dateFormat : "#{date_format}",\n| + if with_time + javascript << %| withTime : true,\n| + end + javascript << %| outputFields : $A(['#{date_span_id}', '#{dom_id}'])\n | + javascript << %| });\n| + + javascript + end def select_date_datetime_common(initial_date, opts, html_opts, with_time, date_format) #:nodoc: options = {:prefix => 'date'} @@ -25,7 +46,7 @@ def select_date_datetime_common(initial_date, opts, html_opts, with_time, date_f content_tag(:span, date_string, :id => date_span_id), %! $('#{date_span_id}').innerHTML = ''; $('#{dom_id}').value = ''; !, :class => 'date_label', - :title => Defaults::DATE_STRING_TOOLTIP) + ' ' + + :title => WiceGridNlMessageProvider.get_message(:DATE_STRING_TOOLTIP)) + ' ' + hidden_field_tag(name, date_string, :class => 'text-input', :id => dom_id) diff --git a/lib/view_columns.rb b/lib/view_columns.rb index ebd0ce9b..fb17f926 100644 --- a/lib/view_columns.rb +++ b/lib/view_columns.rb @@ -258,8 +258,10 @@ def render_standard_filter_internal(params) #:nodoc: end def render_calendar_filter_internal(params) #:nodoc: - html1, js1 = datetime_calendar(params[:fr], {:include_blank => true, :prefix => @name1, :id => @dom_id}, :title => Defaults::DATE_SELECTOR_TOOLTIP_FROM) - html2, js2 = datetime_calendar(params[:to], {:include_blank => true, :prefix => @name2, :id => @dom_id2}, :title => Defaults::DATE_SELECTOR_TOOLTIP_TO) + html1, js1 = datetime_calendar(params[:fr], {:include_blank => true, :prefix => @name1, :id => @dom_id}, + :title => WiceGridNlMessageProvider.get_message(:DATE_SELECTOR_TOOLTIP_FROM)) + html2, js2 = datetime_calendar(params[:to], {:include_blank => true, :prefix => @name2, :id => @dom_id2}, + :title => WiceGridNlMessageProvider.get_message(:DATE_SELECTOR_TOOLTIP_TO)) [%!
#{html1}
#{html2}
!, js1 + js2] end @@ -297,8 +299,10 @@ def render_standard_filter_internal(params) #:nodoc: def render_calendar_filter_internal(params) #:nodoc: - html1, js1 = date_calendar(params[:fr], {:include_blank => true, :prefix => @name1}, :title => Defaults::DATE_SELECTOR_TOOLTIP_FROM) - html2, js2 = date_calendar(params[:to], {:include_blank => true, :prefix => @name2}, :title => Defaults::DATE_SELECTOR_TOOLTIP_TO) + html1, js1 = date_calendar(params[:fr], {:include_blank => true, :prefix => @name1}, + :title => WiceGridNlMessageProvider.get_message(:DATE_SELECTOR_TOOLTIP_FROM)) + html2, js2 = date_calendar(params[:to], {:include_blank => true, :prefix => @name2}, + :title => WiceGridNlMessageProvider.get_message(:DATE_SELECTOR_TOOLTIP_TO)) [%!
#{html1}
#{html2}
!, js1 + js2] end @@ -327,7 +331,7 @@ def render_filter_internal(params) #:nodoc: end + check_box_tag(parameter_name2, '1', (params[:n] == '1'), :id => @dom_id2, - :title => ::Wice::Defaults::NEGATION_CHECKBOX_TITLE, + :title => WiceGridNlMessageProvider.get_message(:NEGATION_CHECKBOX_TITLE), :class => 'negation_checkbox') + '' else diff --git a/lib/wice_grid_misc.rb b/lib/wice_grid_misc.rb index c8dff290..f67033e0 100644 --- a/lib/wice_grid_misc.rb +++ b/lib/wice_grid_misc.rb @@ -70,6 +70,39 @@ def log(message) #:nodoc: end end + + # The point of this module is to provide a thin layer between + # Rails Internationalization API and WiceGrid, enabling a fallback + # to the old hardcoded messages if no translations are available + # or I18n is not present (Rails 2.1.0 and older). + module WiceGridNlMessageProvider #:nodoc: + class << self + + def get_from_hardcoded_constants(key) #:nodoc: + if Wice::Defaults.const_defined?(key) + Wice::Defaults.const_get(key) + else + return "message for key #{key} not found!" + end + end + + if Object.const_defined?(:I18n) # Rails with :I18n + + def get_message(key) #:nodoc: + translated = I18n.t(key.to_s.downcase, :scope => 'wice_grid', :default => '_') + if translated == '_' + get_from_hardcoded_constants(key) + else + translated + end + end + + else # Rails without :I18n + alias_method :get_message, :get_from_hardcoded_constants + end + end + end + module Defaults #:nodoc: end diff --git a/lib/wice_grid_serialized_queries_controller.rb b/lib/wice_grid_serialized_queries_controller.rb index 66b683bc..99019acd 100644 --- a/lib/wice_grid_serialized_queries_controller.rb +++ b/lib/wice_grid_serialized_queries_controller.rb @@ -27,7 +27,7 @@ def delete #:nodoc: if params[:current] @current = @query_store_model.find_by_id_and_grid_name(params[:current], @grid_name) end - @notification_messages = ::Wice::Defaults::QUERY_DELETED_MESSAGE + @notification_messages = WiceGridNlMessageProvider.get_message(:QUERY_DELETED_MESSAGE) else @error_messages = sq.errors.full_raw_messages.join(' ') end @@ -50,7 +50,7 @@ def create #:nodoc: if @saved_query.save @grid_title_id = "#{@grid_name}_title" - @notification_messages = ::Wice::Defaults::QUERY_SAVED_MESSAGE + @notification_messages = WiceGridNlMessageProvider.get_message(:QUERY_SAVED_MESSAGE) else @error_messages = @saved_query.errors.map{ |_, msg| msg }.join(' ') end diff --git a/lib/wice_grid_serialized_queries_view_helpers.rb b/lib/wice_grid_serialized_queries_view_helpers.rb index 84c34190..daf67b0f 100644 --- a/lib/wice_grid_serialized_queries_view_helpers.rb +++ b/lib/wice_grid_serialized_queries_view_helpers.rb @@ -24,7 +24,7 @@ def saved_queries_panel(grid, opts = {}) parameters << [ CGI.unescape({:extra => {k => ''}}.to_query.sub(/=$/,'')) , v.to_s ] end parameters << ['authenticity_token', form_authenticity_token] - %!

#{Defaults::SAVED_QUERY_PANEL_TITLE}

! + + %!

#{WiceGridNlMessageProvider.get_message(:SAVED_QUERY_PANEL_TITLE)}

! + saved_queries_list(grid_name, grid.saved_query, options[:extra_parameters]) + %!
! + if block_given? @@ -43,24 +43,29 @@ def saved_queries_panel(grid, opts = {}) text_field_tag(id_and_name, '', :size => 20, :onkeydown=>'', :id => id_and_name, :onkeydown=>"if (event.keyCode == 13) {#{grid_name}_save_query()}") + - button_to_function(Defaults::SAVE_QUERY_BUTTON_LABEL, "#{grid_name}_save_query()" ) + '
' + button_to_function(WiceGridNlMessageProvider.get_message(:SAVE_QUERY_BUTTON_LABEL), "#{grid_name}_save_query()" ) + '
' end def saved_queries_list(grid_name, saved_query = nil, extra_parameters = nil) #:nodoc: + + link_title = WiceGridNlMessageProvider.get_message(:SAVED_QUERY_LINK_TITLE) + deletion_confirmation = WiceGridNlMessageProvider.get_message(:SAVED_QUERY_DELETION_CONFIRMATION) + deletion_link_title = WiceGridNlMessageProvider.get_message(:SAVED_QUERY_DELETION_LINK_TITLE) + query_store_model = ::Wice::get_query_store_model currently_loaded_query_id = saved_query ? saved_query.id : nil with = extra_parameters.nil? ? nil : "'" + {:extra => extra_parameters}.to_query + "'" %!