typus 3.0.11.rc5 → 3.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. data/.gitmodules +3 -0
  2. data/app/views/admin/templates/_text_with_ckeditor.html.erb +13 -0
  3. data/lib/typus/version.rb +1 -1
  4. metadata +20 -272
  5. data/test/fixtures/rails_app/.gitignore +0 -4
  6. data/test/fixtures/rails_app/Capfile +0 -6
  7. data/test/fixtures/rails_app/README +0 -256
  8. data/test/fixtures/rails_app/Rakefile +0 -7
  9. data/test/fixtures/rails_app/app/controllers/admin/animals_controller.rb +0 -2
  10. data/test/fixtures/rails_app/app/controllers/admin/articles_controller.rb +0 -2
  11. data/test/fixtures/rails_app/app/controllers/admin/assets_controller.rb +0 -51
  12. data/test/fixtures/rails_app/app/controllers/admin/birds_controller.rb +0 -2
  13. data/test/fixtures/rails_app/app/controllers/admin/cases_controller.rb +0 -2
  14. data/test/fixtures/rails_app/app/controllers/admin/categories_controller.rb +0 -2
  15. data/test/fixtures/rails_app/app/controllers/admin/comments_controller.rb +0 -2
  16. data/test/fixtures/rails_app/app/controllers/admin/dogs_controller.rb +0 -2
  17. data/test/fixtures/rails_app/app/controllers/admin/entries_controller.rb +0 -2
  18. data/test/fixtures/rails_app/app/controllers/admin/hits_controller.rb +0 -37
  19. data/test/fixtures/rails_app/app/controllers/admin/image_holders_controller.rb +0 -2
  20. data/test/fixtures/rails_app/app/controllers/admin/invoices_controller.rb +0 -2
  21. data/test/fixtures/rails_app/app/controllers/admin/orders_controller.rb +0 -2
  22. data/test/fixtures/rails_app/app/controllers/admin/pages_controller.rb +0 -7
  23. data/test/fixtures/rails_app/app/controllers/admin/posts_controller.rb +0 -2
  24. data/test/fixtures/rails_app/app/controllers/admin/project_collaborators_controller.rb +0 -2
  25. data/test/fixtures/rails_app/app/controllers/admin/projects_controller.rb +0 -2
  26. data/test/fixtures/rails_app/app/controllers/admin/status_controller.rb +0 -2
  27. data/test/fixtures/rails_app/app/controllers/admin/typus_users_controller.rb +0 -2
  28. data/test/fixtures/rails_app/app/controllers/admin/users_controller.rb +0 -2
  29. data/test/fixtures/rails_app/app/controllers/admin/views_controller.rb +0 -8
  30. data/test/fixtures/rails_app/app/controllers/admin/watch_dog_controller.rb +0 -2
  31. data/test/fixtures/rails_app/app/controllers/admin_user.rb +0 -3
  32. data/test/fixtures/rails_app/app/controllers/application_controller.rb +0 -3
  33. data/test/fixtures/rails_app/app/helpers/application_helper.rb +0 -2
  34. data/test/fixtures/rails_app/app/helpers/form_helper.rb +0 -3
  35. data/test/fixtures/rails_app/app/models/animal.rb +0 -21
  36. data/test/fixtures/rails_app/app/models/article.rb +0 -10
  37. data/test/fixtures/rails_app/app/models/asset.rb +0 -45
  38. data/test/fixtures/rails_app/app/models/bird.rb +0 -2
  39. data/test/fixtures/rails_app/app/models/case.rb +0 -2
  40. data/test/fixtures/rails_app/app/models/category.rb +0 -31
  41. data/test/fixtures/rails_app/app/models/comment.rb +0 -17
  42. data/test/fixtures/rails_app/app/models/delayed/task.rb +0 -5
  43. data/test/fixtures/rails_app/app/models/dog.rb +0 -2
  44. data/test/fixtures/rails_app/app/models/entry.rb +0 -23
  45. data/test/fixtures/rails_app/app/models/hit.rb +0 -27
  46. data/test/fixtures/rails_app/app/models/image_holder.rb +0 -21
  47. data/test/fixtures/rails_app/app/models/invoice.rb +0 -10
  48. data/test/fixtures/rails_app/app/models/order.rb +0 -9
  49. data/test/fixtures/rails_app/app/models/page.rb +0 -24
  50. data/test/fixtures/rails_app/app/models/post.rb +0 -32
  51. data/test/fixtures/rails_app/app/models/project.rb +0 -17
  52. data/test/fixtures/rails_app/app/models/project_collaborator.rb +0 -16
  53. data/test/fixtures/rails_app/app/models/site.rb +0 -16
  54. data/test/fixtures/rails_app/app/models/typus_user.rb +0 -22
  55. data/test/fixtures/rails_app/app/models/user.rb +0 -10
  56. data/test/fixtures/rails_app/app/models/view.rb +0 -19
  57. data/test/fixtures/rails_app/app/views/admin/assets/_index.html.erb +0 -3
  58. data/test/fixtures/rails_app/app/views/admin/cases/_index.html.erb +0 -3
  59. data/test/fixtures/rails_app/app/views/admin/categories/_index.html.erb +0 -3
  60. data/test/fixtures/rails_app/app/views/admin/dashboard/_sidebar.html.erb +0 -11
  61. data/test/fixtures/rails_app/app/views/admin/entries/_index.html.erb +0 -3
  62. data/test/fixtures/rails_app/app/views/admin/hits/_edit.html.erb +0 -7
  63. data/test/fixtures/rails_app/app/views/admin/hits/_index.html.erb +0 -3
  64. data/test/fixtures/rails_app/app/views/admin/hits/index.html.erb +0 -28
  65. data/test/fixtures/rails_app/app/views/admin/pages/_index.html.erb +0 -3
  66. data/test/fixtures/rails_app/app/views/admin/posts/_edit.html.erb +0 -1
  67. data/test/fixtures/rails_app/app/views/admin/posts/_index.html.erb +0 -5
  68. data/test/fixtures/rails_app/app/views/admin/posts/_new.html.erb +0 -1
  69. data/test/fixtures/rails_app/app/views/admin/posts/_show.html.erb +0 -1
  70. data/test/fixtures/rails_app/app/views/admin/resources/_sidebar.html.erb +0 -1
  71. data/test/fixtures/rails_app/app/views/admin/status/index.html.erb +0 -9
  72. data/test/fixtures/rails_app/app/views/admin/templates/_datepicker.html.erb +0 -1
  73. data/test/fixtures/rails_app/app/views/admin/watch_dog/index.html.erb +0 -9
  74. data/test/fixtures/rails_app/config.ru +0 -4
  75. data/test/fixtures/rails_app/config/application.rb +0 -44
  76. data/test/fixtures/rails_app/config/boot.rb +0 -6
  77. data/test/fixtures/rails_app/config/database.yml +0 -34
  78. data/test/fixtures/rails_app/config/deploy.rb +0 -32
  79. data/test/fixtures/rails_app/config/environment.rb +0 -5
  80. data/test/fixtures/rails_app/config/environments/development.rb +0 -32
  81. data/test/fixtures/rails_app/config/environments/production.rb +0 -54
  82. data/test/fixtures/rails_app/config/environments/test.rb +0 -40
  83. data/test/fixtures/rails_app/config/initializers/backtrace_silencers.rb +0 -7
  84. data/test/fixtures/rails_app/config/initializers/dragonfly.rb +0 -1
  85. data/test/fixtures/rails_app/config/initializers/inflections.rb +0 -12
  86. data/test/fixtures/rails_app/config/initializers/mime_types.rb +0 -5
  87. data/test/fixtures/rails_app/config/initializers/secret_token.rb +0 -7
  88. data/test/fixtures/rails_app/config/initializers/session_store.rb +0 -8
  89. data/test/fixtures/rails_app/config/initializers/typus.rb +0 -5
  90. data/test/fixtures/rails_app/config/initializers/typus_resources.rb +0 -27
  91. data/test/fixtures/rails_app/config/locales/en.yml +0 -5
  92. data/test/fixtures/rails_app/config/mongoid.yml +0 -20
  93. data/test/fixtures/rails_app/config/routes.rb +0 -61
  94. data/test/fixtures/rails_app/config/typus/README +0 -68
  95. data/test/fixtures/rails_app/config/typus/crud_basic.yml +0 -10
  96. data/test/fixtures/rails_app/config/typus/crud_basic_roles.yml +0 -2
  97. data/test/fixtures/rails_app/config/typus/crud_extended.yml +0 -66
  98. data/test/fixtures/rails_app/config/typus/crud_extended_roles.yml +0 -18
  99. data/test/fixtures/rails_app/config/typus/has_many.yml +0 -0
  100. data/test/fixtures/rails_app/config/typus/has_many_roles.yml +0 -0
  101. data/test/fixtures/rails_app/config/typus/has_many_through.yml +0 -23
  102. data/test/fixtures/rails_app/config/typus/has_many_through_roles.yml +0 -4
  103. data/test/fixtures/rails_app/config/typus/has_one.yml +0 -12
  104. data/test/fixtures/rails_app/config/typus/has_one_roles.yml +0 -3
  105. data/test/fixtures/rails_app/config/typus/mongo_db.yml +0 -4
  106. data/test/fixtures/rails_app/config/typus/mongo_db_roles.yml +0 -2
  107. data/test/fixtures/rails_app/config/typus/polymorphic.yml +0 -17
  108. data/test/fixtures/rails_app/config/typus/polymorphic_roles.yml +0 -5
  109. data/test/fixtures/rails_app/config/typus/resource_roles.yml +0 -7
  110. data/test/fixtures/rails_app/config/typus/sti.yml +0 -5
  111. data/test/fixtures/rails_app/config/typus/sti_roles.yml +0 -2
  112. data/test/fixtures/rails_app/config/typus/typus.yml +0 -13
  113. data/test/fixtures/rails_app/config/typus/typus_roles.yml +0 -2
  114. data/test/fixtures/rails_app/config/typus/unknown.yml +0 -3
  115. data/test/fixtures/rails_app/config/typus/unknown_roles.yml +0 -5
  116. data/test/fixtures/rails_app/db/.gitkeep +0 -0
  117. data/test/fixtures/rails_app/db/schema.rb +0 -200
  118. data/test/fixtures/rails_app/db/seeds.rb +0 -54
  119. data/test/fixtures/rails_app/db/seeds/assets/000.jpg +0 -0
  120. data/test/fixtures/rails_app/db/seeds/assets/001.jpg +0 -0
  121. data/test/fixtures/rails_app/db/seeds/assets/002.jpg +0 -0
  122. data/test/fixtures/rails_app/db/seeds/assets/003.jpg +0 -0
  123. data/test/fixtures/rails_app/db/seeds/assets/004.jpg +0 -0
  124. data/test/fixtures/rails_app/public/404.html +0 -26
  125. data/test/fixtures/rails_app/public/422.html +0 -26
  126. data/test/fixtures/rails_app/public/500.html +0 -26
  127. data/test/fixtures/rails_app/public/favicon.ico +0 -0
  128. data/test/fixtures/rails_app/public/images/rails.png +0 -0
  129. data/test/fixtures/rails_app/public/robots.txt +0 -5
  130. data/test/fixtures/rails_app/public/stylesheets/.gitkeep +0 -0
  131. data/test/fixtures/rails_app/script/rails +0 -6
