effective_assets 0.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +341 -72
  4. data/app/assets/javascripts/effective/snippets/effective_asset.js.coffee +53 -0
  5. data/app/assets/javascripts/effective_assets.js +4 -0
  6. data/app/assets/javascripts/effective_assets/asset_box.js.coffee +36 -0
  7. data/app/assets/javascripts/effective_assets/asset_box_dialog.js.coffee +49 -0
  8. data/app/assets/javascripts/effective_assets/asset_box_drag_and_drop.js.coffee +2 -0
  9. data/app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee +16 -0
  10. data/app/assets/javascripts/effective_assets/asset_box_sorting.js.coffee +8 -0
  11. data/app/assets/javascripts/effective_assets/jquery_ui_sortable.js +813 -585
  12. data/app/assets/javascripts/effective_assets/s3_uploader.js.coffee +268 -0
  13. data/app/assets/javascripts/effective_assets_iframe.js.coffee +28 -0
  14. data/app/assets/stylesheets/active_admin/effective_assets.css.scss +57 -0
  15. data/app/assets/stylesheets/effective_assets/_asset_box_input.scss +54 -175
  16. data/app/assets/stylesheets/effective_assets/_iframe_bootstrap.scss +1714 -0
  17. data/app/assets/stylesheets/effective_assets/_input_bootstrap.scss +508 -0
  18. data/app/assets/stylesheets/effective_assets_iframe.css.scss +23 -0
  19. data/app/controllers/effective/assets_controller.rb +41 -0
  20. data/app/controllers/effective/s3_uploads_controller.rb +58 -74
  21. data/app/helpers/effective_assets_helper.rb +30 -14
  22. data/app/helpers/effective_assets_s3_helper.rb +69 -0
  23. data/app/models/concerns/acts_as_asset_box.rb +75 -11
  24. data/app/models/effective/access_denied.rb +17 -0
  25. data/app/models/effective/asset.rb +130 -93
  26. data/app/models/effective/attachment.rb +2 -7
  27. data/app/models/effective/delayed_job.rb +33 -78
  28. data/app/models/effective/snippets/effective_asset.rb +19 -0
  29. data/app/models/effective/user_uploads.rb +19 -0
  30. data/app/models/inputs/asset_box.rb +154 -0
  31. data/app/models/inputs/asset_box_form_input.rb +7 -0
  32. data/app/models/inputs/asset_box_formtastic_input.rb +9 -0
  33. data/app/models/inputs/asset_box_input.rb +13 -82
  34. data/app/models/inputs/asset_box_simple_form_input.rb +7 -0
  35. data/app/uploaders/effective_assets_uploader.rb +14 -2
  36. data/app/uploaders/{asset_uploader.rb → test_asset_uploader.rb} +1 -1
  37. data/app/views/active_admin/effective_assets/_edit.html.haml +3 -3
  38. data/app/views/active_admin/effective_assets/_new.html.haml +2 -1
  39. data/app/views/asset_box_input/_attachment_as_list.html.haml +17 -0
  40. data/app/views/asset_box_input/_attachment_as_table.html.haml +32 -0
  41. data/app/views/asset_box_input/_attachment_as_thumbnail.html.haml +20 -0
  42. data/app/views/asset_box_input/_dialog.html.haml +18 -0
  43. data/app/views/asset_box_input/_progress_bar_template.html.haml +8 -0
  44. data/app/views/asset_box_input/_uploader.html.haml +21 -115
  45. data/app/views/effective/assets/iframe.html.haml +17 -0
  46. data/app/views/effective/snippets/_effective_asset.html.haml +8 -0
  47. data/config/routes.rb +8 -2
  48. data/db/migrate/01_create_effective_assets.rb.erb +3 -0
  49. data/lib/effective_assets.rb +34 -3
  50. data/lib/effective_assets/engine.rb +11 -8
  51. data/lib/effective_assets/version.rb +1 -1
  52. data/lib/generators/templates/asset_uploader.rb +35 -0
  53. data/lib/generators/templates/effective_assets.rb +31 -4
  54. data/lib/tasks/effective_assets_tasks.rake +115 -4
  55. data/spec/internal/config/database.yml +3 -0
  56. data/spec/internal/config/initializers/effective_assets.rb +18 -0
  57. data/spec/internal/config/routes.rb +3 -0
  58. data/spec/internal/db/combustion_test.sqlite +0 -0
  59. data/spec/internal/db/schema.rb +52 -0
  60. data/spec/internal/log/test.log +793 -0
  61. data/spec/{dummy → internal}/public/favicon.ico +0 -0
  62. data/spec/internal/public/sprites.png +0 -0
  63. data/spec/models/asset_spec.rb +119 -35
  64. data/spec/spec_helper.rb +9 -3
  65. metadata +95 -234
  66. data/app/assets/images/effective_assets/s3_down_button.gif +0 -0
  67. data/app/assets/images/effective_assets/s3_over_button.gif +0 -0
  68. data/app/assets/images/effective_assets/s3_up_button.gif +0 -0
  69. data/app/assets/images/effective_assets/s3_upload.swf +0 -0
  70. data/app/assets/javascripts/effective_assets/asset_box_input.js.coffee +0 -71
  71. data/app/assets/javascripts/effective_assets/asset_box_uploader.js +0 -122
  72. data/app/assets/javascripts/effective_assets/asset_box_uploader_customization.js +0 -166
  73. data/app/controllers/effective/attachments_controller.rb +0 -14
  74. data/app/views/asset_box_input/_attachment_fields.html.haml +0 -14
  75. data/spec/dummy/README.rdoc +0 -261
  76. data/spec/dummy/Rakefile +0 -7
  77. data/spec/dummy/app/assets/javascripts/application.js +0 -15
  78. data/spec/dummy/app/assets/stylesheets/application.css +0 -13
  79. data/spec/dummy/app/controllers/application_controller.rb +0 -3
  80. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  81. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  82. data/spec/dummy/config.ru +0 -4
  83. data/spec/dummy/config/application.rb +0 -65
  84. data/spec/dummy/config/boot.rb +0 -10
  85. data/spec/dummy/config/database.yml +0 -25
  86. data/spec/dummy/config/environment.rb +0 -5
  87. data/spec/dummy/config/environments/development.rb +0 -37
  88. data/spec/dummy/config/environments/production.rb +0 -67
  89. data/spec/dummy/config/environments/test.rb +0 -37
  90. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  91. data/spec/dummy/config/initializers/inflections.rb +0 -15
  92. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  93. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  94. data/spec/dummy/config/initializers/session_store.rb +0 -8
  95. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  96. data/spec/dummy/config/locales/en.yml +0 -5
  97. data/spec/dummy/config/routes.rb +0 -58
  98. data/spec/dummy/db/development.sqlite3 +0 -0
  99. data/spec/dummy/db/schema.rb +0 -16
  100. data/spec/dummy/db/test.sqlite3 +0 -0
  101. data/spec/dummy/log/development.log +0 -71
  102. data/spec/dummy/log/test.log +0 -33
  103. data/spec/dummy/public/404.html +0 -26
  104. data/spec/dummy/public/422.html +0 -26
  105. data/spec/dummy/public/500.html +0 -25
  106. data/spec/dummy/script/rails +0 -6
  107. data/spec/dummy/spec_link +0 -3
