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.
- data/app/assets/images/content_types/default.jpg +0 -0
- data/app/assets/images/content_types/file_extension_3gp.png +0 -0
- data/app/assets/images/content_types/file_extension_7z.png +0 -0
- data/app/assets/images/content_types/file_extension_ace.png +0 -0
- data/app/assets/images/content_types/file_extension_ai.png +0 -0
- data/app/assets/images/content_types/file_extension_aif.png +0 -0
- data/app/assets/images/content_types/file_extension_aiff.png +0 -0
- data/app/assets/images/content_types/file_extension_amr.png +0 -0
- data/app/assets/images/content_types/file_extension_asf.png +0 -0
- data/app/assets/images/content_types/file_extension_asx.png +0 -0
- data/app/assets/images/content_types/file_extension_bat.png +0 -0
- data/app/assets/images/content_types/file_extension_bin.png +0 -0
- data/app/assets/images/content_types/file_extension_bmp.png +0 -0
- data/app/assets/images/content_types/file_extension_bup.png +0 -0
- data/app/assets/images/content_types/file_extension_cab.png +0 -0
- data/app/assets/images/content_types/file_extension_cbr.png +0 -0
- data/app/assets/images/content_types/file_extension_cda.png +0 -0
- data/app/assets/images/content_types/file_extension_cdl.png +0 -0
- data/app/assets/images/content_types/file_extension_cdr.png +0 -0
- data/app/assets/images/content_types/file_extension_chm.png +0 -0
- data/app/assets/images/content_types/file_extension_dat.png +0 -0
- data/app/assets/images/content_types/file_extension_divx.png +0 -0
- data/app/assets/images/content_types/file_extension_dll.png +0 -0
- data/app/assets/images/content_types/file_extension_dmg.png +0 -0
- data/app/assets/images/content_types/file_extension_doc.png +0 -0
- data/app/assets/images/content_types/file_extension_docx.png +0 -0
- data/app/assets/images/content_types/file_extension_dss.png +0 -0
- data/app/assets/images/content_types/file_extension_dvf.png +0 -0
- data/app/assets/images/content_types/file_extension_dwg.png +0 -0
- data/app/assets/images/content_types/file_extension_eml.png +0 -0
- data/app/assets/images/content_types/file_extension_eps.png +0 -0
- data/app/assets/images/content_types/file_extension_exe.png +0 -0
- data/app/assets/images/content_types/file_extension_fla.png +0 -0
- data/app/assets/images/content_types/file_extension_flv.png +0 -0
- data/app/assets/images/content_types/file_extension_gif.png +0 -0
- data/app/assets/images/content_types/file_extension_gz.png +0 -0
- data/app/assets/images/content_types/file_extension_hqx.png +0 -0
- data/app/assets/images/content_types/file_extension_htm.png +0 -0
- data/app/assets/images/content_types/file_extension_html.png +0 -0
- data/app/assets/images/content_types/file_extension_ifo.png +0 -0
- data/app/assets/images/content_types/file_extension_indd.png +0 -0
- data/app/assets/images/content_types/file_extension_iso.png +0 -0
- data/app/assets/images/content_types/file_extension_jar.png +0 -0
- data/app/assets/images/content_types/file_extension_jpeg.png +0 -0
- data/app/assets/images/content_types/file_extension_jpg.png +0 -0
- data/app/assets/images/content_types/file_extension_lnk.png +0 -0
- data/app/assets/images/content_types/file_extension_log.png +0 -0
- data/app/assets/images/content_types/file_extension_m4a.png +0 -0
- data/app/assets/images/content_types/file_extension_m4b.png +0 -0
- data/app/assets/images/content_types/file_extension_m4p.png +0 -0
- data/app/assets/images/content_types/file_extension_m4v.png +0 -0
- data/app/assets/images/content_types/file_extension_mcd.png +0 -0
- data/app/assets/images/content_types/file_extension_mdb.png +0 -0
- data/app/assets/images/content_types/file_extension_mid.png +0 -0
- data/app/assets/images/content_types/file_extension_mov.png +0 -0
- data/app/assets/images/content_types/file_extension_mp2.png +0 -0
- data/app/assets/images/content_types/file_extension_mp4.png +0 -0
- data/app/assets/images/content_types/file_extension_mpeg.png +0 -0
- data/app/assets/images/content_types/file_extension_mpg.png +0 -0
- data/app/assets/images/content_types/file_extension_msi.png +0 -0
- data/app/assets/images/content_types/file_extension_mswmm.png +0 -0
- data/app/assets/images/content_types/file_extension_ogg.png +0 -0
- data/app/assets/images/content_types/file_extension_pdf.png +0 -0
- data/app/assets/images/content_types/file_extension_php.png +0 -0
- data/app/assets/images/content_types/file_extension_png.png +0 -0
- data/app/assets/images/content_types/file_extension_pps.png +0 -0
- data/app/assets/images/content_types/file_extension_ps.png +0 -0
- data/app/assets/images/content_types/file_extension_psd.png +0 -0
- data/app/assets/images/content_types/file_extension_pst.png +0 -0
- data/app/assets/images/content_types/file_extension_ptb.png +0 -0
- data/app/assets/images/content_types/file_extension_pub.png +0 -0
- data/app/assets/images/content_types/file_extension_qbb.png +0 -0
- data/app/assets/images/content_types/file_extension_qbw.png +0 -0
- data/app/assets/images/content_types/file_extension_qxd.png +0 -0
- data/app/assets/images/content_types/file_extension_ram.png +0 -0
- data/app/assets/images/content_types/file_extension_rar.png +0 -0
- data/app/assets/images/content_types/file_extension_rb.png +0 -0
- data/app/assets/images/content_types/file_extension_rm.png +0 -0
- data/app/assets/images/content_types/file_extension_rmvb.png +0 -0
- data/app/assets/images/content_types/file_extension_rtf.png +0 -0
- data/app/assets/images/content_types/file_extension_sea.png +0 -0
- data/app/assets/images/content_types/file_extension_ses.png +0 -0
- data/app/assets/images/content_types/file_extension_sit.png +0 -0
- data/app/assets/images/content_types/file_extension_sitx.png +0 -0
- data/app/assets/images/content_types/file_extension_ss.png +0 -0
- data/app/assets/images/content_types/file_extension_swf.png +0 -0
- data/app/assets/images/content_types/file_extension_tgz.png +0 -0
- data/app/assets/images/content_types/file_extension_thm.png +0 -0
- data/app/assets/images/content_types/file_extension_tif.png +0 -0
- data/app/assets/images/content_types/file_extension_tmp.png +0 -0
- data/app/assets/images/content_types/file_extension_torrent.png +0 -0
- data/app/assets/images/content_types/file_extension_ttf.png +0 -0
- data/app/assets/images/content_types/file_extension_txt.png +0 -0
- data/app/assets/images/content_types/file_extension_vcd.png +0 -0
- data/app/assets/images/content_types/file_extension_vob.png +0 -0
- data/app/assets/images/content_types/file_extension_wav.png +0 -0
- data/app/assets/images/content_types/file_extension_wma.png +0 -0
- data/app/assets/images/content_types/file_extension_wmv.png +0 -0
- data/app/assets/images/content_types/file_extension_wps.png +0 -0
- data/app/assets/images/content_types/file_extension_xls.png +0 -0
- data/app/assets/images/content_types/file_extension_xpi.png +0 -0
- data/app/assets/images/content_types/file_extension_zip.png +0 -0
- data/app/assets/images/female.png +0 -0
- data/app/assets/images/gear.png +0 -0
- data/app/assets/images/male.png +0 -0
- data/app/assets/images/new.png +0 -0
- data/app/assets/images/rotate_left.png +0 -0
- data/app/assets/images/rotate_right.png +0 -0
- data/app/assets/javascripts/the_storages/image_crop.js.coffee +69 -0
- data/app/assets/javascripts/the_storages/water_mark_switcher.js.coffee +17 -0
- data/app/assets/stylesheets/the_storages.css.scss +117 -0
- data/app/controllers/concerns/attached_files_actions.rb +37 -0
- data/app/controllers/concerns/the_storages_image_processor.rb +20 -0
- data/app/helpers/attached_files_list_helper.rb +115 -0
- data/app/helpers/file_size_helper.rb +9 -0
- data/app/models/concerns/act_as_attached_file.rb +69 -0
- data/app/models/concerns/act_as_storage.rb +7 -27
- data/app/models/concerns/attachment_processing.rb +46 -0
- data/app/models/concerns/has_attached_files.rb +14 -0
- data/app/models/concerns/image_manipulation.rb +63 -0
- data/app/models/concerns/storage_image_processing.rb +90 -0
- data/app/models/concerns/watermark_fu.rb +97 -0
- data/app/models/delayed_image_processor.rb +6 -0
- data/app/views/the_storages/_form.haml +10 -18
- data/app/views/the_storages/_list.haml +5 -39
- data/config/initializers/paperclip.rb +39 -0
- data/config/locales/en.yml +5 -0
- data/config/locales/ru.yml +7 -0
- data/config/routes.rb +8 -0
- data/db/migrate/20130101010101_attached_files.rb +29 -0
- data/db/migrate/20130101010102_change_storages.rb +2 -2
- data/fonts.txt +1342 -0
- data/lib/generators/the_storages/USAGE +1 -20
- data/lib/generators/the_storages/templates/the_storages.rb +10 -0
- data/lib/generators/the_storages/the_storages_generator.rb +4 -21
- data/lib/the_storages.rb +32 -2
- data/lib/the_storages/config.rb +32 -0
- data/lib/the_storages/version.rb +1 -1
- data/the_storages.gemspec +1 -0
- data/vendor/assets/images/Jcrop.gif +0 -0
- data/vendor/assets/javascripts/jquery.Jcrop.js +1694 -0
- data/vendor/assets/stylesheets/jquery.Jcrop.css +165 -0
- metadata +154 -15
- data/app/helpers/the_storages_helper.rb +0 -25
- data/app/models/uploaded_file.rb +0 -113
- data/app/views/the_storages/_new.haml +0 -36
- data/db/migrate/20130101010101_uploaded_files.rb +0 -25
- 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
|