Sha256: f69b1b7f6d4d975cb14ba6a789654fd6fb5b4c68c5388d547a1e5c7d187c3db1

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

class CommitFilter::Commit::FiltersController < CommitFilter::ApplicationController
  layout "#{CommitFilter::ApplicationController.framework_views_path}/layouts/commit_filter/application"
  
  def new
    params[:filter] ||= {}
    @filter = CommitFilter::Model.new(params[:filter].merge(logger: logger))
    @commit_filter_javascripts = ['application', 'commit_filter/form']
    
    render "#{framework_views_path}/commit/filters/new"
  end

  def create
    params[:filter] ||= {}
    @filter = CommitFilter::Model.create(params[:filter].merge(logger: logger))
    
    if @filter.valid? && @filter.last_revision.blank?
      flash[:alert] = I18n.t('commit_filter.filters.create.errors.nothing_found')
    end
    
    @commit_filter_stylesheets = ['application', 'commit_filter/application', 'commit_filter/commit/diff']
    @commit_filter_javascripts = [
      'application', 'commit_filter/form', 'commit_filter/file_commits', 
      "#{CommitFilter::ApplicationController.framework_views_path}/filter_result"
    ]
    
    render "#{framework_views_path}/commit/filters/new"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
commit_filter-0.1.0 app/controllers/commit_filter/commit/filters_controller.rb