Sha256: f64f0d1dd8aa57e3dbb6d5ebfc3d21e3cee1c470b7878fed7d88983de1ff3f8c
Contents?: true
Size: 1.19 KB
Versions: 4
Compression:
Stored size: 1.19 KB
Contents
module CommonInterface module ViewHelper # # Form Buttons # def ok_button text = t(:ok) submit_tag text, :class => '_submit_form_or_ajax_form' end def cancel_button text = t(:cancel) link_to text, :back, {}, :class => '_redirect_back_or_close_dialog' end # # Custom # def tag_cloud tags, classes, &block return if tags.empty? max_count = tags.sort{|a, b| a.count <=> b.count}.last.count.to_f tags.sort{|a, b| a.name <=> b.name}.each do |tag| index = ((tag.count / max_count) * (classes.size - 1)).round block.call tag, classes[index] end end # # Folder # # params = { # :l => I18n.locale, # } # # opt = { # :upload_url => item_files_path(folder), # :view => 'folder_thumb', # :select_files => t(:select_files), # } def build_files_uploader_for params, opt raise 'update me with crystal.config' session_key = ActionController::Base.session_options[:key] params = { session_key => cookies[session_key] }.merge(params) "new FilesUpload(#{params.to_json}, #{opt.to_json});" end end end
Version data entries
4 entries across 4 versions & 2 rubygems