netzke-workspace 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +12 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +58 -0
  6. data/Rakefile +1 -0
  7. data/lib/netzke-workspace.rb +7 -0
  8. data/lib/netzke/workspace.rb +8 -0
  9. data/lib/netzke/workspace/tab_panel.rb +61 -0
  10. data/lib/netzke/workspace/tab_panel/javascripts/tab_panel.js +108 -0
  11. data/lib/netzke/workspace/version.rb +5 -0
  12. data/netzke-workspace.gemspec +31 -0
  13. data/spec/features/javascripts/secure_tab_panel_spec.js.coffee +6 -0
  14. data/spec/features/javascripts/some_tab_panel_spec.js.coffee +15 -0
  15. data/spec/features/javascripts/tab_panel_with_dashboard_spec.js.coffee +9 -0
  16. data/spec/features/netzke_mocha_spec.rb +20 -0
  17. data/spec/features/workspace_spec.rb +5 -0
  18. data/spec/integration +0 -0
  19. data/spec/rails_app/README.rdoc +28 -0
  20. data/spec/rails_app/Rakefile +6 -0
  21. data/spec/rails_app/app/assets/images/.keep +0 -0
  22. data/spec/rails_app/app/assets/javascripts/application.js +13 -0
  23. data/spec/rails_app/app/assets/stylesheets/application.css +13 -0
  24. data/spec/rails_app/app/components/hello_user.rb +29 -0
  25. data/spec/rails_app/app/components/secure_tab_panel.rb +12 -0
  26. data/spec/rails_app/app/components/some_tab_panel.rb +37 -0
  27. data/spec/rails_app/app/components/tab_panel_with_dashboard.rb +12 -0
  28. data/spec/rails_app/app/controllers/application_controller.rb +5 -0
  29. data/spec/rails_app/app/controllers/concerns/.keep +0 -0
  30. data/spec/rails_app/app/helpers/application_helper.rb +2 -0
  31. data/spec/rails_app/app/mailers/.keep +0 -0
  32. data/spec/rails_app/app/models/.keep +0 -0
  33. data/spec/rails_app/app/models/concerns/.keep +0 -0
  34. data/spec/rails_app/app/views/layouts/application.html.erb +14 -0
  35. data/spec/rails_app/bin/bundle +3 -0
  36. data/spec/rails_app/bin/rails +4 -0
  37. data/spec/rails_app/bin/rake +4 -0
  38. data/spec/rails_app/config.ru +4 -0
  39. data/spec/rails_app/config/application.rb +31 -0
  40. data/spec/rails_app/config/boot.rb +4 -0
  41. data/spec/rails_app/config/database.yml +25 -0
  42. data/spec/rails_app/config/environment.rb +5 -0
  43. data/spec/rails_app/config/environments/development.rb +29 -0
  44. data/spec/rails_app/config/environments/production.rb +80 -0
  45. data/spec/rails_app/config/environments/test.rb +36 -0
  46. data/spec/rails_app/config/initializers/backtrace_silencers.rb +7 -0
  47. data/spec/rails_app/config/initializers/filter_parameter_logging.rb +4 -0
  48. data/spec/rails_app/config/initializers/inflections.rb +16 -0
  49. data/spec/rails_app/config/initializers/mime_types.rb +5 -0
  50. data/spec/rails_app/config/initializers/netzke_testing.rb +3 -0
  51. data/spec/rails_app/config/initializers/secret_token.rb +12 -0
  52. data/spec/rails_app/config/initializers/session_store.rb +3 -0
  53. data/spec/rails_app/config/initializers/wrap_parameters.rb +14 -0
  54. data/spec/rails_app/config/locales/en.yml +2 -0
  55. data/spec/rails_app/config/locales/es.yml +19 -0
  56. data/spec/rails_app/config/routes.rb +3 -0
  57. data/spec/rails_app/db/development.sqlite3 +0 -0
  58. data/spec/rails_app/db/development_structure.sql +88 -0
  59. data/spec/rails_app/db/migrate/20100914104207_create_users.rb +15 -0
  60. data/spec/rails_app/db/migrate/20100914104236_create_roles.rb +13 -0
  61. data/spec/rails_app/db/migrate/20101026185816_create_authors.rb +14 -0
  62. data/spec/rails_app/db/migrate/20101026190021_create_books.rb +22 -0
  63. data/spec/rails_app/db/migrate/20110101143818_create_addresses.rb +17 -0
  64. data/spec/rails_app/db/migrate/20110701070052_create_book_with_custom_primary_keys.rb +15 -0
  65. data/spec/rails_app/db/migrate/20110901114016_add_last_read_at_to_books.rb +9 -0
  66. data/spec/rails_app/db/migrate/20110909071740_add_published_on_to_books.rb +5 -0
  67. data/spec/rails_app/db/migrate/20130105145110_create_issues.rb +12 -0
  68. data/spec/rails_app/db/migrate/20130105145156_create_projects.rb +9 -0
  69. data/spec/rails_app/db/migrate/20130105145231_create_developers.rb +8 -0
  70. data/spec/rails_app/db/migrate/20130105145239_create_statuses.rb +8 -0
  71. data/spec/rails_app/db/schema.rb +97 -0
  72. data/spec/rails_app/db/seeds.rb +7 -0
  73. data/spec/rails_app/db/test.sqlite3 +0 -0
  74. data/spec/rails_app/lib/assets/.keep +0 -0
  75. data/spec/rails_app/lib/tasks/.keep +0 -0
  76. data/spec/rails_app/log/.keep +0 -0
  77. data/spec/rails_app/public/404.html +58 -0
  78. data/spec/rails_app/public/422.html +58 -0
  79. data/spec/rails_app/public/500.html +57 -0
  80. data/spec/rails_app/public/favicon.ico +0 -0
  81. data/spec/rails_app/public/robots.txt +5 -0
  82. data/spec/rails_app/public/uploads/foo.png +0 -0
  83. data/spec/rails_app/vendor/assets/javascripts/.keep +0 -0
  84. data/spec/rails_app/vendor/assets/stylesheets/.keep +0 -0
  85. data/spec/spec_helper.rb +38 -0
  86. data/spec/support/database_cleaner.rb +21 -0
  87. data/spec/support/helpers.rb +44 -0
  88. metadata +318 -0
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,3 @@
1
+ Netzke::Testing.setup do |config|
2
+ config.spec_root = File.expand_path("../../../../..", __FILE__)
3
+ end
@@ -0,0 +1,12 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure your secret_key_base is kept private
11
+ # if you're sharing your code publicly.
12
+ RailsApp::Application.config.secret_key_base = 'bf0ce54e318ce934b987855709b7eb2038f1c29a7142c07ae18651ec0c9163594a466666a2ec9ae8f332853f8c8ed20079bbc740314263d92bbf2a35b9cf0e64'
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ RailsApp::Application.config.session_store :cookie_store, key: '_rails_app_session'
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,2 @@
1
+ en:
2
+ books: Books
@@ -0,0 +1,19 @@
1
+ es:
2
+ books: Libros
3
+ activerecord:
4
+ models:
5
+ book: Libro
6
+ attributes:
7
+ book:
8
+ author__name: "Autor"
9
+ author__first_name: "Nombre del autor"
10
+ author__last_name: "Apellido del autor"
11
+ author__created_at: "Autor creado en"
12
+ author__updated_at: "Autor actualizado en"
13
+ in_abundance: "En abundancia"
14
+ title: "Título"
15
+ exemplars: "Ejemplares"
16
+ digitized: "Digitalizado"
17
+ notes: "Notas"
18
+ created_at: "Creado en"
19
+ updated_at: "Actualizado en"
@@ -0,0 +1,3 @@
1
+ RailsApp::Application.routes.draw do
2
+ netzke
3
+ end
@@ -0,0 +1,88 @@
1
+ CREATE TABLE `addresses` (
2
+ `id` int(11) NOT NULL AUTO_INCREMENT,
3
+ `user_id` int(11) DEFAULT NULL,
4
+ `street` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
5
+ `city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
6
+ `postcode` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
7
+ `country_id` int(11) DEFAULT NULL,
8
+ `created_at` datetime DEFAULT NULL,
9
+ `updated_at` datetime DEFAULT NULL,
10
+ PRIMARY KEY (`id`)
11
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
12
+
13
+ CREATE TABLE `authors` (
14
+ `id` int(11) NOT NULL AUTO_INCREMENT,
15
+ `first_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
16
+ `last_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
17
+ `created_at` datetime DEFAULT NULL,
18
+ `updated_at` datetime DEFAULT NULL,
19
+ PRIMARY KEY (`id`)
20
+ ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
21
+
22
+ CREATE TABLE `books` (
23
+ `id` int(11) NOT NULL AUTO_INCREMENT,
24
+ `author_id` int(11) DEFAULT NULL,
25
+ `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
26
+ `exemplars` int(11) DEFAULT NULL,
27
+ `digitized` tinyint(1) DEFAULT NULL,
28
+ `notes` text COLLATE utf8_unicode_ci,
29
+ `tags` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
30
+ `rating` int(11) DEFAULT NULL,
31
+ `created_at` datetime DEFAULT NULL,
32
+ `updated_at` datetime DEFAULT NULL,
33
+ PRIMARY KEY (`id`)
34
+ ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
35
+
36
+ CREATE TABLE `netzke_component_states` (
37
+ `id` int(11) NOT NULL AUTO_INCREMENT,
38
+ `component` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
39
+ `user_id` int(11) DEFAULT NULL,
40
+ `role_id` int(11) DEFAULT NULL,
41
+ `value` text COLLATE utf8_unicode_ci,
42
+ `created_at` datetime DEFAULT NULL,
43
+ `updated_at` datetime DEFAULT NULL,
44
+ PRIMARY KEY (`id`),
45
+ KEY `index_netzke_component_states_on_component` (`component`),
46
+ KEY `index_netzke_component_states_on_user_id` (`user_id`),
47
+ KEY `index_netzke_component_states_on_role_id` (`role_id`)
48
+ ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
49
+
50
+ CREATE TABLE `netzke_temp_table` (
51
+ `id` int(11) NOT NULL AUTO_INCREMENT,
52
+ PRIMARY KEY (`id`)
53
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
54
+
55
+ CREATE TABLE `roles` (
56
+ `id` int(11) NOT NULL AUTO_INCREMENT,
57
+ `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
58
+ `created_at` datetime DEFAULT NULL,
59
+ `updated_at` datetime DEFAULT NULL,
60
+ PRIMARY KEY (`id`)
61
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
62
+
63
+ CREATE TABLE `schema_migrations` (
64
+ `version` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
65
+ UNIQUE KEY `unique_schema_migrations` (`version`)
66
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
67
+
68
+ CREATE TABLE `users` (
69
+ `id` int(11) NOT NULL AUTO_INCREMENT,
70
+ `first_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
71
+ `last_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
72
+ `role_id` int(11) DEFAULT NULL,
73
+ `created_at` datetime DEFAULT NULL,
74
+ `updated_at` datetime DEFAULT NULL,
75
+ PRIMARY KEY (`id`)
76
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
77
+
78
+ INSERT INTO schema_migrations (version) VALUES ('20100914104207');
79
+
80
+ INSERT INTO schema_migrations (version) VALUES ('20100914104236');
81
+
82
+ INSERT INTO schema_migrations (version) VALUES ('20101026185816');
83
+
84
+ INSERT INTO schema_migrations (version) VALUES ('20101026190021');
85
+
86
+ INSERT INTO schema_migrations (version) VALUES ('20110101143818');
87
+
88
+ INSERT INTO schema_migrations (version) VALUES ('20110213213050');
@@ -0,0 +1,15 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :users do |t|
4
+ t.string :first_name
5
+ t.string :last_name
6
+ t.integer :role_id
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+
12
+ def self.down
13
+ drop_table :users
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ class CreateRoles < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :roles do |t|
4
+ t.string :name
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+
10
+ def self.down
11
+ drop_table :roles
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ class CreateAuthors < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :authors do |t|
4
+ t.string :first_name
5
+ t.string :last_name
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+
11
+ def self.down
12
+ drop_table :authors
13
+ end
14
+ end
@@ -0,0 +1,22 @@
1
+ class CreateBooks < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :books do |t|
4
+ t.integer :author_id
5
+ t.string :title
6
+ t.integer :exemplars
7
+ t.boolean :digitized, :default => false
8
+ t.text :notes
9
+ t.string :tags
10
+ t.integer :rating
11
+ t.decimal :price, precision: 7, scale: 2
12
+ t.float :special_index
13
+ t.string :cover
14
+
15
+ t.timestamps
16
+ end
17
+ end
18
+
19
+ def self.down
20
+ drop_table :books
21
+ end
22
+ end
@@ -0,0 +1,17 @@
1
+ class CreateAddresses < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :addresses do |t|
4
+ t.integer :user_id
5
+ t.string :street
6
+ t.string :city
7
+ t.string :postcode
8
+ t.integer :country_id
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+
14
+ def self.down
15
+ drop_table :addresses
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ class CreateBookWithCustomPrimaryKeys < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :book_with_custom_primary_keys, primary_key: :uid, id: false do |t|
4
+ t.integer :uid
5
+ t.string :title
6
+ t.integer :author_id
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+
12
+ def self.down
13
+ drop_table :book_with_custom_primary_keys
14
+ end
15
+ end
@@ -0,0 +1,9 @@
1
+ class AddLastReadAtToBooks < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :books, :last_read_at, :datetime
4
+ end
5
+
6
+ def self.down
7
+ remove_column :books, :last_read_at
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class AddPublishedOnToBooks < ActiveRecord::Migration
2
+ def change
3
+ add_column :books, :published_on, :date
4
+ end
5
+ end
@@ -0,0 +1,12 @@
1
+ class CreateIssues < ActiveRecord::Migration
2
+ def change
3
+ create_table :issues do |t|
4
+ t.string :title
5
+ t.integer :developer_id
6
+ t.integer :project_id
7
+ t.integer :status_id
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ class CreateProjects < ActiveRecord::Migration
2
+ def change
3
+ create_table :projects do |t|
4
+ t.string :title
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,8 @@
1
+ class CreateDevelopers < ActiveRecord::Migration
2
+ def change
3
+ create_table :developers do |t|
4
+
5
+ t.timestamps
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ class CreateStatuses < ActiveRecord::Migration
2
+ def change
3
+ create_table :statuses do |t|
4
+
5
+ t.timestamps
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,97 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20130105145239) do
15
+
16
+ create_table "addresses", force: true do |t|
17
+ t.integer "user_id"
18
+ t.string "street"
19
+ t.string "city"
20
+ t.string "postcode"
21
+ t.integer "country_id"
22
+ t.datetime "created_at"
23
+ t.datetime "updated_at"
24
+ end
25
+
26
+ create_table "authors", force: true do |t|
27
+ t.string "first_name"
28
+ t.string "last_name"
29
+ t.datetime "created_at"
30
+ t.datetime "updated_at"
31
+ end
32
+
33
+ create_table "book_with_custom_primary_keys", id: false, force: true do |t|
34
+ t.integer "uid"
35
+ t.string "title"
36
+ t.integer "author_id"
37
+ t.datetime "created_at"
38
+ t.datetime "updated_at"
39
+ end
40
+
41
+ create_table "books", force: true do |t|
42
+ t.integer "author_id"
43
+ t.string "title"
44
+ t.integer "exemplars"
45
+ t.boolean "digitized", default: false
46
+ t.text "notes"
47
+ t.string "tags"
48
+ t.integer "rating"
49
+ t.decimal "price", precision: 7, scale: 2
50
+ t.float "special_index"
51
+ t.string "cover"
52
+ t.datetime "created_at"
53
+ t.datetime "updated_at"
54
+ t.datetime "last_read_at"
55
+ t.date "published_on"
56
+ end
57
+
58
+ create_table "developers", force: true do |t|
59
+ t.datetime "created_at"
60
+ t.datetime "updated_at"
61
+ end
62
+
63
+ create_table "issues", force: true do |t|
64
+ t.string "title"
65
+ t.integer "developer_id"
66
+ t.integer "project_id"
67
+ t.integer "status_id"
68
+ t.datetime "created_at"
69
+ t.datetime "updated_at"
70
+ end
71
+
72
+ create_table "projects", force: true do |t|
73
+ t.string "title"
74
+ t.datetime "created_at"
75
+ t.datetime "updated_at"
76
+ end
77
+
78
+ create_table "roles", force: true do |t|
79
+ t.string "name"
80
+ t.datetime "created_at"
81
+ t.datetime "updated_at"
82
+ end
83
+
84
+ create_table "statuses", force: true do |t|
85
+ t.datetime "created_at"
86
+ t.datetime "updated_at"
87
+ end
88
+
89
+ create_table "users", force: true do |t|
90
+ t.string "first_name"
91
+ t.string "last_name"
92
+ t.integer "role_id"
93
+ t.datetime "created_at"
94
+ t.datetime "updated_at"
95
+ end
96
+
97
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
+ # Mayor.create(name: 'Emanuel', city: cities.first)