Sha256: 6910bdc88d87bb2e9bb8885c105c04ba2661cae0d403d635617cf386a5bcaa1a
Contents?: true
Size: 939 Bytes
Versions: 8
Compression:
Stored size: 939 Bytes
Contents
- model = controller.controller_name.classify.constantize - sort_by_menu_items = model.sort_by_fields.map { |field| options_menu_item(:sort_by, field) } - current_sort_by = t("option_" + model.sort_by_map.invert[@sort_by]) %div{ :style => "margin: 0px 0px 6px 0px" } = text_field_tag('query', @current_query, :size => 32, :placeholder => "Search #{controller_name}") %span.sorting_options -# sort_by_displaying: Sort {{models}} by {{field}} displaying first name {{position}} last name. = t(:sort_by, :models => t(:"#{controller_name}_small"), :field => link_to(current_sort_by, "#", :id => :sort_by)).html_safe :javascript new Form.Element.Observer('query', 1.5, function(element, value) { crm.search(value, '#{controller_name}'); }); :javascript new crm.Menu({ trigger : "sort_by", fade : 0.5, appear : 0.5, menu_items: [ #{sort_by_menu_items.join(",")} ] });
Version data entries
8 entries across 8 versions & 1 rubygems