<commit_before># encoding: utf-8
require_dependency "fastui/application_controller"

module Fastui
  class MMenuItemsController < ApplicationController
    respond_to :html, :xml, :json

    def index
      @m_menu_items = params[:node] == 'root' ? MMenuItem.roots : MMenuItem.where({
                                                                                    :parent_id => params[:node]
                                                                                }.delete_if { |k, v| v.blank? })

      #if params[:id] == 'root'
      #  @m_menu_items = MMenuItem.roots
      #else
      #  @m_menu_items = MMenuItem.where({:parent_id => params[:id]}.delete_if { |k, v| v.blank?})
        #@m_menu_items = paginate(@items)
      #end
      respond_with(@m_menu_items.to_json(:include => [:m_menu, :createdbyorg, :createdby, :updatedby], :methods => [:leaf?, :child?]))
    end

    def show
      @m_menu_item = MMenuItem.find(params[:id])
      respond_with(@m_menu_item)
    end

    def edit
      @m_menu_item = MMenuItem.find(params[:id])
      respond_with(@m_menu_item.to_json(:include => [:m_window, :m_menu, :createdbyorg, :createdby, :updatedby]))
    end

    def new
      @m_menu_item = MMenuItem.new
      respond_with(@m_menu_item)
    end

    def create
      @m_menu_item = MMenuItem.new(params[:m_menu_item])
      respond_with(@m_menu_item) do |format|
        if @m_menu_item.save
          format.json { render :json => {:success => true, :msg => 'ok'} }
        else
          format.json { render :json => {:success => false, :msg => 'failure'} }
        end
      end

    end<commit_msg>modify ui setup<commit_after># encoding: utf-8
require_dependency "fastui/application_controller"

module Fastui
  class MMenuItemsController < ApplicationController
    respond_to :html, :xml, :json

    def index
      @m_menu_items = params[:node] == 'root' ? MMenuItem.roots : MMenuItem.where({
                                                                                    :parent_id => params[:node]
                                                                                }.delete_if { |k, v| v.blank? })

      #if params[:id] == 'root'
      #  @m_menu_items = MMenuItem.roots
      #else
      #  @m_menu_items = MMenuItem.where({:parent_id => params[:id]}.delete_if { |k, v| v.blank?})
        #@m_menu_items = paginate(@items)
      #end
      respond_with(@m_menu_items.to_json(:include => [:m_menu, :createdbyorg, :createdby, :updatedby], :methods => [:leaf?, :child?]))
    end

    def show
      @m_menu_item = MMenuItem.find(params[:id])
      respond_with(@m_menu_item)
    end

    def edit
      @m_menu_item = MMenuItem.find(params[:id])
      respond_with(@m_menu_item.to_json(:include => [:m_menu, :createdbyorg, :createdby, :updatedby]))
    end

    def new
      @m_menu_item = MMenuItem.new
      respond_with(@m_menu_item)
    end

    def create
      @m_menu_item = MMenuItem.new(params[:m_menu_item])
      respond_with(@m_menu_item) do |format|
        if @m_menu_item.save
          format.json { render :json => {:success => true, :msg => 'ok'} }
        else
          format.json { render :json => {:success => false, :msg => 'failure'} }
        end
      end

    end
{'fraction_non_alphanumeric': 0.12942989214175654, 'fraction_numerical': 0.0006163328197226503, 'mean_word_length': 2.1151631477927064, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6881829', 'n_tokens_mistral': 1021, 'n_tokens_neox': 996, 'n_words': 202}