tenon 1.0.27 → 1.0.28

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34e1b1b1ecbd92e365d323988b5e9bafb32e19c1
4
- data.tar.gz: e068e258a9520d70e0c9acf36afb870a4cbb13cf
3
+ metadata.gz: b20101b1ae5ed68cc8f35d9b9e328496d3e4f84d
4
+ data.tar.gz: f80fef4d9a7f943e239e29509635a6f2cc424448
5
5
  SHA512:
6
- metadata.gz: ea19fd36996e7c42de91645ec5e67cc5b38c5865d2970772d4f7a84d2fd0cc6c469d10113809f59fe2d0c0be73cf7fe4f19ed16908f345a5b5c1599db31a42f3
7
- data.tar.gz: a6fb89c25554d018a19ad6b2b9941c6a2c979daf1e2bb6b2ef3fa3410c6bfbdeba6af8ad934dfb1346c6d2e6d008a9ed8462f02a3dbdda7b9c02a5a016d7327d
6
+ metadata.gz: b1000c12fffc2d03eac160598ec9db64a9d4fd2ac1f663772fa0a643f4c9005f54b283cdcae8973889b7160259fc1ab7316353e63fd610ffeaaba9c5ae8ec091
7
+ data.tar.gz: ed8fb9276d38ffb365b780ffb89af11915e53c0b03701dc443180f92de6299912fd9d23bc8cf53dda3d0777addeacffcb9313d605c3b2b9ebfc0700f8c4f77f0
data/README.rdoc CHANGED
@@ -1,3 +1,64 @@
1
1
  = Tenon
2
2
 
3
- This project rocks and uses MIT-LICENSE.
3
+ == License
4
+
5
+ This project uses the MIT-LICENSE. Do whatever you want with it as long as you
6
+ don't violate the licenses of the various open source pieces on which it
7
+ depends.
8
+
9
+ == Installation
10
+
11
+ In your Gemfile
12
+
13
+ gem 'tenon'
14
+
15
+ and then bundle install.
16
+
17
+ in config/application.rb:
18
+
19
+ require 'active_record/railtie'
20
+
21
+
22
+ in config/routes.rb:
23
+
24
+ mount Tenon::Engine => '/tenon'
25
+
26
+
27
+ Run command:
28
+
29
+ $ rake tenon:install:migrations
30
+ $ rake db:migrate
31
+
32
+
33
+ You will need to have a database set up at this point. Currently Tenon requires that you use postgres.
34
+
35
+ Running rake db:migrate probably threw up a devise error. Create config/initializers/devise.rb and paste:
36
+
37
+ Devise.setup do |config|
38
+ ## paste the secret key line from the error output ##
39
+ end
40
+
41
+
42
+ Run that command again:
43
+
44
+ $ rake db:migrate
45
+
46
+
47
+ Install the Tenon helpers in app/controllers/application_controller.rb:
48
+
49
+ helper Tenon::Engine.helpers
50
+
51
+ Install the necessary files to run and customize Tenon (this is now required):
52
+
53
+ $ rails generate tenon:install
54
+
55
+ To run seed data (such as creating an admin user) from Tenon, open console and run:
56
+
57
+ ENV['PASSWORD'] = 'password' # or something at least 8 chars long
58
+ Tenon::Engine.load_seed
59
+
60
+ Restart your app and navigate to /tenon
61
+
62
+ If you want to be able to use rspec, which would be good, you will also need to run:
63
+
64
+ bundle exec rails generate rspec:install
@@ -34,4 +34,4 @@ class Tenon.features.AssetAttachment
34
34
  if @$browseButton.data('asset-field')
35
35
  $(@$browseButton.data('asset-field'))
36
36
  else
37
- @$browseButton.closest('.asset-field')
37
+ @$browseButton.closest('.asset-field')
@@ -0,0 +1,11 @@
1
+ class Tenon.features.AssetDetachment
2
+ constructor: ->
3
+ $(document).on('click', '.remove-asset', @_removeAsset)
4
+
5
+ _removeAsset: (e) =>
6
+ e.preventDefault()
7
+ e.stopPropagation()
8
+ @$assetField = $(e.currentTarget).closest('.asset-field')
9
+ @$assetField.find('.asset-id-field').removeAttr('value')
10
+ @$assetField.find('.thumbnail img').attr('src', '/assets/tenon/thumb-doc.png')
11
+ @$assetField.find('.asset-info').html('No asset selected.')
@@ -35,6 +35,7 @@ var Tenon = {
35
35
  new Tenon.features.i18n();
36
36
  new Tenon.features.Flash();
37
37
  new Tenon.features.AssetCropping();
38
+ new Tenon.features.AssetDetachment();
38
39
  new Tenon.features.MainMenu();
39
40
  new Tenon.features.Pagination();
40
41
  new Tenon.features.HamburgerNavigation();
@@ -20,3 +20,7 @@
20
20
  %small
21
21
  or
22
22
  = link_to_remove_association "remove", f
23
+ - else
24
+ %small
25
+ or
26
+ = link_to "remove", '#', class: 'remove-asset'
@@ -86,6 +86,10 @@ module Tenon
86
86
  attachment = ProxyAttachment.new(asset.attachment, self.class, asset_name)
87
87
  instance_variable_set("@#{asset_name}_id", val)
88
88
  instance_variable_set("@#{asset_name}", attachment)
89
+ else
90
+ unless self.send("#{asset_name}_id").blank?
91
+ Tenon::ItemAsset.where(item_type: self.class.to_s, item_id: id, asset_name: asset_name).destroy_all
92
+ end
89
93
  end
90
94
  end
91
95
  end
data/lib/tenon/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tenon
2
- VERSION = '1.0.27'
2
+ VERSION = '1.0.28'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tenon
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.27
4
+ version: 1.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - factor[e] design initiative
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-09 00:00:00.000000000 Z
11
+ date: 2014-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: better_errors
@@ -192,6 +192,20 @@ dependencies:
192
192
  - - '='
193
193
  - !ruby/object:Gem::Version
194
194
  version: 1.0.2
195
+ - !ruby/object:Gem::Dependency
196
+ name: quiet_assets
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
195
209
  - !ruby/object:Gem::Dependency
196
210
  name: rails
197
211
  requirement: !ruby/object:Gem::Requirement
@@ -923,6 +937,7 @@ files:
923
937
  - app/assets/javascripts/tenon/controllers/tenon.js.coffee
924
938
  - app/assets/javascripts/tenon/features/asset_attachment.js.coffee
925
939
  - app/assets/javascripts/tenon/features/asset_cropping.js.coffee
940
+ - app/assets/javascripts/tenon/features/asset_detachment.js.coffee
926
941
  - app/assets/javascripts/tenon/features/asset_list_post_crop_handler.js.coffee
927
942
  - app/assets/javascripts/tenon/features/asset_uploader.js.coffee
928
943
  - app/assets/javascripts/tenon/features/box_toggles.js.coffee
@@ -1470,7 +1485,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1470
1485
  version: '0'
1471
1486
  requirements: []
1472
1487
  rubyforge_project:
1473
- rubygems_version: 2.2.2
1488
+ rubygems_version: 2.3.0
1474
1489
  signing_key:
1475
1490
  specification_version: 4
1476
1491
  summary: A highly flexible mountable Rails CMS built for rapid application development.