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
@@ -0,0 +1,165 @@
1
+ /* jquery.Jcrop.css v0.9.12 - MIT License */
2
+ /*
3
+ The outer-most container in a typical Jcrop instance
4
+ If you are having difficulty with formatting related to styles
5
+ on a parent element, place any fixes here or in a like selector
6
+
7
+ You can also style this element if you want to add a border, etc
8
+ A better method for styling can be seen below with .jcrop-light
9
+ (Add a class to the holder and style elements for that extended class)
10
+ */
11
+ .jcrop-holder {
12
+ direction: ltr;
13
+ text-align: left;
14
+ }
15
+ /* Selection Border */
16
+ .jcrop-vline,
17
+ .jcrop-hline {
18
+ background: #ffffff url("Jcrop.gif");
19
+ font-size: 0;
20
+ position: absolute;
21
+ }
22
+ .jcrop-vline {
23
+ height: 100%;
24
+ width: 1px !important;
25
+ }
26
+ .jcrop-vline.right {
27
+ right: 0;
28
+ }
29
+ .jcrop-hline {
30
+ height: 1px !important;
31
+ width: 100%;
32
+ }
33
+ .jcrop-hline.bottom {
34
+ bottom: 0;
35
+ }
36
+ /* Invisible click targets */
37
+ .jcrop-tracker {
38
+ height: 100%;
39
+ width: 100%;
40
+ /* "turn off" link highlight */
41
+ -webkit-tap-highlight-color: transparent;
42
+ /* disable callout, image save panel */
43
+ -webkit-touch-callout: none;
44
+ /* disable cut copy paste */
45
+ -webkit-user-select: none;
46
+ }
47
+ /* Selection Handles */
48
+ .jcrop-handle {
49
+ background-color: #333333;
50
+ border: 1px #eeeeee solid;
51
+ width: 7px;
52
+ height: 7px;
53
+ font-size: 1px;
54
+ }
55
+ .jcrop-handle.ord-n {
56
+ left: 50%;
57
+ margin-left: -4px;
58
+ margin-top: -4px;
59
+ top: 0;
60
+ }
61
+ .jcrop-handle.ord-s {
62
+ bottom: 0;
63
+ left: 50%;
64
+ margin-bottom: -4px;
65
+ margin-left: -4px;
66
+ }
67
+ .jcrop-handle.ord-e {
68
+ margin-right: -4px;
69
+ margin-top: -4px;
70
+ right: 0;
71
+ top: 50%;
72
+ }
73
+ .jcrop-handle.ord-w {
74
+ left: 0;
75
+ margin-left: -4px;
76
+ margin-top: -4px;
77
+ top: 50%;
78
+ }
79
+ .jcrop-handle.ord-nw {
80
+ left: 0;
81
+ margin-left: -4px;
82
+ margin-top: -4px;
83
+ top: 0;
84
+ }
85
+ .jcrop-handle.ord-ne {
86
+ margin-right: -4px;
87
+ margin-top: -4px;
88
+ right: 0;
89
+ top: 0;
90
+ }
91
+ .jcrop-handle.ord-se {
92
+ bottom: 0;
93
+ margin-bottom: -4px;
94
+ margin-right: -4px;
95
+ right: 0;
96
+ }
97
+ .jcrop-handle.ord-sw {
98
+ bottom: 0;
99
+ left: 0;
100
+ margin-bottom: -4px;
101
+ margin-left: -4px;
102
+ }
103
+ /* Dragbars */
104
+ .jcrop-dragbar.ord-n,
105
+ .jcrop-dragbar.ord-s {
106
+ height: 7px;
107
+ width: 100%;
108
+ }
109
+ .jcrop-dragbar.ord-e,
110
+ .jcrop-dragbar.ord-w {
111
+ height: 100%;
112
+ width: 7px;
113
+ }
114
+ .jcrop-dragbar.ord-n {
115
+ margin-top: -4px;
116
+ }
117
+ .jcrop-dragbar.ord-s {
118
+ bottom: 0;
119
+ margin-bottom: -4px;
120
+ }
121
+ .jcrop-dragbar.ord-e {
122
+ margin-right: -4px;
123
+ right: 0;
124
+ }
125
+ .jcrop-dragbar.ord-w {
126
+ margin-left: -4px;
127
+ }
128
+ /* The "jcrop-light" class/extension */
129
+ .jcrop-light .jcrop-vline,
130
+ .jcrop-light .jcrop-hline {
131
+ background: #ffffff;
132
+ filter: alpha(opacity=70) !important;
133
+ opacity: .70!important;
134
+ }
135
+ .jcrop-light .jcrop-handle {
136
+ -moz-border-radius: 3px;
137
+ -webkit-border-radius: 3px;
138
+ background-color: #000000;
139
+ border-color: #ffffff;
140
+ border-radius: 3px;
141
+ }
142
+ /* The "jcrop-dark" class/extension */
143
+ .jcrop-dark .jcrop-vline,
144
+ .jcrop-dark .jcrop-hline {
145
+ background: #000000;
146
+ filter: alpha(opacity=70) !important;
147
+ opacity: 0.7 !important;
148
+ }
149
+ .jcrop-dark .jcrop-handle {
150
+ -moz-border-radius: 3px;
151
+ -webkit-border-radius: 3px;
152
+ background-color: #ffffff;
153
+ border-color: #000000;
154
+ border-radius: 3px;
155
+ }
156
+ /* Simple macro to turn off the antlines */
157
+ .solid-line .jcrop-vline,
158
+ .solid-line .jcrop-hline {
159
+ background: #ffffff;
160
+ }
161
+ /* Fix for twitter bootstrap et al. */
162
+ .jcrop-holder img,
163
+ img.jcrop-preview {
164
+ max-width: none;
165
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: the_storages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-30 00:00:00.000000000 Z
12
+ date: 2013-08-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: state_machine
16
- requirement: &76205340 !ruby/object:Gem::Requirement
16
+ requirement: &79092130 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *76205340
24
+ version_requirements: *79092130
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: the_sortable_tree
27
- requirement: &76205130 !ruby/object:Gem::Requirement
27
+ requirement: &79091900 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,21 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *76205130
35
+ version_requirements: *79091900
36
+ - !ruby/object:Gem::Dependency
37
+ name: the_string_to_slug
38
+ requirement: &79091470 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: 0.0.6
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *79091470
36
47
  - !ruby/object:Gem::Dependency
37
48
  name: bundler
38
- requirement: &76204870 !ruby/object:Gem::Requirement
49
+ requirement: &79090900 !ruby/object:Gem::Requirement
39
50
  none: false
40
51
  requirements:
41
52
  - - ~>
@@ -43,10 +54,10 @@ dependencies:
43
54
  version: '1.3'
44
55
  type: :development
45
56
  prerelease: false
46
- version_requirements: *76204870
57
+ version_requirements: *79090900
47
58
  - !ruby/object:Gem::Dependency
48
59
  name: rake
49
- requirement: &76204660 !ruby/object:Gem::Requirement
60
+ requirement: &79090560 !ruby/object:Gem::Requirement
50
61
  none: false
51
62
  requirements:
52
63
  - - ! '>='
@@ -54,7 +65,7 @@ dependencies:
54
65
  version: '0'
55
66
  type: :development
56
67
  prerelease: false
57
- version_requirements: *76204660
68
+ version_requirements: *79090560
58
69
  description: ! 'TheStorages - act as file storage '
59
70
  email:
60
71
  - zykin-ilya@ya.ru
@@ -67,21 +78,149 @@ files:
67
78
  - LICENSE.txt
68
79
  - README.md
69
80
  - Rakefile
70
- - app/helpers/the_storages_helper.rb
81
+ - app/assets/images/content_types/default.jpg
82
+ - app/assets/images/content_types/file_extension_3gp.png
83
+ - app/assets/images/content_types/file_extension_7z.png
84
+ - app/assets/images/content_types/file_extension_ace.png
85
+ - app/assets/images/content_types/file_extension_ai.png
86
+ - app/assets/images/content_types/file_extension_aif.png
87
+ - app/assets/images/content_types/file_extension_aiff.png
88
+ - app/assets/images/content_types/file_extension_amr.png
89
+ - app/assets/images/content_types/file_extension_asf.png
90
+ - app/assets/images/content_types/file_extension_asx.png
91
+ - app/assets/images/content_types/file_extension_bat.png
92
+ - app/assets/images/content_types/file_extension_bin.png
93
+ - app/assets/images/content_types/file_extension_bmp.png
94
+ - app/assets/images/content_types/file_extension_bup.png
95
+ - app/assets/images/content_types/file_extension_cab.png
96
+ - app/assets/images/content_types/file_extension_cbr.png
97
+ - app/assets/images/content_types/file_extension_cda.png
98
+ - app/assets/images/content_types/file_extension_cdl.png
99
+ - app/assets/images/content_types/file_extension_cdr.png
100
+ - app/assets/images/content_types/file_extension_chm.png
101
+ - app/assets/images/content_types/file_extension_dat.png
102
+ - app/assets/images/content_types/file_extension_divx.png
103
+ - app/assets/images/content_types/file_extension_dll.png
104
+ - app/assets/images/content_types/file_extension_dmg.png
105
+ - app/assets/images/content_types/file_extension_doc.png
106
+ - app/assets/images/content_types/file_extension_docx.png
107
+ - app/assets/images/content_types/file_extension_dss.png
108
+ - app/assets/images/content_types/file_extension_dvf.png
109
+ - app/assets/images/content_types/file_extension_dwg.png
110
+ - app/assets/images/content_types/file_extension_eml.png
111
+ - app/assets/images/content_types/file_extension_eps.png
112
+ - app/assets/images/content_types/file_extension_exe.png
113
+ - app/assets/images/content_types/file_extension_fla.png
114
+ - app/assets/images/content_types/file_extension_flv.png
115
+ - app/assets/images/content_types/file_extension_gif.png
116
+ - app/assets/images/content_types/file_extension_gz.png
117
+ - app/assets/images/content_types/file_extension_hqx.png
118
+ - app/assets/images/content_types/file_extension_htm.png
119
+ - app/assets/images/content_types/file_extension_html.png
120
+ - app/assets/images/content_types/file_extension_ifo.png
121
+ - app/assets/images/content_types/file_extension_indd.png
122
+ - app/assets/images/content_types/file_extension_iso.png
123
+ - app/assets/images/content_types/file_extension_jar.png
124
+ - app/assets/images/content_types/file_extension_jpeg.png
125
+ - app/assets/images/content_types/file_extension_jpg.png
126
+ - app/assets/images/content_types/file_extension_lnk.png
127
+ - app/assets/images/content_types/file_extension_log.png
128
+ - app/assets/images/content_types/file_extension_m4a.png
129
+ - app/assets/images/content_types/file_extension_m4b.png
130
+ - app/assets/images/content_types/file_extension_m4p.png
131
+ - app/assets/images/content_types/file_extension_m4v.png
132
+ - app/assets/images/content_types/file_extension_mcd.png
133
+ - app/assets/images/content_types/file_extension_mdb.png
134
+ - app/assets/images/content_types/file_extension_mid.png
135
+ - app/assets/images/content_types/file_extension_mov.png
136
+ - app/assets/images/content_types/file_extension_mp2.png
137
+ - app/assets/images/content_types/file_extension_mp4.png
138
+ - app/assets/images/content_types/file_extension_mpeg.png
139
+ - app/assets/images/content_types/file_extension_mpg.png
140
+ - app/assets/images/content_types/file_extension_msi.png
141
+ - app/assets/images/content_types/file_extension_mswmm.png
142
+ - app/assets/images/content_types/file_extension_ogg.png
143
+ - app/assets/images/content_types/file_extension_pdf.png
144
+ - app/assets/images/content_types/file_extension_php.png
145
+ - app/assets/images/content_types/file_extension_png.png
146
+ - app/assets/images/content_types/file_extension_pps.png
147
+ - app/assets/images/content_types/file_extension_ps.png
148
+ - app/assets/images/content_types/file_extension_psd.png
149
+ - app/assets/images/content_types/file_extension_pst.png
150
+ - app/assets/images/content_types/file_extension_ptb.png
151
+ - app/assets/images/content_types/file_extension_pub.png
152
+ - app/assets/images/content_types/file_extension_qbb.png
153
+ - app/assets/images/content_types/file_extension_qbw.png
154
+ - app/assets/images/content_types/file_extension_qxd.png
155
+ - app/assets/images/content_types/file_extension_ram.png
156
+ - app/assets/images/content_types/file_extension_rar.png
157
+ - app/assets/images/content_types/file_extension_rb.png
158
+ - app/assets/images/content_types/file_extension_rm.png
159
+ - app/assets/images/content_types/file_extension_rmvb.png
160
+ - app/assets/images/content_types/file_extension_rtf.png
161
+ - app/assets/images/content_types/file_extension_sea.png
162
+ - app/assets/images/content_types/file_extension_ses.png
163
+ - app/assets/images/content_types/file_extension_sit.png
164
+ - app/assets/images/content_types/file_extension_sitx.png
165
+ - app/assets/images/content_types/file_extension_ss.png
166
+ - app/assets/images/content_types/file_extension_swf.png
167
+ - app/assets/images/content_types/file_extension_tgz.png
168
+ - app/assets/images/content_types/file_extension_thm.png
169
+ - app/assets/images/content_types/file_extension_tif.png
170
+ - app/assets/images/content_types/file_extension_tmp.png
171
+ - app/assets/images/content_types/file_extension_torrent.png
172
+ - app/assets/images/content_types/file_extension_ttf.png
173
+ - app/assets/images/content_types/file_extension_txt.png
174
+ - app/assets/images/content_types/file_extension_vcd.png
175
+ - app/assets/images/content_types/file_extension_vob.png
176
+ - app/assets/images/content_types/file_extension_wav.png
177
+ - app/assets/images/content_types/file_extension_wma.png
178
+ - app/assets/images/content_types/file_extension_wmv.png
179
+ - app/assets/images/content_types/file_extension_wps.png
180
+ - app/assets/images/content_types/file_extension_xls.png
181
+ - app/assets/images/content_types/file_extension_xpi.png
182
+ - app/assets/images/content_types/file_extension_zip.png
183
+ - app/assets/images/female.png
184
+ - app/assets/images/gear.png
185
+ - app/assets/images/male.png
186
+ - app/assets/images/new.png
187
+ - app/assets/images/rotate_left.png
188
+ - app/assets/images/rotate_right.png
189
+ - app/assets/javascripts/the_storages/image_crop.js.coffee
190
+ - app/assets/javascripts/the_storages/water_mark_switcher.js.coffee
191
+ - app/assets/stylesheets/the_storages.css.scss
192
+ - app/controllers/concerns/attached_files_actions.rb
193
+ - app/controllers/concerns/the_storages_image_processor.rb
194
+ - app/helpers/attached_files_list_helper.rb
195
+ - app/helpers/file_size_helper.rb
196
+ - app/models/concerns/act_as_attached_file.rb
71
197
  - app/models/concerns/act_as_storage.rb
72
- - app/models/uploaded_file.rb
198
+ - app/models/concerns/attachment_processing.rb
199
+ - app/models/concerns/has_attached_files.rb
200
+ - app/models/concerns/image_manipulation.rb
201
+ - app/models/concerns/storage_image_processing.rb
202
+ - app/models/concerns/watermark_fu.rb
203
+ - app/models/delayed_image_processor.rb
73
204
  - app/views/the_storages/_form.haml
74
205
  - app/views/the_storages/_lightbox_init.haml
75
206
  - app/views/the_storages/_list.haml
76
- - app/views/the_storages/_new.haml
77
- - db/migrate/20130101010101_uploaded_files.rb
207
+ - config/initializers/paperclip.rb
208
+ - config/locales/en.yml
209
+ - config/locales/ru.yml
210
+ - config/routes.rb
211
+ - db/migrate/20130101010101_attached_files.rb
78
212
  - db/migrate/20130101010102_change_storages.rb
213
+ - fonts.txt
79
214
  - lib/generators/the_storages/USAGE
215
+ - lib/generators/the_storages/templates/the_storages.rb
80
216
  - lib/generators/the_storages/the_storages_generator.rb
81
- - lib/generators/the_storages/views_generator.rb
82
217
  - lib/the_storages.rb
218
+ - lib/the_storages/config.rb
83
219
  - lib/the_storages/version.rb
84
220
  - the_storages.gemspec
221
+ - vendor/assets/images/Jcrop.gif
222
+ - vendor/assets/javascripts/jquery.Jcrop.js
223
+ - vendor/assets/stylesheets/jquery.Jcrop.css
85
224
  homepage: https://github.com/the-teacher
86
225
  licenses:
87
226
  - MIT
@@ -1,25 +0,0 @@
1
- module TheStoragesHelper
2
- def file_type_icon file
3
- case
4
- when file.is_doc? then
5
- image_tag('doctype/100x100/doc.jpg', :alt=>t('file_types.text_document'), :title=>t('file_types.text_document'))
6
- when file.is_txt? then
7
- image_tag('doctype/100x100/txt.jpg', :alt=>t('file_types.text_file'), :title=>t('file_types.text_file'))
8
- when file.is_ppt? then
9
- image_tag('doctype/100x100/ppt.jpg', :alt=>t('file_types.presentation'), :title=>t('file_types.presentation'))
10
- when file.is_xls? then
11
- image_tag('doctype/100x100/xls.jpg', :alt=>t('file_types.e_table'), :title=>t('file_types.e_table'))
12
- when file.is_pdf? then
13
- image_tag('doctype/100x100/pdf.jpg', :alt=>t('file_types.pdf'), :title=>t('file_types.pdf'))
14
- when file.is_psd? then
15
- image_tag('doctype/100x100/psd.jpg', :alt=>t('file_types.psd'), :title=>t('file_types.psd'))
16
- when file.is_media? then
17
- image_tag('doctype/100x100/media.jpg', :alt=>t('file_types.media'), :title=>t('file_types.media'))
18
- when file.is_arch? then
19
- image_tag('doctype/100x100/zip.jpg', :alt=>t('file_types.archive'), :title=>t('file_types.archive'))
20
- else
21
- image_tag 'doctype/100x100/default.jpg', :alt=>t('file_types.file'), :title=>t('file_types.file')
22
- end
23
- end#fn
24
-
25
- end
@@ -1,113 +0,0 @@
1
- class UploadedFile < ActiveRecord::Base
2
- include PublishedObject::InitMethod
3
- include PublishedObject::BasicStates
4
-
5
- belongs_to :user
6
- belongs_to :storage, :polymorphic => true
7
- acts_as_nested_set :scope => [:user_id, :storage_id, :storage_type]
8
-
9
- def to_param
10
- self.zip
11
- end
12
-
13
- has_attached_file :file,
14
- :url => Project::FILE_URL,
15
- :default_url=>Project::FILE_DEFAULT,
16
- :styles => { :normal => '600x400#', :std => '270x180#', :small => '100x100#', :mini => '50x50#', :micro => '25x25#' },
17
- :convert_options => { :all => "-strip" }
18
-
19
- validates :file_file_name, :uniqueness => {:message => I18n.translate('uploaded_files.uniqueness.file_name'), :scope=>[:user_id, :storage_type, :storage_id]}
20
- validates_attachment_size :file, :in => 10.bytes..2.megabytes, :message=>I18n.translate('uploaded_files.attachment_size')
21
-
22
- # FILTERS
23
- before_validation :generate_file_name
24
- before_destroy :update_storage
25
- after_create :update_storage
26
- after_update :update_storage
27
-
28
- def update_storage
29
- self.storage.save
30
- end
31
-
32
- def generate_file_name
33
- #file_name= self.title
34
- #self.title= self.file_title_filter(self.title)
35
- extension= File.extname(self.base_file_name).downcase
36
- file_name= File.basename(self.base_file_name, extension)
37
- file_name= self.file_name_filter(file_name)
38
- self.file.instance_write(:file_name, "#{file_name}#{extension}")
39
- end
40
-
41
- # functions for FILTERS
42
- # Russian.translit(' _ Иван _ Иванов ^@#$&№%*«»!?.,:;{}()<>_+|/~ Test ----').text_symbols2dash.underscore2dash.spaces2dash.strip_dashes.downcase
43
- # => "ivan-ivanov-test"
44
- def file_name_filter file_name
45
- return Russian.translit(file_name).text_symbols2dash.remove_quotes.underscore2dash.spaces2dash.strip_dashes.downcase
46
- end
47
-
48
- # '«Олимпиада для школьников» и новый год + снегурочка & Dead Moро$O;ff!!!'.text_symbols2dash.spaces2dash.strip_dashes.dashes2space
49
- # => "Олимпиада для школьников и новый год снегурочка Dead Moро O ff"
50
- def file_title_filter title
51
- return title.text_symbols2dash.remove_quotes.spaces2dash.strip_dashes.dashes2space
52
- end
53
-
54
- # HELPERS
55
- def full_filepath
56
- Project::ADDRESS + self.file.url.split('?').first
57
- end
58
-
59
- def to_textile_link
60
- "\"#{self.file_file_name}\":#{self.full_filepath}"
61
- end
62
-
63
- # FILE INFO METHODS
64
- def base_file_name
65
- self.file_file_name.to_s
66
- end
67
-
68
- def base_file_type
69
- self.file.content_type
70
- end
71
-
72
- # FILE TYPES METHODS
73
- def is_image?
74
- ['.gif','.jpeg','.jpg','.pjpeg','.png','.bmp'].include?(File.extname(base_file_name))
75
- end
76
-
77
- def need_thumb?
78
- is_image?
79
- end
80
-
81
- def is_doc?
82
- ['.doc', '.docx'].include?(File.extname(base_file_name))
83
- end
84
-
85
- def is_txt?
86
- ['text/plain'].include?(base_file_type)
87
- end
88
-
89
- def is_ppt?
90
- ['application/vnd.ms-powerpoint', 'application/x-ppt'].include?(base_file_type)
91
- end
92
-
93
- def is_xls?
94
- ['application/vnd.ms-excel'].include?(base_file_type)
95
- end
96
-
97
- def is_pdf?
98
- ['application/pdf'].include?(base_file_type)
99
- end
100
-
101
- def is_psd?
102
- ['.psd'].include?(File.extname(base_file_name))
103
- end
104
-
105
- def is_media?
106
- ['video/x-msvideo','audio/wav','application/x-wmf','video/mpeg','audio/mpeg','audio/mp3'].include?(base_file_type)
107
- end
108
-
109
- def is_arch?
110
- ['.zip','.rar','.gz','.tar'].include?(File.extname(base_file_name))
111
- end
112
-
113
- end