<commit_before>class UsersController < ResourceController::Base
  actions :all, :except => :destroy

  before_filter :require_user, :only => [:install_plugin]
  before_filter :require_current_user, :only => [:edit, :update, :add_to_collection]

  REGISTERED_FLASH = "Account registered!"

  new_action.before do
    email = session.delete(:email) || ''

    object.email ||= email
    object.display_name = email[0..((email.index('@') || 0) - 1)]
  end

  def remove_favorite
    sprite = Sprite.find(params[:id])
    current_user.remove_favorite(sprite)
    render :nothing => true
  end

  def set_avatar
    sprite = Sprite.find(params[:sprite_id])
    current_user.set_avatar(sprite)
    render :nothing => true
  end

  def create
    @object = User.new(params[:user])

    @object.referrer_id = session[:referrer_id]

    @object.save do |result|
      if result
        session.delete(:referrer_id)

        bingo!("registration_popup")
        bingo!("load_pic")
        bingo!("login_after")

        save_sprites_to_user(user)

        respond_to do |format|
          format.html do
            @registered = true
            flash[:notice] = REGISTERED_FLASH
            redirect_to user
          end
          format.json { render :json => {:status => "ok"} }
        end

      else
        respond_to do |format|
          format.html { render :action => :new }
          format.json do
            render :json => {
              :status => "error",
              :errors => user.errors.full_messages
            }
          end
        end
      end
    end
  end

  def add_to_collection
    collectables = [Sprite, Collection, Plugin, Script, User, Library]

    collectable_id = params[:collectable_id].to_i
    collectable_type = params[:collectable_type].constantize
    collection_name = params[:collection_name]

    if collectables.include? collectable_type
      user.add_to_collection(collectable_type.find(collectable_id), collection_name)
    end

    render :nothing => true
  end
<commit_msg>added fullscreen layout to users controller<commit_after>class UsersController < ResourceController::Base
  actions :all, :except => :destroy
  layout "fullscreen"

  before_filter :require_user, :only => [:install_plugin]
  before_filter :require_current_user, :only => [:edit, :update, :add_to_collection]

  REGISTERED_FLASH = "Account registered!"

  new_action.before do
    email = session.delete(:email) || ''

    object.email ||= email
    object.display_name = email[0..((email.index('@') || 0) - 1)]
  end

  def remove_favorite
    sprite = Sprite.find(params[:id])
    current_user.remove_favorite(sprite)
    render :nothing => true
  end

  def set_avatar
    sprite = Sprite.find(params[:sprite_id])
    current_user.set_avatar(sprite)
    render :nothing => true
  end

  def create
    @object = User.new(params[:user])

    @object.referrer_id = session[:referrer_id]

    @object.save do |result|
      if result
        session.delete(:referrer_id)

        bingo!("registration_popup")
        bingo!("load_pic")
        bingo!("login_after")

        save_sprites_to_user(user)

        respond_to do |format|
          format.html do
            @registered = true
            flash[:notice] = REGISTERED_FLASH
            redirect_to user
          end
          format.json { render :json => {:status => "ok"} }
        end

      else
        respond_to do |format|
          format.html { render :action => :new }
          format.json do
            render :json => {
              :status => "error",
              :errors => user.errors.full_messages
            }
          end
        end
      end
    end
  end

  def show
    @user = User.find(params[:id])
  end

  def add_to_collection
    collectables = [Sprite, Collection, Plugin, Script, User, Library]

    collectable_id = params[:collectable_id].to_i
    collectable_type = params[:collectable_type].constantize
    collection_name = params[:collection_name]

    if collectables.include? collectable_type
      user.add_to_collection(collectable_type.find(collectable_id), collection_name)
    end

    render :nothing => true
  end

{'fraction_non_alphanumeric': 0.10642908740669396, 'fraction_numerical': 0.0014447387430772936, 'mean_word_length': 2.6121739130434785, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4804964', 'n_tokens_mistral': 1283, 'n_tokens_neox': 1243, 'n_words': 270}