# coding: utf-8 module AdminHelper def act_menu(cond) cond ? 'active' : nil end def sortable(url) html = %Q{ }.gsub(/[\n ]+/, ' ').strip.html_safe return content_for(:js,html) end def show_tree(c) html = "" html << "
  • #{link_to c.name, edit_admin_category_path(c)}

    " html << " #{link_to "Удал",[:admin, c], data: { confirm: 'Точно удалить?' }, :method => :delete, class: "del"}

    " unless c.children.empty? html << "" c.children.order('position').each do |ch| html << show_tree(ch) end html << "" end html << "
  • " return raw(html) end def sort_tree(url, maxLevels = 2) %Q{ }.gsub(/[\n ]+/, ' ').strip.html_safe end def tsingular model model.model_name.human end def taccusative model_name t("activerecord.models.#{model_name}.acc") end def tplural model model.model_name.human(:count => 'other') end end