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.
- data/.gitmodules +3 -0
- data/app/views/admin/templates/_text_with_ckeditor.html.erb +13 -0
- data/lib/typus/version.rb +1 -1
- metadata +20 -272
- data/test/fixtures/rails_app/.gitignore +0 -4
- data/test/fixtures/rails_app/Capfile +0 -6
- data/test/fixtures/rails_app/README +0 -256
- data/test/fixtures/rails_app/Rakefile +0 -7
- data/test/fixtures/rails_app/app/controllers/admin/animals_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/articles_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/assets_controller.rb +0 -51
- data/test/fixtures/rails_app/app/controllers/admin/birds_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/cases_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/categories_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/comments_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/dogs_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/entries_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/hits_controller.rb +0 -37
- data/test/fixtures/rails_app/app/controllers/admin/image_holders_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/invoices_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/orders_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/pages_controller.rb +0 -7
- data/test/fixtures/rails_app/app/controllers/admin/posts_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/project_collaborators_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/projects_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/status_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/typus_users_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/users_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/views_controller.rb +0 -8
- data/test/fixtures/rails_app/app/controllers/admin/watch_dog_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin_user.rb +0 -3
- data/test/fixtures/rails_app/app/controllers/application_controller.rb +0 -3
- data/test/fixtures/rails_app/app/helpers/application_helper.rb +0 -2
- data/test/fixtures/rails_app/app/helpers/form_helper.rb +0 -3
- data/test/fixtures/rails_app/app/models/animal.rb +0 -21
- data/test/fixtures/rails_app/app/models/article.rb +0 -10
- data/test/fixtures/rails_app/app/models/asset.rb +0 -45
- data/test/fixtures/rails_app/app/models/bird.rb +0 -2
- data/test/fixtures/rails_app/app/models/case.rb +0 -2
- data/test/fixtures/rails_app/app/models/category.rb +0 -31
- data/test/fixtures/rails_app/app/models/comment.rb +0 -17
- data/test/fixtures/rails_app/app/models/delayed/task.rb +0 -5
- data/test/fixtures/rails_app/app/models/dog.rb +0 -2
- data/test/fixtures/rails_app/app/models/entry.rb +0 -23
- data/test/fixtures/rails_app/app/models/hit.rb +0 -27
- data/test/fixtures/rails_app/app/models/image_holder.rb +0 -21
- data/test/fixtures/rails_app/app/models/invoice.rb +0 -10
- data/test/fixtures/rails_app/app/models/order.rb +0 -9
- data/test/fixtures/rails_app/app/models/page.rb +0 -24
- data/test/fixtures/rails_app/app/models/post.rb +0 -32
- data/test/fixtures/rails_app/app/models/project.rb +0 -17
- data/test/fixtures/rails_app/app/models/project_collaborator.rb +0 -16
- data/test/fixtures/rails_app/app/models/site.rb +0 -16
- data/test/fixtures/rails_app/app/models/typus_user.rb +0 -22
- data/test/fixtures/rails_app/app/models/user.rb +0 -10
- data/test/fixtures/rails_app/app/models/view.rb +0 -19
- data/test/fixtures/rails_app/app/views/admin/assets/_index.html.erb +0 -3
- data/test/fixtures/rails_app/app/views/admin/cases/_index.html.erb +0 -3
- data/test/fixtures/rails_app/app/views/admin/categories/_index.html.erb +0 -3
- data/test/fixtures/rails_app/app/views/admin/dashboard/_sidebar.html.erb +0 -11
- data/test/fixtures/rails_app/app/views/admin/entries/_index.html.erb +0 -3
- data/test/fixtures/rails_app/app/views/admin/hits/_edit.html.erb +0 -7
- data/test/fixtures/rails_app/app/views/admin/hits/_index.html.erb +0 -3
- data/test/fixtures/rails_app/app/views/admin/hits/index.html.erb +0 -28
- data/test/fixtures/rails_app/app/views/admin/pages/_index.html.erb +0 -3
- data/test/fixtures/rails_app/app/views/admin/posts/_edit.html.erb +0 -1
- data/test/fixtures/rails_app/app/views/admin/posts/_index.html.erb +0 -5
- data/test/fixtures/rails_app/app/views/admin/posts/_new.html.erb +0 -1
- data/test/fixtures/rails_app/app/views/admin/posts/_show.html.erb +0 -1
- data/test/fixtures/rails_app/app/views/admin/resources/_sidebar.html.erb +0 -1
- data/test/fixtures/rails_app/app/views/admin/status/index.html.erb +0 -9
- data/test/fixtures/rails_app/app/views/admin/templates/_datepicker.html.erb +0 -1
- data/test/fixtures/rails_app/app/views/admin/watch_dog/index.html.erb +0 -9
- data/test/fixtures/rails_app/config.ru +0 -4
- data/test/fixtures/rails_app/config/application.rb +0 -44
- data/test/fixtures/rails_app/config/boot.rb +0 -6
- data/test/fixtures/rails_app/config/database.yml +0 -34
- data/test/fixtures/rails_app/config/deploy.rb +0 -32
- data/test/fixtures/rails_app/config/environment.rb +0 -5
- data/test/fixtures/rails_app/config/environments/development.rb +0 -32
- data/test/fixtures/rails_app/config/environments/production.rb +0 -54
- data/test/fixtures/rails_app/config/environments/test.rb +0 -40
- data/test/fixtures/rails_app/config/initializers/backtrace_silencers.rb +0 -7
- data/test/fixtures/rails_app/config/initializers/dragonfly.rb +0 -1
- data/test/fixtures/rails_app/config/initializers/inflections.rb +0 -12
- data/test/fixtures/rails_app/config/initializers/mime_types.rb +0 -5
- data/test/fixtures/rails_app/config/initializers/secret_token.rb +0 -7
- data/test/fixtures/rails_app/config/initializers/session_store.rb +0 -8
- data/test/fixtures/rails_app/config/initializers/typus.rb +0 -5
- data/test/fixtures/rails_app/config/initializers/typus_resources.rb +0 -27
- data/test/fixtures/rails_app/config/locales/en.yml +0 -5
- data/test/fixtures/rails_app/config/mongoid.yml +0 -20
- data/test/fixtures/rails_app/config/routes.rb +0 -61
- data/test/fixtures/rails_app/config/typus/README +0 -68
- data/test/fixtures/rails_app/config/typus/crud_basic.yml +0 -10
- data/test/fixtures/rails_app/config/typus/crud_basic_roles.yml +0 -2
- data/test/fixtures/rails_app/config/typus/crud_extended.yml +0 -66
- data/test/fixtures/rails_app/config/typus/crud_extended_roles.yml +0 -18
- data/test/fixtures/rails_app/config/typus/has_many.yml +0 -0
- data/test/fixtures/rails_app/config/typus/has_many_roles.yml +0 -0
- data/test/fixtures/rails_app/config/typus/has_many_through.yml +0 -23
- data/test/fixtures/rails_app/config/typus/has_many_through_roles.yml +0 -4
- data/test/fixtures/rails_app/config/typus/has_one.yml +0 -12
- data/test/fixtures/rails_app/config/typus/has_one_roles.yml +0 -3
- data/test/fixtures/rails_app/config/typus/mongo_db.yml +0 -4
- data/test/fixtures/rails_app/config/typus/mongo_db_roles.yml +0 -2
- data/test/fixtures/rails_app/config/typus/polymorphic.yml +0 -17
- data/test/fixtures/rails_app/config/typus/polymorphic_roles.yml +0 -5
- data/test/fixtures/rails_app/config/typus/resource_roles.yml +0 -7
- data/test/fixtures/rails_app/config/typus/sti.yml +0 -5
- data/test/fixtures/rails_app/config/typus/sti_roles.yml +0 -2
- data/test/fixtures/rails_app/config/typus/typus.yml +0 -13
- data/test/fixtures/rails_app/config/typus/typus_roles.yml +0 -2
- data/test/fixtures/rails_app/config/typus/unknown.yml +0 -3
- data/test/fixtures/rails_app/config/typus/unknown_roles.yml +0 -5
- data/test/fixtures/rails_app/db/.gitkeep +0 -0
- data/test/fixtures/rails_app/db/schema.rb +0 -200
- data/test/fixtures/rails_app/db/seeds.rb +0 -54
- data/test/fixtures/rails_app/db/seeds/assets/000.jpg +0 -0
- data/test/fixtures/rails_app/db/seeds/assets/001.jpg +0 -0
- data/test/fixtures/rails_app/db/seeds/assets/002.jpg +0 -0
- data/test/fixtures/rails_app/db/seeds/assets/003.jpg +0 -0
- data/test/fixtures/rails_app/db/seeds/assets/004.jpg +0 -0
- data/test/fixtures/rails_app/public/404.html +0 -26
- data/test/fixtures/rails_app/public/422.html +0 -26
- data/test/fixtures/rails_app/public/500.html +0 -26
- data/test/fixtures/rails_app/public/favicon.ico +0 -0
- data/test/fixtures/rails_app/public/images/rails.png +0 -0
- data/test/fixtures/rails_app/public/robots.txt +0 -5
- data/test/fixtures/rails_app/public/stylesheets/.gitkeep +0 -0
- 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,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,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,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,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,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,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
|