the_storages 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. data/app/assets/images/content_types/default.jpg +0 -0
  2. data/app/assets/images/content_types/file_extension_3gp.png +0 -0
  3. data/app/assets/images/content_types/file_extension_7z.png +0 -0
  4. data/app/assets/images/content_types/file_extension_ace.png +0 -0
  5. data/app/assets/images/content_types/file_extension_ai.png +0 -0
  6. data/app/assets/images/content_types/file_extension_aif.png +0 -0
  7. data/app/assets/images/content_types/file_extension_aiff.png +0 -0
  8. data/app/assets/images/content_types/file_extension_amr.png +0 -0
  9. data/app/assets/images/content_types/file_extension_asf.png +0 -0
  10. data/app/assets/images/content_types/file_extension_asx.png +0 -0
  11. data/app/assets/images/content_types/file_extension_bat.png +0 -0
  12. data/app/assets/images/content_types/file_extension_bin.png +0 -0
  13. data/app/assets/images/content_types/file_extension_bmp.png +0 -0
  14. data/app/assets/images/content_types/file_extension_bup.png +0 -0
  15. data/app/assets/images/content_types/file_extension_cab.png +0 -0
  16. data/app/assets/images/content_types/file_extension_cbr.png +0 -0
  17. data/app/assets/images/content_types/file_extension_cda.png +0 -0
  18. data/app/assets/images/content_types/file_extension_cdl.png +0 -0
  19. data/app/assets/images/content_types/file_extension_cdr.png +0 -0
  20. data/app/assets/images/content_types/file_extension_chm.png +0 -0
  21. data/app/assets/images/content_types/file_extension_dat.png +0 -0
  22. data/app/assets/images/content_types/file_extension_divx.png +0 -0
  23. data/app/assets/images/content_types/file_extension_dll.png +0 -0
  24. data/app/assets/images/content_types/file_extension_dmg.png +0 -0
  25. data/app/assets/images/content_types/file_extension_doc.png +0 -0
  26. data/app/assets/images/content_types/file_extension_docx.png +0 -0
  27. data/app/assets/images/content_types/file_extension_dss.png +0 -0
  28. data/app/assets/images/content_types/file_extension_dvf.png +0 -0
  29. data/app/assets/images/content_types/file_extension_dwg.png +0 -0
  30. data/app/assets/images/content_types/file_extension_eml.png +0 -0
  31. data/app/assets/images/content_types/file_extension_eps.png +0 -0
  32. data/app/assets/images/content_types/file_extension_exe.png +0 -0
  33. data/app/assets/images/content_types/file_extension_fla.png +0 -0
  34. data/app/assets/images/content_types/file_extension_flv.png +0 -0
  35. data/app/assets/images/content_types/file_extension_gif.png +0 -0
  36. data/app/assets/images/content_types/file_extension_gz.png +0 -0
  37. data/app/assets/images/content_types/file_extension_hqx.png +0 -0
  38. data/app/assets/images/content_types/file_extension_htm.png +0 -0
  39. data/app/assets/images/content_types/file_extension_html.png +0 -0
  40. data/app/assets/images/content_types/file_extension_ifo.png +0 -0
  41. data/app/assets/images/content_types/file_extension_indd.png +0 -0
  42. data/app/assets/images/content_types/file_extension_iso.png +0 -0
  43. data/app/assets/images/content_types/file_extension_jar.png +0 -0
  44. data/app/assets/images/content_types/file_extension_jpeg.png +0 -0
  45. data/app/assets/images/content_types/file_extension_jpg.png +0 -0
  46. data/app/assets/images/content_types/file_extension_lnk.png +0 -0
  47. data/app/assets/images/content_types/file_extension_log.png +0 -0
  48. data/app/assets/images/content_types/file_extension_m4a.png +0 -0
  49. data/app/assets/images/content_types/file_extension_m4b.png +0 -0
  50. data/app/assets/images/content_types/file_extension_m4p.png +0 -0
  51. data/app/assets/images/content_types/file_extension_m4v.png +0 -0
  52. data/app/assets/images/content_types/file_extension_mcd.png +0 -0
  53. data/app/assets/images/content_types/file_extension_mdb.png +0 -0
  54. data/app/assets/images/content_types/file_extension_mid.png +0 -0
  55. data/app/assets/images/content_types/file_extension_mov.png +0 -0
  56. data/app/assets/images/content_types/file_extension_mp2.png +0 -0
  57. data/app/assets/images/content_types/file_extension_mp4.png +0 -0
  58. data/app/assets/images/content_types/file_extension_mpeg.png +0 -0
  59. data/app/assets/images/content_types/file_extension_mpg.png +0 -0
  60. data/app/assets/images/content_types/file_extension_msi.png +0 -0
  61. data/app/assets/images/content_types/file_extension_mswmm.png +0 -0
  62. data/app/assets/images/content_types/file_extension_ogg.png +0 -0
  63. data/app/assets/images/content_types/file_extension_pdf.png +0 -0
  64. data/app/assets/images/content_types/file_extension_php.png +0 -0
  65. data/app/assets/images/content_types/file_extension_png.png +0 -0
  66. data/app/assets/images/content_types/file_extension_pps.png +0 -0
  67. data/app/assets/images/content_types/file_extension_ps.png +0 -0
  68. data/app/assets/images/content_types/file_extension_psd.png +0 -0
  69. data/app/assets/images/content_types/file_extension_pst.png +0 -0
  70. data/app/assets/images/content_types/file_extension_ptb.png +0 -0
  71. data/app/assets/images/content_types/file_extension_pub.png +0 -0
  72. data/app/assets/images/content_types/file_extension_qbb.png +0 -0
  73. data/app/assets/images/content_types/file_extension_qbw.png +0 -0
  74. data/app/assets/images/content_types/file_extension_qxd.png +0 -0
  75. data/app/assets/images/content_types/file_extension_ram.png +0 -0
  76. data/app/assets/images/content_types/file_extension_rar.png +0 -0
  77. data/app/assets/images/content_types/file_extension_rb.png +0 -0
  78. data/app/assets/images/content_types/file_extension_rm.png +0 -0
  79. data/app/assets/images/content_types/file_extension_rmvb.png +0 -0
  80. data/app/assets/images/content_types/file_extension_rtf.png +0 -0
  81. data/app/assets/images/content_types/file_extension_sea.png +0 -0
  82. data/app/assets/images/content_types/file_extension_ses.png +0 -0
  83. data/app/assets/images/content_types/file_extension_sit.png +0 -0
  84. data/app/assets/images/content_types/file_extension_sitx.png +0 -0
  85. data/app/assets/images/content_types/file_extension_ss.png +0 -0
  86. data/app/assets/images/content_types/file_extension_swf.png +0 -0
  87. data/app/assets/images/content_types/file_extension_tgz.png +0 -0
  88. data/app/assets/images/content_types/file_extension_thm.png +0 -0
  89. data/app/assets/images/content_types/file_extension_tif.png +0 -0
  90. data/app/assets/images/content_types/file_extension_tmp.png +0 -0
  91. data/app/assets/images/content_types/file_extension_torrent.png +0 -0
  92. data/app/assets/images/content_types/file_extension_ttf.png +0 -0
  93. data/app/assets/images/content_types/file_extension_txt.png +0 -0
  94. data/app/assets/images/content_types/file_extension_vcd.png +0 -0
  95. data/app/assets/images/content_types/file_extension_vob.png +0 -0
  96. data/app/assets/images/content_types/file_extension_wav.png +0 -0
  97. data/app/assets/images/content_types/file_extension_wma.png +0 -0
  98. data/app/assets/images/content_types/file_extension_wmv.png +0 -0
  99. data/app/assets/images/content_types/file_extension_wps.png +0 -0
  100. data/app/assets/images/content_types/file_extension_xls.png +0 -0
  101. data/app/assets/images/content_types/file_extension_xpi.png +0 -0
  102. data/app/assets/images/content_types/file_extension_zip.png +0 -0
  103. data/app/assets/images/female.png +0 -0
  104. data/app/assets/images/gear.png +0 -0
  105. data/app/assets/images/male.png +0 -0
  106. data/app/assets/images/new.png +0 -0
  107. data/app/assets/images/rotate_left.png +0 -0
  108. data/app/assets/images/rotate_right.png +0 -0
  109. data/app/assets/javascripts/the_storages/image_crop.js.coffee +69 -0
  110. data/app/assets/javascripts/the_storages/water_mark_switcher.js.coffee +17 -0
  111. data/app/assets/stylesheets/the_storages.css.scss +117 -0
  112. data/app/controllers/concerns/attached_files_actions.rb +37 -0
  113. data/app/controllers/concerns/the_storages_image_processor.rb +20 -0
  114. data/app/helpers/attached_files_list_helper.rb +115 -0
  115. data/app/helpers/file_size_helper.rb +9 -0
  116. data/app/models/concerns/act_as_attached_file.rb +69 -0
  117. data/app/models/concerns/act_as_storage.rb +7 -27
  118. data/app/models/concerns/attachment_processing.rb +46 -0
  119. data/app/models/concerns/has_attached_files.rb +14 -0
  120. data/app/models/concerns/image_manipulation.rb +63 -0
  121. data/app/models/concerns/storage_image_processing.rb +90 -0
  122. data/app/models/concerns/watermark_fu.rb +97 -0
  123. data/app/models/delayed_image_processor.rb +6 -0
  124. data/app/views/the_storages/_form.haml +10 -18
  125. data/app/views/the_storages/_list.haml +5 -39
  126. data/config/initializers/paperclip.rb +39 -0
  127. data/config/locales/en.yml +5 -0
  128. data/config/locales/ru.yml +7 -0
  129. data/config/routes.rb +8 -0
  130. data/db/migrate/20130101010101_attached_files.rb +29 -0
  131. data/db/migrate/20130101010102_change_storages.rb +2 -2
  132. data/fonts.txt +1342 -0
  133. data/lib/generators/the_storages/USAGE +1 -20
  134. data/lib/generators/the_storages/templates/the_storages.rb +10 -0
  135. data/lib/generators/the_storages/the_storages_generator.rb +4 -21
  136. data/lib/the_storages.rb +32 -2
  137. data/lib/the_storages/config.rb +32 -0
  138. data/lib/the_storages/version.rb +1 -1
  139. data/the_storages.gemspec +1 -0
  140. data/vendor/assets/images/Jcrop.gif +0 -0
  141. data/vendor/assets/javascripts/jquery.Jcrop.js +1694 -0
  142. data/vendor/assets/stylesheets/jquery.Jcrop.css +165 -0
  143. metadata +154 -15
  144. data/app/helpers/the_storages_helper.rb +0 -25
  145. data/app/models/uploaded_file.rb +0 -113
  146. data/app/views/the_storages/_new.haml +0 -36
  147. data/db/migrate/20130101010101_uploaded_files.rb +0 -25
  148. data/lib/generators/the_storages/views_generator.rb +0 -43
