app/controllers/repository_controller.rb
# Delete all selected or single displayed repo(s)
Delete all selected or single displayed repo(s)
Delete all selected or single displayed repo ( s )
def deleterepos
    assert_privileges("repository_delete")
    repos = []
    if @lastaction == "show_list" 
      repos = find_checked_items
      if repos.empty?
        add_flash(_("No %{model} were selected for deletion") % {:model => ui_lookup(:tables => "repository")}, :error)
      end
      process_repos(repos, "destroy") unless repos.empty?
      add_flash(_("Delete initiated for %{count_model} from the CFME Database") %
                  {:count_model => pluralize(repos.length, "Repository")}) if @flash_array.nil?
    else 
      if params[:id].nil? || Repository.find_by_id(params[:id]).nil?
        add_flash(_("Repository no longer exists"), :error)
      else
        repos.push(params[:id])
      end
      @single_delete = true
      process_repos(repos, "destroy") unless repos.empty?
      add_flash(_("The selected Repository was deleted")) if @flash_array.nil?
    end
    show_list
    @refresh_partial = "layouts/gtl"
  end
def deleterepos assert_privileges ( "repository_delete" ) repos = [ ] if @lastaction == "show_list" repos = find_checked_items if repos . empty? add_flash ( _ ( "No %{model} were selected for deletion" ) % { :model => ui_lookup ( :tables => "repository" ) } , :error ) end process_repos ( repos , "destroy" ) unless repos . empty? add_flash ( _ ( "Delete initiated for %{count_model} from the CFME Database" ) % { :count_model => pluralize ( repos . length , "Repository" ) } ) if @flash_array . nil? else if params [ :id ] . nil? || Repository . find_by_id ( params [ :id ] ) . nil? add_flash ( _ ( "Repository no longer exists" ) , :error ) else repos . push ( params [ :id ] ) end @single_delete = true process_repos ( repos , "destroy" ) unless repos . empty? add_flash ( _ ( "The selected Repository was deleted" ) ) if @flash_array . nil? end show_list @refresh_partial = "layouts/gtl" end
Delete all selected or single displayed repo(s)
Delete all selected or single displayed repo ( s )
# showing a list, scan all selected repos # showing 1 repository, scan it