@@ -1,16 +0,0 @@
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 to check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(:version => 0) do
15
-
16
- end
Binary file
@@ -1,71 +0,0 @@
1
- Connecting to database specified by database.yml
2
-  (0.2ms) select sqlite_version(*)
3
-  (2.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
4
-  (2.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5
-  (2.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
6
-  (0.3ms) select sqlite_version(*)
7
-  (2.3ms) CREATE TABLE "addresses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "addressable_type" varchar(255), "addressable_id" integer, "category" varchar(64), "full_name" varchar(255), "address1" varchar(255), "address2" varchar(255), "city" varchar(255), "state_code" varchar(255), "country_code" varchar(255), "postal_code" varchar(255), "updated_at" datetime, "created_at" datetime)
8
-  (2.8ms) CREATE INDEX "index_addresses_on_addressable_id" ON "addresses" ("addressable_id")
9
-  (2.3ms) CREATE INDEX "index_addresses_on_addressable_type_and_addressable_id" ON "addresses" ("addressable_type", "addressable_id")
10
-  (2.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
11
-  (2.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
12
-  (0.2ms) SELECT version FROM "schema_migrations"
13
-  (2.5ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
14
- Connecting to database specified by database.yml
15
-  (0.1ms) select sqlite_version(*)
16
-  (3.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
17
- Connecting to database specified by database.yml
18
-  (3.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
19
-  (0.1ms) SELECT version FROM "schema_migrations"
20
-  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
21
- Connecting to database specified by database.yml
22
-  (2.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
23
-  (0.1ms) SELECT version FROM "schema_migrations"
24
- Connecting to database specified by database.yml
25
-  (2.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
26
-  (0.1ms) SELECT version FROM "schema_migrations"
27
- Connecting to database specified by database.yml
28
-  (2.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
29
-  (0.1ms) SELECT version FROM "schema_migrations"
30
- Connecting to database specified by database.yml
31
-  (2.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
32
-  (0.1ms) SELECT version FROM "schema_migrations"
33
- Connecting to database specified by database.yml
34
-  (2.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
35
-  (0.1ms) SELECT version FROM "schema_migrations"
36
- Connecting to database specified by database.yml
37
-  (2.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
38
-  (0.6ms) select sqlite_version(*)
39
-  (2.2ms) DROP TABLE "addresses"
40
-  (2.8ms) CREATE TABLE "addresses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "addressable_type" varchar(255), "addressable_id" integer, "category" varchar(64), "full_name" varchar(255), "address1" varchar(255), "address2" varchar(255), "city" varchar(255), "state_code" varchar(255), "country_code" varchar(255), "postal_code" varchar(255), "updated_at" datetime, "created_at" datetime)
41
-  (3.0ms) CREATE INDEX "index_addresses_on_addressable_id" ON "addresses" ("addressable_id")
42
-  (2.5ms) CREATE INDEX "index_addresses_on_addressable_type_and_addressable_id" ON "addresses" ("addressable_type", "addressable_id")
43
-  (0.1ms) SELECT version FROM "schema_migrations"
44
- Connecting to database specified by database.yml
45
-  (0.2ms) select sqlite_version(*)
46
-  (2.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
47
-  (2.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
48
-  (2.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
49
- Connecting to database specified by database.yml
50
-  (3.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
51
-  (0.1ms) select sqlite_version(*)
52
-  (2.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
53
-  (2.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
54
-  (0.2ms) SELECT version FROM "schema_migrations"
55
-  (2.5ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
56
- Connecting to database specified by database.yml
57
-  (2.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
58
-  (0.1ms) SELECT version FROM "schema_migrations"
59
- Connecting to database specified by database.yml
60
-  (2.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
61
-  (0.1ms) SELECT version FROM "schema_migrations"
62
- Connecting to database specified by database.yml
63
-  (0.2ms) select sqlite_version(*)
64
-  (51.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
65
-  (61.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
66
-  (2.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
67
-  (0.1ms) SELECT version FROM "schema_migrations"
68
-  (22.8ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
69
- Connecting to database specified by database.yml
70
-  (2.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
71
-  (0.1ms) SELECT version FROM "schema_migrations"
@@ -1,33 +0,0 @@
1
- Connecting to database specified by database.yml
2
- Connecting to database specified by database.yml
3
- Connecting to database specified by database.yml
4
- Connecting to database specified by database.yml
5
- Connecting to database specified by database.yml
6
- Connecting to database specified by database.yml
7
- Connecting to database specified by database.yml
8
- Connecting to database specified by database.yml
9
- Connecting to database specified by database.yml
10
- Connecting to database specified by database.yml
11
- Connecting to database specified by database.yml
12
- Connecting to database specified by database.yml
13
- Connecting to database specified by database.yml
14
- Connecting to database specified by database.yml
15
- Connecting to database specified by database.yml
16
- Connecting to database specified by database.yml
17
-  (0.1ms) select sqlite_version(*)
18
-  (2.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
19
- Connecting to database specified by database.yml
20
- Connecting to database specified by database.yml
21
-  (0.1ms) select sqlite_version(*)
22
-  (2.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
23
- Connecting to database specified by database.yml
24
- Connecting to database specified by database.yml
25
-  (0.2ms) select sqlite_version(*)
26
-  (1.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
27
-  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
28
-  (2.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
29
- Connecting to database specified by database.yml
30
- Connecting to database specified by database.yml
31
-  (0.1ms) select sqlite_version(*)
32
-  (2.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
33
- Connecting to database specified by database.yml
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/404.html -->
21
- <div class="dialog">
22
- <h1>The page you were looking for doesn't exist.</h1>
23
- <p>You may have mistyped the address or the page may have moved.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/422.html -->
21
- <div class="dialog">
22
- <h1>The change you wanted was rejected.</h1>
23
- <p>Maybe you tried to change something you didn't have access to.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,25 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/500.html -->
21
- <div class="dialog">
22
- <h1>We're sorry, but something went wrong.</h1>
23
- </div>
24
- </body>
25
- </html>
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
-
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
6
- require 'rails/commands'
@@ -1,3 +0,0 @@
1
- You may have to link this to ../../spec
2
-
3
- spec/dummy > ln -s ../../spec spec