effective_assets 0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +1 -1
- data/README.md +341 -72
- data/app/assets/javascripts/effective/snippets/effective_asset.js.coffee +53 -0
- data/app/assets/javascripts/effective_assets.js +4 -0
- data/app/assets/javascripts/effective_assets/asset_box.js.coffee +36 -0
- data/app/assets/javascripts/effective_assets/asset_box_dialog.js.coffee +49 -0
- data/app/assets/javascripts/effective_assets/asset_box_drag_and_drop.js.coffee +2 -0
- data/app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee +16 -0
- data/app/assets/javascripts/effective_assets/asset_box_sorting.js.coffee +8 -0
- data/app/assets/javascripts/effective_assets/jquery_ui_sortable.js +813 -585
- data/app/assets/javascripts/effective_assets/s3_uploader.js.coffee +268 -0
- data/app/assets/javascripts/effective_assets_iframe.js.coffee +28 -0
- data/app/assets/stylesheets/active_admin/effective_assets.css.scss +57 -0
- data/app/assets/stylesheets/effective_assets/_asset_box_input.scss +54 -175
- data/app/assets/stylesheets/effective_assets/_iframe_bootstrap.scss +1714 -0
- data/app/assets/stylesheets/effective_assets/_input_bootstrap.scss +508 -0
- data/app/assets/stylesheets/effective_assets_iframe.css.scss +23 -0
- data/app/controllers/effective/assets_controller.rb +41 -0
- data/app/controllers/effective/s3_uploads_controller.rb +58 -74
- data/app/helpers/effective_assets_helper.rb +30 -14
- data/app/helpers/effective_assets_s3_helper.rb +69 -0
- data/app/models/concerns/acts_as_asset_box.rb +75 -11
- data/app/models/effective/access_denied.rb +17 -0
- data/app/models/effective/asset.rb +130 -93
- data/app/models/effective/attachment.rb +2 -7
- data/app/models/effective/delayed_job.rb +33 -78
- data/app/models/effective/snippets/effective_asset.rb +19 -0
- data/app/models/effective/user_uploads.rb +19 -0
- data/app/models/inputs/asset_box.rb +154 -0
- data/app/models/inputs/asset_box_form_input.rb +7 -0
- data/app/models/inputs/asset_box_formtastic_input.rb +9 -0
- data/app/models/inputs/asset_box_input.rb +13 -82
- data/app/models/inputs/asset_box_simple_form_input.rb +7 -0
- data/app/uploaders/effective_assets_uploader.rb +14 -2
- data/app/uploaders/{asset_uploader.rb → test_asset_uploader.rb} +1 -1
- data/app/views/active_admin/effective_assets/_edit.html.haml +3 -3
- data/app/views/active_admin/effective_assets/_new.html.haml +2 -1
- data/app/views/asset_box_input/_attachment_as_list.html.haml +17 -0
- data/app/views/asset_box_input/_attachment_as_table.html.haml +32 -0
- data/app/views/asset_box_input/_attachment_as_thumbnail.html.haml +20 -0
- data/app/views/asset_box_input/_dialog.html.haml +18 -0
- data/app/views/asset_box_input/_progress_bar_template.html.haml +8 -0
- data/app/views/asset_box_input/_uploader.html.haml +21 -115
- data/app/views/effective/assets/iframe.html.haml +17 -0
- data/app/views/effective/snippets/_effective_asset.html.haml +8 -0
- data/config/routes.rb +8 -2
- data/db/migrate/01_create_effective_assets.rb.erb +3 -0
- data/lib/effective_assets.rb +34 -3
- data/lib/effective_assets/engine.rb +11 -8
- data/lib/effective_assets/version.rb +1 -1
- data/lib/generators/templates/asset_uploader.rb +35 -0
- data/lib/generators/templates/effective_assets.rb +31 -4
- data/lib/tasks/effective_assets_tasks.rake +115 -4
- data/spec/internal/config/database.yml +3 -0
- data/spec/internal/config/initializers/effective_assets.rb +18 -0
- data/spec/internal/config/routes.rb +3 -0
- data/spec/internal/db/combustion_test.sqlite +0 -0
- data/spec/internal/db/schema.rb +52 -0
- data/spec/internal/log/test.log +793 -0
- data/spec/{dummy → internal}/public/favicon.ico +0 -0
- data/spec/internal/public/sprites.png +0 -0
- data/spec/models/asset_spec.rb +119 -35
- data/spec/spec_helper.rb +9 -3
- metadata +95 -234
- data/app/assets/images/effective_assets/s3_down_button.gif +0 -0
- data/app/assets/images/effective_assets/s3_over_button.gif +0 -0
- data/app/assets/images/effective_assets/s3_up_button.gif +0 -0
- data/app/assets/images/effective_assets/s3_upload.swf +0 -0
- data/app/assets/javascripts/effective_assets/asset_box_input.js.coffee +0 -71
- data/app/assets/javascripts/effective_assets/asset_box_uploader.js +0 -122
- data/app/assets/javascripts/effective_assets/asset_box_uploader_customization.js +0 -166
- data/app/controllers/effective/attachments_controller.rb +0 -14
- data/app/views/asset_box_input/_attachment_fields.html.haml +0 -14
- data/spec/dummy/README.rdoc +0 -261
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/assets/javascripts/application.js +0 -15
- data/spec/dummy/app/assets/stylesheets/application.css +0 -13
- data/spec/dummy/app/controllers/application_controller.rb +0 -3
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/config/application.rb +0 -65
- data/spec/dummy/config/boot.rb +0 -10
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -37
- data/spec/dummy/config/environments/production.rb +0 -67
- data/spec/dummy/config/environments/test.rb +0 -37
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/inflections.rb +0 -15
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config/routes.rb +0 -58
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +0 -16
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -71
- data/spec/dummy/log/test.log +0 -33
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -25
- data/spec/dummy/script/rails +0 -6
- data/spec/dummy/spec_link +0 -3
Binary file
|
data/spec/dummy/db/schema.rb
DELETED
@@ -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
|
data/spec/dummy/db/test.sqlite3
DELETED
Binary file
|
@@ -1,71 +0,0 @@
|
|
1
|
-
Connecting to database specified by database.yml
|
2
|
-
[1m[36m (0.2ms)[0m [1mselect sqlite_version(*)[0m
|
3
|
-
[1m[35m (2.6ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
4
|
-
[1m[36m (2.3ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
5
|
-
[1m[35m (2.6ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
6
|
-
[1m[36m (0.3ms)[0m [1mselect sqlite_version(*)[0m
|
7
|
-
[1m[35m (2.3ms)[0m 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
|
-
[1m[36m (2.8ms)[0m [1mCREATE INDEX "index_addresses_on_addressable_id" ON "addresses" ("addressable_id")[0m
|
9
|
-
[1m[35m (2.3ms)[0m CREATE INDEX "index_addresses_on_addressable_type_and_addressable_id" ON "addresses" ("addressable_type", "addressable_id")
|
10
|
-
[1m[36m (2.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
11
|
-
[1m[35m (2.2ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
12
|
-
[1m[36m (0.2ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
13
|
-
[1m[35m (2.5ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('1')
|
14
|
-
Connecting to database specified by database.yml
|
15
|
-
[1m[36m (0.1ms)[0m [1mselect sqlite_version(*)[0m
|
16
|
-
[1m[35m (3.1ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
17
|
-
Connecting to database specified by database.yml
|
18
|
-
[1m[36m (3.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
19
|
-
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
20
|
-
[1m[36m (1.6ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
21
|
-
Connecting to database specified by database.yml
|
22
|
-
[1m[36m (2.6ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
23
|
-
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
24
|
-
Connecting to database specified by database.yml
|
25
|
-
[1m[36m (2.3ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
26
|
-
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
27
|
-
Connecting to database specified by database.yml
|
28
|
-
[1m[36m (2.4ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
29
|
-
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
30
|
-
Connecting to database specified by database.yml
|
31
|
-
[1m[36m (2.8ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
32
|
-
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
33
|
-
Connecting to database specified by database.yml
|
34
|
-
[1m[36m (2.5ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
35
|
-
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
36
|
-
Connecting to database specified by database.yml
|
37
|
-
[1m[36m (2.4ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
38
|
-
[1m[35m (0.6ms)[0m select sqlite_version(*)
|
39
|
-
[1m[36m (2.2ms)[0m [1mDROP TABLE "addresses"[0m
|
40
|
-
[1m[35m (2.8ms)[0m 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
|
-
[1m[36m (3.0ms)[0m [1mCREATE INDEX "index_addresses_on_addressable_id" ON "addresses" ("addressable_id")[0m
|
42
|
-
[1m[35m (2.5ms)[0m CREATE INDEX "index_addresses_on_addressable_type_and_addressable_id" ON "addresses" ("addressable_type", "addressable_id")
|
43
|
-
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
44
|
-
Connecting to database specified by database.yml
|
45
|
-
[1m[36m (0.2ms)[0m [1mselect sqlite_version(*)[0m
|
46
|
-
[1m[35m (2.0ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
47
|
-
[1m[36m (2.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
48
|
-
[1m[35m (2.6ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
49
|
-
Connecting to database specified by database.yml
|
50
|
-
[1m[36m (3.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
51
|
-
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
52
|
-
[1m[36m (2.6ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
53
|
-
[1m[35m (2.6ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
54
|
-
[1m[36m (0.2ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
55
|
-
[1m[35m (2.5ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('0')
|
56
|
-
Connecting to database specified by database.yml
|
57
|
-
[1m[36m (2.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
58
|
-
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
59
|
-
Connecting to database specified by database.yml
|
60
|
-
[1m[36m (2.7ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
61
|
-
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
62
|
-
Connecting to database specified by database.yml
|
63
|
-
[1m[36m (0.2ms)[0m [1mselect sqlite_version(*)[0m
|
64
|
-
[1m[35m (51.0ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
65
|
-
[1m[36m (61.4ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
66
|
-
[1m[35m (2.6ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
67
|
-
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
68
|
-
[1m[35m (22.8ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('0')
|
69
|
-
Connecting to database specified by database.yml
|
70
|
-
[1m[36m (2.4ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
71
|
-
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
data/spec/dummy/log/test.log
DELETED
@@ -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
|
-
[1m[36m (0.1ms)[0m [1mselect sqlite_version(*)[0m
|
18
|
-
[1m[35m (2.3ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
19
|
-
Connecting to database specified by database.yml
|
20
|
-
Connecting to database specified by database.yml
|
21
|
-
[1m[36m (0.1ms)[0m [1mselect sqlite_version(*)[0m
|
22
|
-
[1m[35m (2.5ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
23
|
-
Connecting to database specified by database.yml
|
24
|
-
Connecting to database specified by database.yml
|
25
|
-
[1m[36m (0.2ms)[0m [1mselect sqlite_version(*)[0m
|
26
|
-
[1m[35m (1.8ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
27
|
-
[1m[36m (1.8ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
28
|
-
[1m[35m (2.6ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
29
|
-
Connecting to database specified by database.yml
|
30
|
-
Connecting to database specified by database.yml
|
31
|
-
[1m[36m (0.1ms)[0m [1mselect sqlite_version(*)[0m
|
32
|
-
[1m[35m (2.2ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
33
|
-
Connecting to database specified by database.yml
|
data/spec/dummy/public/404.html
DELETED
@@ -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>
|
data/spec/dummy/public/422.html
DELETED
@@ -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>
|
data/spec/dummy/public/500.html
DELETED
@@ -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>
|
data/spec/dummy/script/rails
DELETED
@@ -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'
|
data/spec/dummy/spec_link
DELETED