avatars_for_rails 1.0.0 → 1.0.1

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: 4003a0bea75c7e7076c70515cd31c8787b340873
4
- data.tar.gz: 8c9b84367fb971c6f2193afd14508b8bf02cc253
3
+ metadata.gz: e76027c84a8f47d8dcca9b180634c91d0c2b06f6
4
+ data.tar.gz: 86fa6b3be700c8c9a83dc1d959133c5c98951eaa
5
5
  SHA512:
6
- metadata.gz: 2c09be333a4944a4964377b77da73796ece94fd9677a706a05e0563238885602be890a4a1626da9c23475bf05089ba8cf08ecbbaf357416c6efc16d4920735b0
7
- data.tar.gz: 57a38b0525ddb5d88f5b17dabdec6258d61f210d4800c980857fc234056b68ab1ddaeeebaa7498febb720236862edcfcc7baf84f9b08501b2f57733e98b5b882
6
+ metadata.gz: 6b72e945aeed0225e48d79d57a81c544377f5bd344796be8e328c929e1dfbadbd089d07d04fa97a2cd9a167c2623a3baefe06d7600e4c17afde2c92e55467c63
7
+ data.tar.gz: 5d246bc83b71f280e4abb3f1befa935ca1d73e906ac98e90512f4d1ddab582eff1fd193621c79876a1f8fdafac0c949361c9b74484c24edc079ba37b7b250a5e
@@ -7,52 +7,3 @@
7
7
  AvatarForRails.edit();
8
8
  });
9
9
  <% end %>
10
-
11
- $(document).ready(function() {
12
- var options = {
13
- target: '#precrop_drag_response',
14
- success: showResponse
15
- };
16
-
17
- $('#uploadForm').submit(function() {
18
- $(this).ajaxSubmit(options);
19
- return false;
20
- });
21
- });
22
-
23
-
24
- $(function () {
25
- $('.upload').fileUploadUI({
26
- uploadTable: $('.upload_files'),
27
- downloadTable: $('.download_files'),
28
- buildUploadRow: function (files, index) {
29
- var file = files[index];
30
- return $('<tr><td>' + file.name + '<\/td>' +
31
- '<td class="file_upload_progress"><div><\/div><\/td>' +
32
- '<td class="file_upload_cancel">' +
33
- '<div class="ui-state-default ui-corner-all ui-state-hover" title="Cancel">' +
34
- '<span class="ui-icon ui-icon-cancel">Cancel<\/span>' +
35
- '<\/div><\/td><\/tr>');
36
- },
37
- buildDownloadRow: function (file) {
38
-
39
- },
40
- onComplete: function (event, files, index, xhr, handler) {
41
- $.ajax({
42
- type: "GET",
43
- url: "/avatars/new/?drag_name=" + handler.response.name,
44
- success: function(data){
45
- $("#precrop_drag_response").html(data);
46
- jQuery('#cropImage').Jcrop({
47
- bgColor: 'clear',
48
- bgOpacity: .6,
49
- setSelect: [ 0, 0, 200, 200 ],
50
- aspectRatio: 1 ,
51
- onChange: update_crop,
52
- onSelect: update_crop
53
- });
54
- }
55
- });
56
- }
57
- });
58
- });
@@ -1,3 +1,3 @@
1
1
  module AvatarsForRails
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -1,3 +1,4 @@
1
+ require 'RMagick'
1
2
  require 'jquery-rails'
2
3
  require 'flashy'
3
4
  require 'paperclip'
@@ -1,10 +1,14 @@
1
1
  AvatarsForRails.setup do |config|
2
- config.avatarable_model = :<%= file_name %>
3
- config.current_avatarable_object = :current_<%= file_name %>
4
- config.avatarable_filters = []
5
- config.avatarable_styles = { :representation => "20x20>",
6
- :tie => "30x30>",
7
- :actor => '35x35>',
8
- :profile => '94x94'}
2
+ # Filters to run before updating the avatar
3
+ # config.controller_filters = [ :authenticate_user! ]
9
4
 
10
- end
5
+ # The method to get the avatarable in the controller
6
+ # config.controller_filters = [ :current_user ]
7
+
8
+ # The default styles that will be generated
9
+ # config.avatarable_styles = { small: '50x50',
10
+ # medium: '120x120' }
11
+
12
+ # The tmp path inside public/
13
+ # config.public_tmp_path = File.join('system', 'tmp')
14
+ end
@@ -1,20 +1,9 @@
1
1
  class CreateAvatarsForRails<%= file_name.camelize %> < ActiveRecord::Migration
2
- def self.up
3
- #Tables
4
- create_table "avatars", :force => true do |t|
5
- t.integer "<%= file_name %>_id"
6
- t.string "logo_file_name"
7
- t.string "logo_content_type"
8
- t.integer "logo_file_size"
9
- t.datetime "logo_updated_at"
10
- t.boolean "active", :default => true
11
- end
12
-
13
- add_index "avatars", "<%= file_name %>_id"
14
-
2
+ def up
3
+ add_attachment :<%= file_name.tableize %>, :logo
15
4
  end
16
5
 
17
6
  def self.down
18
- drop_table :avatars
7
+ remove_attachment :<%= file_name.tableize %>, :logo
19
8
  end
20
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avatars_for_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaime Castro Montero
@@ -211,7 +211,6 @@ files:
211
211
  - spec/dummy/config/environments/development.rb
212
212
  - spec/dummy/config/environments/production.rb
213
213
  - spec/dummy/config/environments/test.rb
214
- - spec/dummy/config/initializers/avatars_for_rails.rb
215
214
  - spec/dummy/config/initializers/backtrace_silencers.rb
216
215
  - spec/dummy/config/initializers/inflections.rb
217
216
  - spec/dummy/config/initializers/mime_types.rb
@@ -1,9 +0,0 @@
1
- AvatarsForRails.setup do |config|
2
- config.avatarable_model = :actor
3
- config.current_avatarable_object = :current_actor
4
- config.avatarable_filters = []
5
- config.avatarable_styles = { :representation => "20x20>",
6
- :tie => "30x30>",
7
- :actor => '35x35>',
8
- :profile => '94x94'}
9
- end