admin_assistant 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/admin_assistant.gemspec +2 -171
- metadata +4 -173
- data/rails_3_0/Gemfile +0 -12
- data/rails_3_0/Gemfile.lock +0 -100
- data/rails_3_0/README +0 -256
- data/rails_3_0/Rakefile +0 -7
- data/rails_3_0/app/controllers/admin/appointments2_controller.rb +0 -15
- data/rails_3_0/app/controllers/admin/appointments_controller.rb +0 -11
- data/rails_3_0/app/controllers/admin/blog_posts2_controller.rb +0 -138
- data/rails_3_0/app/controllers/admin/blog_posts3_controller.rb +0 -76
- data/rails_3_0/app/controllers/admin/blog_posts4_controller.rb +0 -21
- data/rails_3_0/app/controllers/admin/blog_posts5_controller.rb +0 -27
- data/rails_3_0/app/controllers/admin/blog_posts6_controller.rb +0 -10
- data/rails_3_0/app/controllers/admin/blog_posts_controller.rb +0 -9
- data/rails_3_0/app/controllers/admin/blog_posts_custom_new_and_edit_controller.rb +0 -15
- data/rails_3_0/app/controllers/admin/blog_posts_read_only_controller.rb +0 -19
- data/rails_3_0/app/controllers/admin/bookmarks_controller.rb +0 -11
- data/rails_3_0/app/controllers/admin/comments2_controller.rb +0 -14
- data/rails_3_0/app/controllers/admin/comments_controller.rb +0 -12
- data/rails_3_0/app/controllers/admin/images2_controller.rb +0 -11
- data/rails_3_0/app/controllers/admin/images_controller.rb +0 -6
- data/rails_3_0/app/controllers/admin/misconfigured1_controller.rb +0 -7
- data/rails_3_0/app/controllers/admin/not_migrated_yets_controller.rb +0 -9
- data/rails_3_0/app/controllers/admin/product_categories2_controller.rb +0 -7
- data/rails_3_0/app/controllers/admin/product_categories_controller.rb +0 -5
- data/rails_3_0/app/controllers/admin/television_airings_controller.rb +0 -5
- data/rails_3_0/app/controllers/admin/television_time_slots_controller.rb +0 -5
- data/rails_3_0/app/controllers/admin/users2_controller.rb +0 -10
- data/rails_3_0/app/controllers/admin/users_controller.rb +0 -48
- data/rails_3_0/app/controllers/application_controller.rb +0 -7
- data/rails_3_0/app/controllers/blog_posts_controller.rb +0 -5
- data/rails_3_0/app/helpers/admin/appointments_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/blog_posts2_helper.rb +0 -27
- data/rails_3_0/app/helpers/admin/blog_posts3_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/blog_posts4_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/blog_posts6_helper.rb +0 -13
- data/rails_3_0/app/helpers/admin/blog_posts_custom_new_and_edit_helper.rb +0 -29
- data/rails_3_0/app/helpers/admin/blog_posts_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/blog_posts_read_only_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/bookmarks_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/comments2_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/comments_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/images2_helper.rb +0 -8
- data/rails_3_0/app/helpers/admin/images_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/misconfigured1_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/not_migrated_yets_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/product_categories2_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/product_categories_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/television_airings_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/television_time_slots_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/users2_helper.rb +0 -2
- data/rails_3_0/app/helpers/admin/users_helper.rb +0 -13
- data/rails_3_0/app/helpers/application_helper.rb +0 -2
- data/rails_3_0/app/models/appointment.rb +0 -5
- data/rails_3_0/app/models/blog_post.rb +0 -14
- data/rails_3_0/app/models/blog_post_tag.rb +0 -6
- data/rails_3_0/app/models/bookmark.rb +0 -6
- data/rails_3_0/app/models/comment.rb +0 -4
- data/rails_3_0/app/models/image.rb +0 -3
- data/rails_3_0/app/models/not_migrated_yet.rb +0 -2
- data/rails_3_0/app/models/product.rb +0 -5
- data/rails_3_0/app/models/product_category.rb +0 -9
- data/rails_3_0/app/models/tag.rb +0 -4
- data/rails_3_0/app/models/television_airing.rb +0 -3
- data/rails_3_0/app/models/television_time_slot.rb +0 -11
- data/rails_3_0/app/models/user.rb +0 -11
- data/rails_3_0/app/views/admin/appointments/_subject_input.html.erb +0 -2
- data/rails_3_0/app/views/admin/appointments2/_time_input.html.erb +0 -31
- data/rails_3_0/app/views/admin/blog_posts2/_after_form.html.erb +0 -5
- data/rails_3_0/app/views/admin/blog_posts2/_after_index.html.erb +0 -1
- data/rails_3_0/app/views/admin/blog_posts2/_after_tags_input.html.erb +0 -16
- data/rails_3_0/app/views/admin/blog_posts2/_before_index.html.erb +0 -2
- data/rails_3_0/app/views/admin/blog_posts5/_after_index_header.html.erb +0 -8
- data/rails_3_0/app/views/admin/blog_posts_read_only/_body_for_show.html.erb +0 -1
- data/rails_3_0/app/views/layouts/admin.html.erb +0 -32
- data/rails_3_0/app/views/layouts/application.html.erb +0 -14
- data/rails_3_0/config.ru +0 -4
- data/rails_3_0/config/application.rb +0 -42
- data/rails_3_0/config/boot.rb +0 -6
- data/rails_3_0/config/database.yml +0 -22
- data/rails_3_0/config/environment.rb +0 -5
- data/rails_3_0/config/environments/development.rb +0 -25
- data/rails_3_0/config/environments/production.rb +0 -49
- data/rails_3_0/config/environments/test.rb +0 -35
- data/rails_3_0/config/initializers/backtrace_silencers.rb +0 -7
- data/rails_3_0/config/initializers/inflections.rb +0 -10
- data/rails_3_0/config/initializers/mime_types.rb +0 -5
- data/rails_3_0/config/initializers/secret_token.rb +0 -7
- data/rails_3_0/config/initializers/session_store.rb +0 -8
- data/rails_3_0/config/locales/en.yml +0 -5
- data/rails_3_0/config/routes.rb +0 -8
- data/rails_3_0/db/migrate/20090213215514_create_blog_posts.rb +0 -12
- data/rails_3_0/db/migrate/20090217225542_add_body_to_blog_posts.rb +0 -9
- data/rails_3_0/db/migrate/20090221220917_create_tags.rb +0 -13
- data/rails_3_0/db/migrate/20090221220947_create_blog_post_tags.rb +0 -14
- data/rails_3_0/db/migrate/20090222162204_add_textile_to_blog_posts.rb +0 -9
- data/rails_3_0/db/migrate/20090222163231_add_published_at_to_blog_posts.rb +0 -9
- data/rails_3_0/db/migrate/20090301191722_create_images.rb +0 -16
- data/rails_3_0/db/migrate/20090305165345_create_accounts.rb +0 -14
- data/rails_3_0/db/migrate/20090307225027_rename_accounts_to_users.rb +0 -9
- data/rails_3_0/db/migrate/20090307225750_add_user_id_to_blog_posts.rb +0 -9
- data/rails_3_0/db/migrate/20090309185114_change_blog_posts_textile.rb +0 -9
- data/rails_3_0/db/migrate/20090309193635_create_products.rb +0 -14
- data/rails_3_0/db/migrate/20090309203056_create_comments.rb +0 -15
- data/rails_3_0/db/migrate/20090323005947_create_file_column_images.rb +0 -12
- data/rails_3_0/db/migrate/20090326160049_add_birthday_to_users.rb +0 -9
- data/rails_3_0/db/migrate/20090326223606_add_state_to_users.rb +0 -9
- data/rails_3_0/db/migrate/20090503134004_add_file_column_image_to_products.rb +0 -9
- data/rails_3_0/db/migrate/20090617173651_create_bookmarks.rb +0 -15
- data/rails_3_0/db/migrate/20090624165355_add_tags_string_to_blog_post.rb +0 -9
- data/rails_3_0/db/migrate/20090625144313_add_avatar_fields_to_user.rb +0 -11
- data/rails_3_0/db/migrate/20090629202956_add_merged_into_to_blog_posts.rb +0 -9
- data/rails_3_0/db/migrate/20090701171857_add_force_textile_to_users.rb +0 -9
- data/rails_3_0/db/migrate/20090704163647_add_deleted_at_to_products.rb +0 -9
- data/rails_3_0/db/migrate/20090704173800_add_sale_fields_to_products.rb +0 -13
- data/rails_3_0/db/migrate/20090714024501_create_product_categories.rb +0 -15
- data/rails_3_0/db/migrate/20090819162835_add_admin_level_to_users.rb +0 -9
- data/rails_3_0/db/migrate/20091115134559_add_first_and_last_names_to_users.rb +0 -11
- data/rails_3_0/db/migrate/20091221011256_add_position_to_product_categories.rb +0 -9
- data/rails_3_0/db/migrate/20091222160814_create_appointments.rb +0 -14
- data/rails_3_0/db/migrate/20091227224547_add_user_id_to_appointments.rb +0 -9
- data/rails_3_0/db/migrate/20100214213359_create_television_time_slots.rb +0 -13
- data/rails_3_0/db/migrate/20100214213451_create_television_airings.rb +0 -15
- data/rails_3_0/db/migrate/20110426215702_remove_avatar_fields_from_users.rb +0 -11
- data/rails_3_0/db/seeds.rb +0 -7
- data/rails_3_0/doc/README_FOR_APP +0 -2
- data/rails_3_0/public/404.html +0 -26
- data/rails_3_0/public/422.html +0 -26
- data/rails_3_0/public/500.html +0 -26
- data/rails_3_0/public/favicon.ico +0 -0
- data/rails_3_0/public/images/rails.png +0 -0
- data/rails_3_0/public/index.html +0 -239
- data/rails_3_0/public/javascripts/application.js +0 -2
- data/rails_3_0/public/javascripts/jquery-1.4.4.min.js +0 -167
- data/rails_3_0/public/javascripts/rails.js +0 -191
- data/rails_3_0/public/robots.txt +0 -5
- data/rails_3_0/public/stylesheets/admin.css +0 -3
- data/rails_3_0/public/stylesheets/scaffold.css +0 -54
- data/rails_3_0/script/rails +0 -6
- data/rails_3_0/test/data/ruby_throated.jpg +0 -0
- data/rails_3_0/test/data/tweenbot.jpg +0 -0
- data/rails_3_0/test/fixtures/placeholder.txt +0 -0
- data/rails_3_0/test/integration/admin/appointments2_integration_test.rb +0 -79
- data/rails_3_0/test/integration/admin/appointments_integration_test.rb +0 -367
- data/rails_3_0/test/integration/admin/blog_posts2_integration_test.rb +0 -789
- data/rails_3_0/test/integration/admin/blog_posts3_integration_test.rb +0 -418
- data/rails_3_0/test/integration/admin/blog_posts4_integration_test.rb +0 -189
- data/rails_3_0/test/integration/admin/blog_posts5_integration_test.rb +0 -75
- data/rails_3_0/test/integration/admin/blog_posts6_integration_test.rb +0 -39
- data/rails_3_0/test/integration/admin/blog_posts_custom_new_and_edit_integration_test.rb +0 -89
- data/rails_3_0/test/integration/admin/blog_posts_integration_test.rb +0 -776
- data/rails_3_0/test/integration/admin/blog_posts_read_only_integration_test.rb +0 -69
- data/rails_3_0/test/integration/admin/bookmarks_integration_test.rb +0 -445
- data/rails_3_0/test/integration/admin/comments2_integration_test.rb +0 -52
- data/rails_3_0/test/integration/admin/comments_integration_test.rb +0 -50
- data/rails_3_0/test/integration/admin/images2_integration_test.rb +0 -33
- data/rails_3_0/test/integration/admin/images_integration_test.rb +0 -79
- data/rails_3_0/test/integration/admin/misconfigured1_integration_test.rb +0 -21
- data/rails_3_0/test/integration/admin/product_categories2_integration_test.rb +0 -179
- data/rails_3_0/test/integration/admin/product_categories_integration_test.rb +0 -12
- data/rails_3_0/test/integration/admin/television_airings_integration_test.rb +0 -25
- data/rails_3_0/test/integration/admin/users2_integration_test.rb +0 -48
- data/rails_3_0/test/integration/admin/users_integration_test.rb +0 -182
- data/rails_3_0/test/integration/blog_posts_integration_test.rb +0 -10
- data/rails_3_0/test/performance/browsing_test.rb +0 -9
- data/rails_3_0/test/test_helper.rb +0 -138
- data/rails_3_1/Gemfile +0 -12
- data/rails_3_1/Gemfile.lock +0 -116
- data/rails_3_1/README +0 -256
- data/rails_3_1/Rakefile +0 -7
- data/rails_3_1/config.ru +0 -4
@@ -1,21 +0,0 @@
|
|
1
|
-
class Admin::BlogPosts4Controller < ApplicationController
|
2
|
-
layout 'admin'
|
3
|
-
|
4
|
-
admin_assistant_for BlogPost do |a|
|
5
|
-
a[:published_at].strftime_format = "%b %d, %Y %H:%M:%S"
|
6
|
-
|
7
|
-
a.index do |index|
|
8
|
-
index.columns :user, :title, :tags, :published_at, :textile
|
9
|
-
index.search :id, :title, :body, :textile, :user, :published_at
|
10
|
-
|
11
|
-
index.total_entries do
|
12
|
-
25
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
a.form do |form|
|
17
|
-
form.columns :title, :body, :textile, :published_at, :user, :virtual_text
|
18
|
-
form[:virtual_text].input = :text_area
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
class Admin::BlogPosts5Controller < ApplicationController
|
2
|
-
layout 'admin'
|
3
|
-
|
4
|
-
admin_assistant_for BlogPost do |a|
|
5
|
-
a.index do |index|
|
6
|
-
index.conditions do |params|
|
7
|
-
"user_id = #{params[:filter]}" unless params[:filter].blank?
|
8
|
-
end
|
9
|
-
|
10
|
-
index.columns :user, :title, :tags, :published_at, :textile
|
11
|
-
|
12
|
-
index.search.include_params_in_form = true
|
13
|
-
end
|
14
|
-
|
15
|
-
a.form.columns :user, :title, :title_alt
|
16
|
-
end
|
17
|
-
|
18
|
-
protected
|
19
|
-
|
20
|
-
def title_from_form(title_str, record_params)
|
21
|
-
if title_str.blank?
|
22
|
-
record_params[:title_alt]
|
23
|
-
else
|
24
|
-
title_str
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
class Admin::BlogPostsCustomNewAndEditController < ApplicationController
|
2
|
-
layout 'admin'
|
3
|
-
|
4
|
-
admin_assistant_for BlogPost do |a|
|
5
|
-
a.actions :index, :show, :destroy
|
6
|
-
end
|
7
|
-
|
8
|
-
def new
|
9
|
-
render :text => 'custom form for new'
|
10
|
-
end
|
11
|
-
|
12
|
-
def edit
|
13
|
-
render :text => 'custom form for edit'
|
14
|
-
end
|
15
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
class Admin::BlogPostsReadOnlyController < ApplicationController
|
2
|
-
layout 'admin'
|
3
|
-
|
4
|
-
admin_assistant_for BlogPost do |a|
|
5
|
-
a.model_class_name = 'blog post'
|
6
|
-
a.actions :index, :show
|
7
|
-
|
8
|
-
a.show do |show|
|
9
|
-
show.columns :user, :title, :body
|
10
|
-
show.model_class_name do |blog_post|
|
11
|
-
if blog_post.published?
|
12
|
-
'published blog post'
|
13
|
-
else
|
14
|
-
'unpublished blog post'
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
class Admin::BookmarksController < ApplicationController
|
2
|
-
layout 'admin'
|
3
|
-
|
4
|
-
admin_assistant_for Bookmark do |a|
|
5
|
-
a[:bookmarkable].polymorphic_types = [BlogPost, Comment, Product, User]
|
6
|
-
|
7
|
-
a.index.search :user, :bookmarkable
|
8
|
-
|
9
|
-
a.form[:user].select_options = {:include_blank => false}
|
10
|
-
end
|
11
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class Admin::Comments2Controller < ApplicationController
|
2
|
-
layout 'admin'
|
3
|
-
|
4
|
-
admin_assistant_for Comment do |a|
|
5
|
-
a.index do |index|
|
6
|
-
index.conditions 'blog_posts.published_at is not null'
|
7
|
-
index.include :blog_post
|
8
|
-
end
|
9
|
-
|
10
|
-
a.form do |form|
|
11
|
-
form[:comment].write_once
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
class Admin::CommentsController < ApplicationController
|
2
|
-
layout 'admin'
|
3
|
-
|
4
|
-
admin_assistant_for Comment do |a|
|
5
|
-
a.form[:comment].read_only
|
6
|
-
|
7
|
-
a.index do |index|
|
8
|
-
index.conditions "comment like '%smart%'"
|
9
|
-
index.search.default_search_matches_on << :id
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
class Admin::UsersController < ApplicationController
|
2
|
-
layout 'admin'
|
3
|
-
|
4
|
-
admin_assistant_for User do |a|
|
5
|
-
a.actions << :destroy
|
6
|
-
|
7
|
-
a[:state].input = :us_state
|
8
|
-
|
9
|
-
a.index do |index|
|
10
|
-
index.columns :id, :username, :password, :first_name, :last_name
|
11
|
-
index.right_column_links << lambda { |user|
|
12
|
-
[ "New blog post",
|
13
|
-
{ :controller => '/admin/blog_posts', :action => 'new',
|
14
|
-
:blog_post => {:user_id => user.id} } ]
|
15
|
-
}
|
16
|
-
index.search.default_search_matches_on(
|
17
|
-
:username, "users.first_name || ' ' || users.last_name"
|
18
|
-
)
|
19
|
-
end
|
20
|
-
|
21
|
-
a.form do |form|
|
22
|
-
form.columns :username, :password, :admin_level, :birthday, :state,
|
23
|
-
:force_blog_posts_to_textile, :first_name, :last_name
|
24
|
-
form[:admin_level].input = :select
|
25
|
-
form[:admin_level].select_choices = %w(normal admin superuser)
|
26
|
-
form[:admin_level].select_options = {:include_blank => false}
|
27
|
-
form[:birthday].date_select_options =
|
28
|
-
{:start_year => Time.now.year-100, :end_year => Time.now.year}
|
29
|
-
form[:force_blog_posts_to_textile].input = :select
|
30
|
-
form[:force_blog_posts_to_textile].select_options =
|
31
|
-
{:include_blank => true}
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
protected
|
36
|
-
|
37
|
-
# Run before a user is created
|
38
|
-
def before_create(user)
|
39
|
-
user.reset_password
|
40
|
-
end
|
41
|
-
|
42
|
-
# If 'reset_password' is checked, reset the password
|
43
|
-
def before_update(user)
|
44
|
-
if params[:reset_password]
|
45
|
-
user.reset_password
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module Admin::BlogPosts2Helper
|
2
|
-
def extra_right_column_links_for_index(blog_post)
|
3
|
-
link_to(
|
4
|
-
'New comment',
|
5
|
-
{
|
6
|
-
:controller => 'admin/comments', :action => 'new',
|
7
|
-
:comment => {:blog_post_id => blog_post.id}
|
8
|
-
}
|
9
|
-
)
|
10
|
-
end
|
11
|
-
|
12
|
-
def publish_value(blog_post)
|
13
|
-
blog_post.published?
|
14
|
-
end
|
15
|
-
|
16
|
-
def tags_string(blog_post)
|
17
|
-
blog_post.tags.map { |tag| tag.tag }.join ' '
|
18
|
-
end
|
19
|
-
|
20
|
-
def user_css_class_for_index_td(blog_post)
|
21
|
-
'custom_td_css_class'
|
22
|
-
end
|
23
|
-
|
24
|
-
def css_class_for_index_tr(blog_post)
|
25
|
-
'custom_tr_css_class'
|
26
|
-
end
|
27
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
module Admin::BlogPosts6Helper
|
2
|
-
def extra_right_column_links_for_index(blog_post)
|
3
|
-
case blog_post.title
|
4
|
-
when "return nil"
|
5
|
-
nil
|
6
|
-
else
|
7
|
-
link_to(
|
8
|
-
'New comment',
|
9
|
-
new_admin_comment_path(:comment => {:blog_post_id => blog_post.id})
|
10
|
-
)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module Admin::BlogPostsCustomNewAndEditHelper
|
2
|
-
def link_to_new_in_index?
|
3
|
-
param_triggering_link_suppression_present?
|
4
|
-
end
|
5
|
-
|
6
|
-
def link_to_search_in_index?
|
7
|
-
param_triggering_link_suppression_present?
|
8
|
-
end
|
9
|
-
|
10
|
-
def link_to_edit_in_index?(record)
|
11
|
-
param_triggering_link_suppression_present?
|
12
|
-
end
|
13
|
-
|
14
|
-
def link_to_delete_in_index?(record)
|
15
|
-
param_triggering_link_suppression_present?
|
16
|
-
end
|
17
|
-
|
18
|
-
def link_to_show_in_index?(record)
|
19
|
-
param_triggering_link_suppression_present?
|
20
|
-
end
|
21
|
-
|
22
|
-
def param_triggering_link_suppression_present?
|
23
|
-
if params[:flag_to_trigger_helper_methods]
|
24
|
-
false
|
25
|
-
else
|
26
|
-
true
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|