<commit_before>Admin
=====

A quick way to implement a nice looking Admin in Rails.

Admin requires the following plugins:

* [haml](http://github.com/nex3/haml)
* [rails_widget](https://github.com/winton/rails_widget)
* [will_paginate](https://github.com/mislav/will_paginate)


Install
-------

	git submodule add <EMAIL>:winton/admin.git vendor/plugins/admin
	script/generate controller Admin
	rake admin
	rake widgets:install widgets=dialog,indicator,form,table

### Create title png
	
Open **public/images/admin/system/title.psd**, edit, and save to **public/images/admin/title.png**.


About the Install
-----------------

The `rake admin` task copies assets to

* app/views/admin/system
* app/widgets/admin
* public/images/admin/system
* public/javascripts/admin/system
* public/stylesheets/admin/system

The `rake widgets:install` task copies widgets into **app/widgets/vendor**. See the [rails_widget README](https://github.com/winton/rails_widget) for more information.


Routes
------

	ActionController::Routing::Routes.draw do |map|
	  Admin::routes
	end

(Add `Admin::routes` to **config/routes.rb**.)


Controller
----------

	class AdminController < ApplicationController
	  acts_as_admin :articles, :comments, :users
		
	  def articles
	  end
		
	  def comments
	  end
		
	  def users
	  end
	end

Add views to **views/admin**. Admin will take care of the layout, navigation, and rendering of your actions.

Your admin is located at `http://localhost/admin`.


Views
-----

You weren't expecting to code your own data tables and forms, were you?

Most of our views render one or more paginated data tables:

	<%= render_widget(:admin, :widgets, :table,
	  :id => 'some_resource_table',
	  :title => 'Some resource',
	  :index_url => '/some_resource.json',
	  :table_links => [
	    { :title => 'New', :url => '/some_resource/new', :implementation => 'admin/widgets/form' }
	  ],
	  :row_links => [
	    { :title => 'Edit',   :url => '/some_resource/:id/edit', :implementation => 'admin/widgets/form' },
	    { :title => 'Delete', :url => '/some_resource/:id.json' }
	  ],
	  :include_js => true
	) %>

See [table_widget](https://github.com/winton/table_widget) for more information.


Resources
---------<commit_msg>Updating README<commit_after>Admin
=====

A quick way to implement a nice looking Admin in Rails.

Admin requires the following plugins:

* [haml](http://github.com/nex3/haml)
* [rails_widget](https://github.com/winton/rails_widget)
* [will_paginate](https://github.com/mislav/will_paginate)


Install
-------

	git submodule add <EMAIL>:winton/admin.git vendor/plugins/admin
	script/generate controller Admin
	rake admin
	rake widgets:install widgets=dialog,indicator,form,table

### Create title png
	
Open **public/images/admin/system/title.psd**, edit, and save to **public/images/admin/title.png**.


About the Install
-----------------

The `rake admin` task copies assets to

* app/views/admin/system
* app/widgets/admin
* public/images/admin/system
* public/javascripts/admin/system
* public/stylesheets/admin/system

The `rake widgets:install` task copies widgets into **app/widgets/vendor**. See [rails_widget](https://github.com/winton/rails_widget) for more information.


Routes
------

	ActionController::Routing::Routes.draw do |map|
	  Admin::routes
	end

(Add `Admin::routes` to **config/routes.rb**.)


Controller
----------

	class AdminController < ApplicationController
	  acts_as_admin :articles, :comments, :users
		
	  def articles
	  end
		
	  def comments
	  end
		
	  def users
	  end
	end

Add views to **views/admin**. Admin will take care of the layout, navigation, and rendering of your actions.

Your admin is located at **http://localhost/admin**.


Views
-----

You weren't expecting to code your own data tables and forms, were you?

Most of our views render one or more paginated data tables:

	<%= render_widget(:admin, :widgets, :table,
	  :id => 'some_resource_table',
	  :title => 'Some resource',
	  :index_url => '/some_resource.json',
	  :table_links => [
	    { :title => 'New', :url => '/some_resource/new', :implementation => 'admin/widgets/form' }
	  ],
	  :row_links => [
	    { :title => 'Edit',   :url => '/some_resource/:id/edit', :implementation => 'admin/widgets/form' },
	    { :title => 'Delete', :url => '/some_resource/:id.json' }
	  ],
	  :include_js => true
	) %>

See [table_widget](https://github.com/winton/table_widget) for more information.


Resources
---------
{'fraction_non_alphanumeric': 0.1565373402108096, 'fraction_numerical': 0.00044853106077595876, 'mean_word_length': 3.616977225672878, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 35, 'https://': 8, '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': '2680631', 'n_tokens_mistral': 1473, 'n_tokens_neox': 1368, 'n_words': 371}