@@ -1,36 +0,0 @@
1
- - uploaded_file = storage.uploaded_files.new
2
-
3
- :css
4
- .file_notice ul{
5
- margin-bottom:10px;
6
- padding:5px;
7
- border:1px dashed red;
8
- background-color: PeachPuff;
9
- }
10
- .file_notice ul li{
11
- font-weight:bold;
12
- list-style: disc outside none;
13
- margin-left: 20px;
14
- }
15
- #add_file_link a{
16
- background-color: PowderBlue;
17
- font-size: 16pt;
18
- padding:5px 15px;
19
- -moz-border-radius:5px;
20
- border: 1px solid Blue;
21
- }
22
- #add_file_link{
23
- margin-bottom:15px;
24
- }
25
-
26
- -#
27
- #add_file_link
28
- =link_to_function t('uploaded_files.show_upload_new_file_form'), "$('#upload_file_form').show();$('#add_file_link').hide()"
29
-
30
- - content_for :js do
31
- = javascript_include_tag "jqMultiUploads"
32
-
33
- #upload_file_form.form.overblock{:style => "background: #CCFFCC"}
34
- = form_for :uploaded_file, :url => uploaded_files_url(:subdomain=>@user.subdomain), :html => { :style => "background: #CCFFCC", :multipart => true, :method=>:post } do |f|
35
- = render :partial => 'uploaded_files/form', :locals => {:f => f, :uploaded_file=>uploaded_file, :button=>t('uploaded_files.create'), :storage=>storage}
36
-
@@ -1,25 +0,0 @@
1
- class UploadedFiles < ActiveRecord::Migration
2
- def change
3
- create_table :uploaded_files do |t|
4
- t.integer :user_id
5
- t.references :storage, polymorphic: true
6
-
7
- t.string :title, null: false
8
- t.string :state, default: :active
9
-
10
- # paperclip
11
- t.string :file_file_name
12
- t.string :file_content_type
13
- t.integer :file_file_size, default: 0
14
- t.datetime :file_updated_at
15
-
16
- # nested set
17
- t.integer :parent_id
18
- t.integer :lft
19
- t.integer :rgt
20
- t.integer :depth, default: 0
21
-
22
- t.timestamps
23
- end
24
- end
25
- end
@@ -1,43 +0,0 @@
1
- module TheStorages
2
- module Generators
3
- class ViewsGenerator < Rails::Generators::NamedBase
4
- source_root File.expand_path('../../../../app/views', __FILE__)
5
-
6
- def self.banner
7
- <<-BANNER.chomp
8
-
9
- bundle exec rails g the_storages:views assets
10
- bundle exec rails g the_storages:views views
11
- bundle exec rails g the_storages:views helper
12
-
13
- BANNER
14
- end
15
-
16
- def copy_sortable_tree_files
17
- copy_gem_files
18
- end
19
-
20
- private
21
-
22
- def param_name
23
- name.downcase
24
- end
25
-
26
- def copy_gem_files
27
- # if param_name == 'assets'
28
- # copy_file "../assets/javascripts/the_storages", "app/assets/javascripts/the_storages"
29
- # copy_file "../assets/stylesheets/the_storages", "app/assets/stylesheets/the_storages"
30
- # elsif param_name == 'views'
31
- # directory "../views/the_storages", "app/views/the_storages"
32
- # directory "../views/ip_black_lists", "app/views/ip_black_lists"
33
- # directory "../views/user_agent_black_lists", "app/views/user_agent_black_lists"
34
- # elsif param_name == 'helper'
35
- # copy_file "../helpers/render_comments_tree_helper.rb", "app/helpers/render_comments_tree_helper.rb"
36
- # else
37
- # puts "Wrong params - use only [assets | views | helper] values"
38
- # end
39
- end
40
-
41
- end
42
- end
43
- end