@@ -1,7 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require File.expand_path('../config/application', __FILE__)
5
- require 'rake'
6
-
7
- RailsApp::Application.load_tasks
@@ -1,2 +0,0 @@
1
- class Admin::AnimalsController < Admin::ResourcesController
2
- end
@@ -1,2 +0,0 @@
1
- class Admin::ArticlesController < Admin::ResourcesController
2
- end
@@ -1,51 +0,0 @@
1
- class Admin::AssetsController < Admin::ResourcesController
2
-
3
- layout :set_layout
4
-
5
- def index
6
- if params[:layout]
7
- add_resources_action("Add new", {:action => "new"}, {})
8
- end
9
-
10
- super
11
- end
12
-
13
- def new
14
- if params[:layout]
15
- add_resources_action("Back to list", {:action => "index", :id => nil}, {})
16
- end
17
-
18
- super
19
- end
20
-
21
- def create
22
- if params[:layout]
23
- add_resources_action("Back to list", {:action => "index", :id => nil}, {})
24
- end
25
-
26
- super
27
- end
28
-
29
- def edit
30
- if params[:layout]
31
- add_resources_action("Back to list", {:action => "index", :id => nil}, {})
32
- end
33
-
34
- super
35
- end
36
-
37
- def update
38
- if params[:layout]
39
- add_resources_action("Back to list", {:action => "index", :id => nil}, {})
40
- end
41
-
42
- super
43
- end
44
-
45
- private
46
-
47
- def set_layout
48
- params[:layout] || "admin/base"
49
- end
50
-
51
- end
@@ -1,2 +0,0 @@
1
- class Admin::BirdsController < Admin::ResourcesController
2
- end
@@ -1,2 +0,0 @@
1
- class Admin::CasesController < Admin::ResourcesController
2
- end
@@ -1,2 +0,0 @@
1
- class Admin::CategoriesController < Admin::ResourcesController
2
- end
@@ -1,2 +0,0 @@
1
- class Admin::CommentsController < Admin::ResourcesController
2
- end
@@ -1,2 +0,0 @@
1
- class Admin::DogsController < Admin::ResourcesController
2
- end
@@ -1,2 +0,0 @@
1
- class Admin::EntriesController < Admin::ResourcesController
2
- end
@@ -1,37 +0,0 @@
1
- class Admin::HitsController < Admin::ResourcesController
2
-
3
- def index
4
- @items = Hit.paginate(:per_page => 15, :page => params[:page])
5
- add_resource_action("Edit", {:action => 'edit'}, {})
6
- add_resource_action("Trash", {:action => "destroy"}, {:confirm => "#{Typus::I18n.t("Trash")}?", :method => 'delete'})
7
- end
8
-
9
- def new
10
- @item = Hit.new
11
- end
12
-
13
- def create
14
- @item = Hit.new(params[:hit])
15
- if @item.save
16
- flash[:notice] = Typus::I18n::t("Hit was successfully created.")
17
- redirect_to :action => 'edit', :id => @item.id
18
- else
19
- render :action => 'new'
20
- end
21
- end
22
-
23
- def edit
24
- @item = Hit.find(params[:id])
25
- end
26
-
27
- def update
28
- @item = Hit.find(params[:id])
29
- if @item.update_attributes(params[:entry])
30
- flash[:notice] = Typus::I18n::t("Hit was successfully updated.")
31
- redirect_to :action => 'edit', :id => @item.id
32
- else
33
- render :action => "edit"
34
- end
35
- end
36
-
37
- end
@@ -1,2 +0,0 @@
1
- class Admin::ImageHoldersController < Admin::ResourcesController
2
- end
@@ -1,2 +0,0 @@
1
- class Admin::InvoicesController < Admin::ResourcesController
2
- end
@@ -1,2 +0,0 @@
1
- class Admin::OrdersController < Admin::ResourcesController
2
- end
@@ -1,7 +0,0 @@
1
- class Admin::PagesController < Admin::ResourcesController
2
-
3
- def rebuild_all
4
- redirect_to :back, :notice => "Entries have been rebuilt."
5
- end
6
-
7
- end
@@ -1,2 +0,0 @@
1
- class Admin::PostsController < Admin::ResourcesController
2
- end
@@ -1,2 +0,0 @@
1
- class Admin::ProjectCollaboratorsController < Admin::ResourcesController
2
- end
@@ -1,2 +0,0 @@
1
- class Admin::ProjectsController < Admin::ResourcesController
2
- end
@@ -1,2 +0,0 @@
1
- class Admin::StatusController < Admin::ResourceController
2
- end
@@ -1,2 +0,0 @@
1
- class Admin::TypusUsersController < Admin::ResourcesController
2
- end
@@ -1,2 +0,0 @@
1
- class Admin::UsersController < Admin::ResourcesController
2
- end
@@ -1,8 +0,0 @@
1
- class Admin::ViewsController < Admin::ResourcesController
2
-
3
- def set_context
4
- @resource = Site.find_by_domain(request.host).send(@object_name.pluralize)
5
- end
6
- private :set_context
7
-
8
- end
@@ -1,2 +0,0 @@
1
- class Admin::WatchDogController < Admin::ResourceController
2
- end
@@ -1,3 +0,0 @@
1
- class AdminUser < ActiveRecord::Base
2
- has_admin
3
- end
@@ -1,3 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- protect_from_forgery
3
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,3 +0,0 @@
1
- # Leave this here to make sure we do not use application FormHelper in Typus.
2
- module FormHelper
3
- end
@@ -1,21 +0,0 @@
1
- =begin
2
-
3
- This model is used to test polymorphic associations.
4
-
5
- =end
6
-
7
- class Animal < ActiveRecord::Base
8
-
9
- ##
10
- # Validations
11
- #
12
-
13
- validates :name, :presence => true
14
-
15
- ##
16
- # Associations
17
- #
18
-
19
- has_many :image_holders, :as => :imageable
20
-
21
- end
@@ -1,10 +0,0 @@
1
- =begin
2
-
3
- This model is not enabled in typus but is used to test things things like:
4
-
5
- - Article.read_model_config
6
-
7
- =end
8
-
9
- class Article < ActiveRecord::Base
10
- end
@@ -1,45 +0,0 @@
1
- =begin
2
-
3
- This model is used to test:
4
-
5
- - Dragonfly Attachments
6
- - Paperclip Attachments
7
-
8
- =end
9
-
10
- class Asset < ActiveRecord::Base
11
-
12
- ##
13
- # Dragonfly Stuff
14
- #
15
-
16
- if defined?(Dragonfly)
17
-
18
- image_accessor :dragonfly
19
-
20
- image_accessor :dragonfly_required
21
- validates :dragonfly_required, :presence => true
22
-
23
- end
24
-
25
- ##
26
- # Paperclip Stuff
27
- #
28
-
29
- if defined?(Paperclip)
30
-
31
- has_attached_file :paperclip, :styles => { :medium => "300x300>", :thumb => "100x100>" }
32
-
33
- has_attached_file :paperclip_required, :styles => { :medium => "300x300>", :thumb => "100x100>" }
34
- validates_attachment_presence :paperclip_required
35
-
36
- end
37
-
38
- ##
39
- # Instance Methods
40
- #
41
-
42
- def original_file_name
43
- end
44
-
45
- end
@@ -1,2 +0,0 @@
1
- class Bird < Animal
2
- end
@@ -1,2 +0,0 @@
1
- class Case < Entry
2
- end
@@ -1,31 +0,0 @@
1
- =begin
2
-
3
- This model is used to test:
4
-
5
- - ActsAsList on resources_controller
6
- - Relate and unrelate for has_and_belongs_to_many.
7
-
8
- =end
9
-
10
- class Category < ActiveRecord::Base
11
-
12
- ##
13
- # Mixins
14
- #
15
-
16
- acts_as_list
17
-
18
- ##
19
- # Validations
20
- #
21
-
22
- validates :name, :presence => true
23
-
24
- ##
25
- # Associations
26
- #
27
-
28
- has_and_belongs_to_many :entries
29
- has_and_belongs_to_many :posts
30
-
31
- end
@@ -1,17 +0,0 @@
1
- class Comment < ActiveRecord::Base
2
-
3
- ##
4
- # Validations
5
- #
6
-
7
- validates :email, :presence => true
8
- validates :body, :presence => true
9
- validates :name, :presence => true
10
-
11
- ##
12
- # Associations
13
- #
14
-
15
- belongs_to :post
16
-
17
- end
@@ -1,5 +0,0 @@
1
- class Delayed::Task < ActiveRecord::Base
2
-
3
- set_table_name "delayed_tasks"
4
-
5
- end
@@ -1,2 +0,0 @@
1
- class Dog < Animal
2
- end
@@ -1,23 +0,0 @@
1
- =begin
2
-
3
- This model is not enabled in typus but is used to test things things like:
4
-
5
- - Single Table Inheritance
6
-
7
- =end
8
-
9
- class Entry < ActiveRecord::Base
10
-
11
- ##
12
- # Validations
13
- #
14
-
15
- validates :title, :presence => true
16
-
17
- ##
18
- # Associations
19
- #
20
-
21
- has_and_belongs_to_many :categories
22
-
23
- end
@@ -1,27 +0,0 @@
1
- require "typus/orm/mongo/class_methods"
2
-
3
- class Hit
4
-
5
- extend Typus::Orm::Mongo::ClassMethods
6
-
7
- if defined?(Mongoid)
8
- include Mongoid::Document
9
-
10
- field :name
11
- field :description
12
-
13
- validates_presence_of :name
14
- validates_uniqueness_of :name
15
- else
16
- extend ActiveModel::Naming
17
- end
18
-
19
- def self.typus_fields_for(*args)
20
- [[:name, :string], [:description, :text]]
21
- end
22
-
23
- def self.model_fields
24
- [[:name, :string], [:description, :text]]
25
- end
26
-
27
- end
@@ -1,21 +0,0 @@
1
- =begin
2
-
3
- This model is used to test polymorphic associations.
4
-
5
- =end
6
-
7
- class ImageHolder < ActiveRecord::Base
8
-
9
- ##
10
- # Validations
11
- #
12
-
13
- validates :name, :presence => true
14
-
15
- ##
16
- # Associations
17
- #
18
-
19
- belongs_to :imageable, :polymorphic => true
20
-
21
- end
@@ -1,10 +0,0 @@
1
- class Invoice < ActiveRecord::Base
2
-
3
- ##
4
- # Associations
5
- #
6
-
7
- belongs_to :order
8
- belongs_to :typus_user
9
-
10
- end