lib/tabulatr/tabulatr/settings.rb in tabulatr-0.0.5 vs lib/tabulatr/tabulatr/settings.rb in tabulatr-0.1.0

- old
+ new

@@ -36,10 +36,11 @@ :sorting_asc_class => 'sorting-asc', # class for the currently asc sorting column :sorting_desc_class => 'sorting-desc', # class for the currently desc sorting column :page_left_class => 'page-left', # class for the page left button :page_right_class => 'page-right', # class for the page right button :page_no_class => 'page-no', # class for the page no <input> + :reset_class => 'reset', # class for the reset button :control_div_class_before => 'table-controls', # class of the upper div containing the paging and batch action controls :control_div_class_after => 'table-controls', # class of the lower div containing the paging and batch action controls :paginator_div_class => 'paginator', # class of the div containing the paging controls :batch_actions_div_class => 'batch-actions', # class of the div containing the batch action controls :select_controls_div_class => 'check-controls', # class of the div containing the check controls @@ -61,14 +62,15 @@ :select_none_label => 'Select None', # Text on the select none button :select_visible_label => 'Select visible', # Text on the select visible button :unselect_visible_label => 'Unselect visible', # Text on the unselect visible button :select_filtered_label => 'Select filtered', # Text on the select filtered button :unselect_filtered_label => 'Unselect filtered',# Text on the unselect filtered button + :reset_label => 'Reset', # Text on the reset button :info_text => "Showing %1$d, total %2$d, selected %3$d, matching %4$d", # which controls to be rendered above and below the tabel and in which order - :before_table_controls => [:submit, :paginator, :batch_actions, :select_controls, :info_text], + :before_table_controls => [:submit, :reset, :paginator, :batch_actions, :select_controls, :info_text], :after_table_controls => [], # whih selecting controls to render in which order :select_controls => [:select_all, :select_none, :select_visible, :unselect_visible, :select_filtered, :unselect_filtered], @@ -81,23 +83,24 @@ :sort_up_button => 'sort_arrow_up.gif', :sort_up_button_inactive => 'sort_arrow_up_off.gif', :sort_down_button => 'sort_arrow_down.gif', :sort_down_button_inactive => 'sort_arrow_down_off.gif', - :make_form => true, # whether or not to wrap the whole table (incl. controls) in a form - :table_html => false, # a hash with html attributes for the table - :row_html => false, # a hash with html attributes for the normal trs - :header_html => false, # a hash with html attributes for the header trs - :filter_html => false, # a hash with html attributes for the filter trs - :filter => true, # false for no filter row at all - :paginate => true, # true to show paginator - :sortable => true, # true to allow sorting (can be specified for every sortable column) - :selectable => true, # true to render "select all", "select none" and the like - :action => nil, # target action of the wrapping form if applicable - :batch_actions => false, # :name => value hash of batch action stuff - :translate => false, # call t() for all 'labels' and stuff, possible values are true/:translate or :localize - :row_classes => ['odd', 'even'] # class for the trs + :make_form => true, # whether or not to wrap the whole table (incl. controls) in a form + :table_html => false, # a hash with html attributes for the table + :row_html => false, # a hash with html attributes for the normal trs + :header_html => false, # a hash with html attributes for the header trs + :filter_html => false, # a hash with html attributes for the filter trs + :filter => true, # false for no filter row at all + :paginate => true, # true to show paginator + :sortable => true, # true to allow sorting (can be specified for every sortable column) + :selectable => true, # true to render "select all", "select none" and the like + :reset => false, # true to render a reset button. Only reasonable in 'stateful' case + :action => nil, # target action of the wrapping form if applicable + :batch_actions => false, # :name => value hash of batch action stuff + :translate => false, # call t() for all 'labels' and stuff, possible values are true/:translate or :localize + :row_classes => ['odd', 'even'] # class for the trs }) # these settings are considered constant for the whole application, can not be overridden # on a per-table basis. # That's necessary to allow find_for_table to work properly @@ -109,10 +112,12 @@ :sort_postfix => '_sort', # postfix for name of the filter in the params :hash => xxx_filter :checked_postfix => '_checked', # postfix for name of the checked in the params :hash => xxx_filter :associations_filter => '__association', # name of the associations in the filter hash :method => 'post', # http method for that form if applicable :batch_postfix => '_batch', # postfix for name of the batch action select + :state_session_postfix => '_table_state', # postfix for the state hash in the sessions + :reset_state_postfix => '_reset_state', # postfix for the name of the input to reset state :checked_separator => ',' # symbol to separate the checked ids }) # these settings are considered constant for the whole application, can not be overridden # on a per-table basis. @@ -158,18 +163,20 @@ :pagination => :__pagination, :filters => :__filters, :classname => :__classname, :sorting => :__sorting, :checked => :__checked, - :store_data => :__store_data + :store_data => :__store_data, + :stateful => :__stateful }) # defaults for the find_for_table FINDER_OPTIONS = WhinyHash.new({ :default_order => false, :default_pagesize => false, :precondition => false, - :store_data => false + :store_data => false, + :stateful => false }) # Stupid hack SQL_OPTIONS = WhinyHash.new({ :like => nil