boxroom 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +50 -0
- data/Rakefile +36 -0
- data/app/assets/config/boxroom_manifest.js +2 -0
- data/app/assets/images/boxroom/clipboard.png +0 -0
- data/app/assets/images/boxroom/clipboard_add.png +0 -0
- data/app/assets/images/boxroom/copy.png +0 -0
- data/app/assets/images/boxroom/delete.png +0 -0
- data/app/assets/images/boxroom/edit.png +0 -0
- data/app/assets/images/boxroom/exclamation.png +0 -0
- data/app/assets/images/boxroom/extend.png +0 -0
- data/app/assets/images/boxroom/failed.png +0 -0
- data/app/assets/images/boxroom/file.png +0 -0
- data/app/assets/images/boxroom/file_add.png +0 -0
- data/app/assets/images/boxroom/fileicons/7z.png +0 -0
- data/app/assets/images/boxroom/fileicons/ai.png +0 -0
- data/app/assets/images/boxroom/fileicons/aif.png +0 -0
- data/app/assets/images/boxroom/fileicons/aiff.png +0 -0
- data/app/assets/images/boxroom/fileicons/audio.png +0 -0
- data/app/assets/images/boxroom/fileicons/bz2.png +0 -0
- data/app/assets/images/boxroom/fileicons/c.png +0 -0
- data/app/assets/images/boxroom/fileicons/conf.png +0 -0
- data/app/assets/images/boxroom/fileicons/cpp.png +0 -0
- data/app/assets/images/boxroom/fileicons/cs.png +0 -0
- data/app/assets/images/boxroom/fileicons/css.png +0 -0
- data/app/assets/images/boxroom/fileicons/csv.png +0 -0
- data/app/assets/images/boxroom/fileicons/divx.png +0 -0
- data/app/assets/images/boxroom/fileicons/doc.png +0 -0
- data/app/assets/images/boxroom/fileicons/docx.png +0 -0
- data/app/assets/images/boxroom/fileicons/dot.png +0 -0
- data/app/assets/images/boxroom/fileicons/fla.png +0 -0
- data/app/assets/images/boxroom/fileicons/gif.png +0 -0
- data/app/assets/images/boxroom/fileicons/gz.png +0 -0
- data/app/assets/images/boxroom/fileicons/htm.png +0 -0
- data/app/assets/images/boxroom/fileicons/html.png +0 -0
- data/app/assets/images/boxroom/fileicons/image.png +0 -0
- data/app/assets/images/boxroom/fileicons/java.png +0 -0
- data/app/assets/images/boxroom/fileicons/jpeg.png +0 -0
- data/app/assets/images/boxroom/fileicons/jpg.png +0 -0
- data/app/assets/images/boxroom/fileicons/js.png +0 -0
- data/app/assets/images/boxroom/fileicons/mdb.png +0 -0
- data/app/assets/images/boxroom/fileicons/mdbx.png +0 -0
- data/app/assets/images/boxroom/fileicons/mov.png +0 -0
- data/app/assets/images/boxroom/fileicons/mp3.png +0 -0
- data/app/assets/images/boxroom/fileicons/mpg.png +0 -0
- data/app/assets/images/boxroom/fileicons/ogg.png +0 -0
- data/app/assets/images/boxroom/fileicons/pdf.png +0 -0
- data/app/assets/images/boxroom/fileicons/php.png +0 -0
- data/app/assets/images/boxroom/fileicons/pl.png +0 -0
- data/app/assets/images/boxroom/fileicons/png.png +0 -0
- data/app/assets/images/boxroom/fileicons/ppt.png +0 -0
- data/app/assets/images/boxroom/fileicons/pptx.png +0 -0
- data/app/assets/images/boxroom/fileicons/ps.png +0 -0
- data/app/assets/images/boxroom/fileicons/py.png +0 -0
- data/app/assets/images/boxroom/fileicons/ram.png +0 -0
- data/app/assets/images/boxroom/fileicons/rar.png +0 -0
- data/app/assets/images/boxroom/fileicons/rb.png +0 -0
- data/app/assets/images/boxroom/fileicons/rm.png +0 -0
- data/app/assets/images/boxroom/fileicons/rtf.png +0 -0
- data/app/assets/images/boxroom/fileicons/sql.png +0 -0
- data/app/assets/images/boxroom/fileicons/swf.png +0 -0
- data/app/assets/images/boxroom/fileicons/tar.png +0 -0
- data/app/assets/images/boxroom/fileicons/tgz.png +0 -0
- data/app/assets/images/boxroom/fileicons/txt.png +0 -0
- data/app/assets/images/boxroom/fileicons/video.png +0 -0
- data/app/assets/images/boxroom/fileicons/wav.png +0 -0
- data/app/assets/images/boxroom/fileicons/wma.png +0 -0
- data/app/assets/images/boxroom/fileicons/wmv.png +0 -0
- data/app/assets/images/boxroom/fileicons/xls.png +0 -0
- data/app/assets/images/boxroom/fileicons/xlsx.png +0 -0
- data/app/assets/images/boxroom/fileicons/xml.png +0 -0
- data/app/assets/images/boxroom/fileicons/xvid.png +0 -0
- data/app/assets/images/boxroom/fileicons/zip.png +0 -0
- data/app/assets/images/boxroom/folder.png +0 -0
- data/app/assets/images/boxroom/folder_add.png +0 -0
- data/app/assets/images/boxroom/group.png +0 -0
- data/app/assets/images/boxroom/group_add.png +0 -0
- data/app/assets/images/boxroom/group_grey.png +0 -0
- data/app/assets/images/boxroom/information.png +0 -0
- data/app/assets/images/boxroom/logo.png +0 -0
- data/app/assets/images/boxroom/move.png +0 -0
- data/app/assets/images/boxroom/permissions.png +0 -0
- data/app/assets/images/boxroom/share.png +0 -0
- data/app/assets/images/boxroom/spinner.gif +0 -0
- data/app/assets/images/boxroom/tick.png +0 -0
- data/app/assets/images/boxroom/user.png +0 -0
- data/app/assets/images/boxroom/user_add.png +0 -0
- data/app/assets/javascripts/boxroom/application.js.coffee +51 -0
- data/app/assets/javascripts/boxroom/files.js.coffee +33 -0
- data/app/assets/stylesheets/boxroom/application.scss +7 -0
- data/app/concepts/boxroom/base_cell.rb +7 -0
- data/app/concepts/boxroom/folder/cell/show.rb +25 -0
- data/app/concepts/boxroom/folder/view/show.erb +69 -0
- data/app/concepts/boxroom/search/contract/files_and_folders.rb +9 -0
- data/app/concepts/boxroom/search/operations/files_and_folders.rb +21 -0
- data/app/controllers/boxroom/admins_controller.rb +30 -0
- data/app/controllers/boxroom/application_controller.rb +5 -0
- data/app/controllers/boxroom/clipboard_controller.rb +87 -0
- data/app/controllers/boxroom/files_controller.rb +78 -0
- data/app/controllers/boxroom/folders_controller.rb +91 -0
- data/app/controllers/boxroom/groups_controller.rb +60 -0
- data/app/controllers/boxroom/permissions_controller.rb +19 -0
- data/app/controllers/boxroom/reset_password_controller.rb +45 -0
- data/app/controllers/boxroom/search_controller.rb +21 -0
- data/app/controllers/boxroom/sessions_controller.rb +48 -0
- data/app/controllers/boxroom/share_links_controller.rb +67 -0
- data/app/controllers/boxroom/signup_controller.rb +31 -0
- data/app/controllers/boxroom/users_controller.rb +75 -0
- data/app/controllers/concerns/boxroom/base_controller.rb +92 -0
- data/app/helpers/boxroom/application_helper.rb +4 -0
- data/app/helpers/boxroom/folders_helper.rb +17 -0
- data/app/jobs/boxroom/application_job.rb +4 -0
- data/app/mailers/boxroom/application_mailer.rb +6 -0
- data/app/mailers/boxroom/user_mailer.rb +18 -0
- data/app/models/boxroom/application_record.rb +5 -0
- data/app/models/boxroom/clipboard.rb +45 -0
- data/app/models/boxroom/folder.rb +113 -0
- data/app/models/boxroom/group.rb +57 -0
- data/app/models/boxroom/permission.rb +6 -0
- data/app/models/boxroom/permitted_params.rb +33 -0
- data/app/models/boxroom/share_link.rb +40 -0
- data/app/models/boxroom/user.rb +113 -0
- data/app/models/boxroom/user_file.rb +35 -0
- data/app/views/boxroom/admins/new.html.erb +42 -0
- data/app/views/boxroom/clipboard/_clipboard_empty.de.html.erb +2 -0
- data/app/views/boxroom/clipboard/_clipboard_empty.en.html.erb +2 -0
- data/app/views/boxroom/clipboard/_clipboard_empty.es.html.erb +2 -0
- data/app/views/boxroom/clipboard/_clipboard_empty.fr.html.erb +2 -0
- data/app/views/boxroom/clipboard/_clipboard_empty.it.html.erb +2 -0
- data/app/views/boxroom/clipboard/_clipboard_empty.nl.html.erb +2 -0
- data/app/views/boxroom/clipboard/_clipboard_empty.zh-CN.html.erb +2 -0
- data/app/views/boxroom/clipboard/_show.html.erb +72 -0
- data/app/views/boxroom/files/edit.html.erb +24 -0
- data/app/views/boxroom/files/new.html.erb +45 -0
- data/app/views/boxroom/folders/_form.html.erb +19 -0
- data/app/views/boxroom/folders/edit.html.erb +6 -0
- data/app/views/boxroom/folders/new.html.erb +6 -0
- data/app/views/boxroom/folders/show.html.erb +69 -0
- data/app/views/boxroom/groups/_form.html.erb +21 -0
- data/app/views/boxroom/groups/edit.html.erb +4 -0
- data/app/views/boxroom/groups/index.html.erb +42 -0
- data/app/views/boxroom/groups/new.html.erb +4 -0
- data/app/views/boxroom/permissions/_form.html.erb +46 -0
- data/app/views/boxroom/reset_password/_message.de.html.erb +2 -0
- data/app/views/boxroom/reset_password/_message.en.html.erb +2 -0
- data/app/views/boxroom/reset_password/_message.es.html.erb +2 -0
- data/app/views/boxroom/reset_password/_message.fr.html.erb +2 -0
- data/app/views/boxroom/reset_password/_message.it.html.erb +2 -0
- data/app/views/boxroom/reset_password/_message.nl.html.erb +2 -0
- data/app/views/boxroom/reset_password/_message.zh-CN.html.erb +2 -0
- data/app/views/boxroom/reset_password/edit.html.erb +30 -0
- data/app/views/boxroom/reset_password/new.html.erb +22 -0
- data/app/views/boxroom/search/show.html.erb +15 -0
- data/app/views/boxroom/sessions/new.html.erb +31 -0
- data/app/views/boxroom/share_links/index.html.erb +24 -0
- data/app/views/boxroom/share_links/new.html.erb +49 -0
- data/app/views/boxroom/shared/_footer.html.erb +9 -0
- data/app/views/boxroom/shared/_header.html.erb +45 -0
- data/app/views/boxroom/signup/edit.html.erb +42 -0
- data/app/views/boxroom/user_mailer/reset_password_email.de.text.erb +18 -0
- data/app/views/boxroom/user_mailer/reset_password_email.en.text.erb +17 -0
- data/app/views/boxroom/user_mailer/reset_password_email.es.text.erb +17 -0
- data/app/views/boxroom/user_mailer/reset_password_email.fr.text.erb +17 -0
- data/app/views/boxroom/user_mailer/reset_password_email.it.text.erb +17 -0
- data/app/views/boxroom/user_mailer/reset_password_email.nl.text.erb +17 -0
- data/app/views/boxroom/user_mailer/reset_password_email.zh-CN.text.erb +16 -0
- data/app/views/boxroom/user_mailer/share_link_email.de.text.erb +20 -0
- data/app/views/boxroom/user_mailer/share_link_email.en.text.erb +20 -0
- data/app/views/boxroom/user_mailer/share_link_email.es.text.erb +20 -0
- data/app/views/boxroom/user_mailer/share_link_email.fr.text.erb +20 -0
- data/app/views/boxroom/user_mailer/share_link_email.it.text.erb +20 -0
- data/app/views/boxroom/user_mailer/share_link_email.nl.text.erb +20 -0
- data/app/views/boxroom/user_mailer/share_link_email.zh-CN.text.erb +20 -0
- data/app/views/boxroom/user_mailer/signup_email.de.text.erb +9 -0
- data/app/views/boxroom/user_mailer/signup_email.en.text.erb +9 -0
- data/app/views/boxroom/user_mailer/signup_email.es.text.erb +9 -0
- data/app/views/boxroom/user_mailer/signup_email.fr.text.erb +9 -0
- data/app/views/boxroom/user_mailer/signup_email.it.text.erb +9 -0
- data/app/views/boxroom/user_mailer/signup_email.nl.text.erb +10 -0
- data/app/views/boxroom/user_mailer/signup_email.zh-CN.text.erb +8 -0
- data/app/views/boxroom/users/_form.html.erb +63 -0
- data/app/views/boxroom/users/edit.html.erb +4 -0
- data/app/views/boxroom/users/index.html.erb +68 -0
- data/app/views/boxroom/users/new.html.erb +4 -0
- data/app/views/layouts/boxroom/application.html.erb +37 -0
- data/config/locales/de.yml +414 -0
- data/config/locales/en.yml +407 -0
- data/config/locales/es.yml +403 -0
- data/config/locales/fr.yml +403 -0
- data/config/locales/it.yml +414 -0
- data/config/locales/nl.yml +408 -0
- data/config/locales/zh-CN.yml +406 -0
- data/config/routes.rb +44 -0
- data/db/migrate/20100930062939_boxroom_create_users.rb +20 -0
- data/db/migrate/20100930091426_boxroom_create_folders.rb +14 -0
- data/db/migrate/20100930091451_boxroom_create_groups.rb +12 -0
- data/db/migrate/20101002122244_boxroom_create_user_files.rb +17 -0
- data/db/migrate/20101005071402_boxroom_create_permissions.rb +16 -0
- data/db/migrate/20101005071508_boxroom_create_groups_users.rb +12 -0
- data/db/migrate/20110106045148_boxroom_drop_column_user_id_from_folders.rb +9 -0
- data/db/migrate/20110106045414_boxroom_drop_column_user_id_from_user_files.rb +9 -0
- data/db/migrate/20110529123402_boxroom_drop_column_access_key_from_users.rb +9 -0
- data/db/migrate/20110616215033_boxroom_create_share_links.rb +15 -0
- data/db/migrate/20120411075110_boxroom_add_column_signup_token_to_users.rb +8 -0
- data/db/migrate/20120411081345_boxroom_add_column_signup_token_expires_at_to_users.rb +7 -0
- data/db/migrate/20130626210927_boxroom_add_columns_message_user_id_to_share_links.rb +6 -0
- data/db/migrate/20130628082245_boxroom_populate_user_id_in_share_links.rb +9 -0
- data/lib/boxroom.rb +35 -0
- data/lib/boxroom/configuration.rb +18 -0
- data/lib/boxroom/engine.rb +9 -0
- data/lib/boxroom/version.rb +3 -0
- data/lib/paperclip/spoof_detector.rb +7 -0
- data/lib/tasks/boxroom_tasks.rake +4 -0
- metadata +481 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c2880e8cbf77046ee1a85d7e8c90ef4d23ee8eb9
|
4
|
+
data.tar.gz: 1a16a26b69b0a3aeff0cd675fb4bc208ce8a0e7a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 30667822ead5fb3c58dda87d3b7086a490efc9193baf25baf7cf43759e4249dd3432e96fc4eace5292003bbfe86ad42f3923ab4f27658d6795f544c797b60352
|
7
|
+
data.tar.gz: 3c003390bc80cacd838dd2b14872338e8151fb102fe4ac3e4d17eac04c088d2ccf3bf2722fac28683ec31b7eaeb4edb4ac309da49b940421c4c9f1b8e43c3e6b
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2018 Serge Koba
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# Boxroom
|
2
|
+
This is a Rails engine built based on code of [Boxroom](https://github.com/mischa78/boxroom) project.
|
3
|
+
|
4
|
+
# Features
|
5
|
+
It aims to be a simple interface for managing and
|
6
|
+
sharing files in a web browser. It lets users create folders and upload, download
|
7
|
+
and share files. Admins can manage users, groups and permissions.
|
8
|
+
|
9
|
+
![Boxroom](https://res.cloudinary.com/skoba/image/upload/v1518819948/Boxroom_vzqhre.png)
|
10
|
+
|
11
|
+
## Install
|
12
|
+
- add to Gemfile `gem 'boxroom', github: 'sergey-koba-mobidev/boxroom-engine'`
|
13
|
+
- run `rails boxroom:install:migrations`
|
14
|
+
- run `rails db:migrate`
|
15
|
+
- mount engine in `config/routes.rb`
|
16
|
+
```ruby
|
17
|
+
mount Boxroom::Engine => "/boxroom"
|
18
|
+
```
|
19
|
+
|
20
|
+
## Config
|
21
|
+
- Create `config/initializers/boxroom.rb`
|
22
|
+
```ruby
|
23
|
+
Boxroom.configure do |config|
|
24
|
+
config.site_name = 'Boxroom'
|
25
|
+
config.logo = 'boxroom/logo.png'
|
26
|
+
config.uploads_path = 'uploads'
|
27
|
+
config.show_footer = true
|
28
|
+
config.show_users = true
|
29
|
+
config.show_groups = true
|
30
|
+
config.show_settings = true
|
31
|
+
config.show_shared_files = true
|
32
|
+
config.sign_out_path = nil # pass string to redirect to after sign out. '/dashboard' for example
|
33
|
+
end
|
34
|
+
```
|
35
|
+
|
36
|
+
## Contributing
|
37
|
+
Please feel free to leave an issue or PR.
|
38
|
+
|
39
|
+
## Testing
|
40
|
+
- run migrations `bin/rails db:migrate RAILS_ENV=test`
|
41
|
+
- run tests `bin/rails test`
|
42
|
+
|
43
|
+
## License
|
44
|
+
The engine is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
45
|
+
|
46
|
+
## Roadmap:
|
47
|
+
- tests for search
|
48
|
+
- tag files
|
49
|
+
- integrate with existing user model
|
50
|
+
- support s3
|
data/Rakefile
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'Boxroom'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
|
21
|
+
load 'rails/tasks/statistics.rake'
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
require 'bundler/gem_tasks'
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
30
|
+
t.libs << 'test'
|
31
|
+
t.pattern = 'test/**/*_test.rb'
|
32
|
+
t.verbose = false
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
task default: :test
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,51 @@
|
|
1
|
+
//= require jquery
|
2
|
+
//= require jquery_ujs
|
3
|
+
//= require jquery-fileupload/basic
|
4
|
+
//= require jquery-fileupload/vendor/tmpl
|
5
|
+
//= require_self
|
6
|
+
//= require_tree .
|
7
|
+
|
8
|
+
$(window).load ->
|
9
|
+
fadeout '#notice'
|
10
|
+
fadeout '#alert'
|
11
|
+
|
12
|
+
jQuery ->
|
13
|
+
$('.back_link').on 'click', (e) ->
|
14
|
+
e.preventDefault()
|
15
|
+
show_element '#files_and_folders'
|
16
|
+
|
17
|
+
$('.permissions_link').on 'click', (e) ->
|
18
|
+
e.preventDefault()
|
19
|
+
show_element '#permissions'
|
20
|
+
|
21
|
+
$('.clipboard_link').on 'click', (e) ->
|
22
|
+
e.preventDefault()
|
23
|
+
show_element '#clipboard'
|
24
|
+
|
25
|
+
$('.emails_to_share_with').on 'change', (e) ->
|
26
|
+
update_counter e.target
|
27
|
+
|
28
|
+
$('.emails_to_share_with').on 'keyup', (e) ->
|
29
|
+
update_counter e.target
|
30
|
+
|
31
|
+
fadeout = (el) ->
|
32
|
+
$(el).delay(3000).fadeOut('slow')
|
33
|
+
|
34
|
+
show_element = (el) ->
|
35
|
+
el = '#files_and_folders' if $(el).is(':visible')
|
36
|
+
|
37
|
+
elements = ['#files_and_folders', '#permissions', '#clipboard']
|
38
|
+
elements.splice elements.indexOf(el), 1
|
39
|
+
hide_elements elements
|
40
|
+
|
41
|
+
$(el).slideDown('slow')
|
42
|
+
$("#{el}_link").removeClass('folder_menu').addClass('highlight')
|
43
|
+
|
44
|
+
hide_elements = (elements) ->
|
45
|
+
for element in elements
|
46
|
+
$(element).slideUp('slow') if $(element).is(':visible')
|
47
|
+
$("#{element}_link").removeClass('highlight').addClass('folder_menu')
|
48
|
+
|
49
|
+
update_counter = (el) ->
|
50
|
+
$('#counter').html el.value.length
|
51
|
+
$('#counter').css 'color', if el.value.length > 255 then '#F00' else '#000'
|
@@ -0,0 +1,33 @@
|
|
1
|
+
jQuery ->
|
2
|
+
$('#new_user_file').fileupload
|
3
|
+
dataType: 'script'
|
4
|
+
maxChunkSize: 8388608 # 8 MB
|
5
|
+
add: (e, data) ->
|
6
|
+
$('#attachment').prop('disabled', true)
|
7
|
+
$('#user_file_attachment').prop('disabled', true)
|
8
|
+
file = data.files[0]
|
9
|
+
folder = $('#target_folder_id').val()
|
10
|
+
$.getJSON document.location.pathname.split('/folders')[0] + "/file_exists?name=#{encodeURIComponent(file.name)}&folder=#{encodeURIComponent(folder)}", (exists) ->
|
11
|
+
data.context = $(tmpl("template-upload", file).trim())
|
12
|
+
$('#progress').append(data.context)
|
13
|
+
if exists
|
14
|
+
data.context.find('.spinner').hide()
|
15
|
+
data.context.find('.failed').show()
|
16
|
+
data.context.find('.percentage').hide()
|
17
|
+
data.context.find('.exists_message').show()
|
18
|
+
$('#user_file_attachment').prop('disabled', false)
|
19
|
+
else
|
20
|
+
data.submit()
|
21
|
+
progress: (e, data) ->
|
22
|
+
if data.context
|
23
|
+
progress = parseInt(data.loaded / data.total * 100)
|
24
|
+
data.context.find('.percentage').html("#{progress}%")
|
25
|
+
if data.loaded == data.total
|
26
|
+
data.context.find('.spinner').hide()
|
27
|
+
data.context.find('.tick').show()
|
28
|
+
progressall: (e, data) ->
|
29
|
+
if data.loaded == data.total
|
30
|
+
$('#server_wait').show()
|
31
|
+
stop: (e) ->
|
32
|
+
folder = $('#target_folder_id').val()
|
33
|
+
window.location.href = document.location.pathname.split('/folders')[0] + "/folders/#{folder}"
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Boxroom
|
2
|
+
module Folder::Cell
|
3
|
+
class Show < BaseCell
|
4
|
+
include ActionView::Helpers::NumberHelper
|
5
|
+
include Boxroom::FoldersHelper
|
6
|
+
|
7
|
+
def folders
|
8
|
+
@options[:folders] || []
|
9
|
+
end
|
10
|
+
|
11
|
+
def files
|
12
|
+
@options[:files] || []
|
13
|
+
end
|
14
|
+
|
15
|
+
def current_user
|
16
|
+
@options[:current_user]
|
17
|
+
end
|
18
|
+
|
19
|
+
def folder
|
20
|
+
model
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<table class="table">
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<th></th>
|
5
|
+
<th><%= t :name %></th>
|
6
|
+
<th><%= t :size %></th>
|
7
|
+
<th><%= t :date_modified %></th>
|
8
|
+
<th></th>
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
<tbody>
|
12
|
+
<% if folder.present? && !folder.is_root? -%>
|
13
|
+
<tr class="<%= cycle('even', 'odd') %>">
|
14
|
+
<td><span class="icon is-small"><i class="fa fa-folder-o"></i></span></td>
|
15
|
+
<td class="file_name">↑ <%= link_to t(:up), folder.parent, title: folder.parent.name %></td>
|
16
|
+
<td class="file_size">--</td>
|
17
|
+
<td class="file_modified">--</td>
|
18
|
+
<td></td>
|
19
|
+
</tr>
|
20
|
+
<% end -%>
|
21
|
+
<% folders.each do |folder| -%>
|
22
|
+
<% if current_user.can_read(folder) -%>
|
23
|
+
<tr class="<%= cycle('even', 'odd') %>">
|
24
|
+
<td><span class="icon is-small"><i class="fa fa-folder-o"></i></span></td>
|
25
|
+
<td class="file_name"><%= link_to folder.name, folder %></td>
|
26
|
+
<td class="file_size">--</td>
|
27
|
+
<td class="file_modified"><%= l folder.updated_at, :format => :short %></td>
|
28
|
+
<td>
|
29
|
+
<% if current_user.can_update(folder) -%>
|
30
|
+
<%= link_to '<span class="icon is-small"><i class="fa fa-edit"></i></span>', edit_folder_path(folder), title: t(:edit) %>
|
31
|
+
<% end -%>
|
32
|
+
<% if current_user.can_delete(folder) -%>
|
33
|
+
<%= link_to '<span class="icon is-small"><i class="fa fa-remove"></i></span>', folder, method: :delete, data: {confirm: t(:are_you_sure)}, title: t(:delete_item) %>
|
34
|
+
<% end -%>
|
35
|
+
<%= link_to '<span class="icon is-small"><i class="fa fa-clipboard"></i></span>',
|
36
|
+
{controller: :clipboard, action: :create, id: folder.id, type: 'folder', folder_id: @folder, authenticity_token: form_authenticity_token},
|
37
|
+
method: :post, title: t(:add_to_clipboard)
|
38
|
+
%>
|
39
|
+
</td>
|
40
|
+
</tr>
|
41
|
+
<% end -%>
|
42
|
+
<% end -%>
|
43
|
+
<% files.each do |file| -%>
|
44
|
+
<% if current_user.can_read(file.folder) -%>
|
45
|
+
<tr class="<%= cycle('even', 'odd') %>">
|
46
|
+
<td><%= image_tag(file_icon(file.extension)) %></td>
|
47
|
+
<td class="file_name"><%= link_to file.attachment_file_name, file_path(file), :title => "#{t(:download)} #{file.attachment_file_name}" %></td>
|
48
|
+
<td class="file_size"><%= number_to_human_size(file.attachment_file_size, :locale => I18n.locale) %></td>
|
49
|
+
<td class="file_modified"><%= l file.updated_at, :format => :short %></td>
|
50
|
+
<td>
|
51
|
+
<% if current_user.can_update(file.folder) -%>
|
52
|
+
<%= link_to '<span class="icon is-small"><i class="fa fa-edit"></i></span>', edit_file_path(file), title: t(:edit) %>
|
53
|
+
<% end -%>
|
54
|
+
<% if current_user.can_delete(file.folder) -%>
|
55
|
+
<%= link_to '<span class="icon is-small"><i class="fa fa-remove"></i></span>', file_path(file), method: :delete, data: {confirm: t(:are_you_sure)}, title: t(:delete_item) %>
|
56
|
+
<% end -%>
|
57
|
+
<%= link_to '<span class="icon is-small"><i class="fa fa-clipboard"></i></span>',
|
58
|
+
{controller: :clipboard, action: :create, id: file.id, type: 'file', folder_id: file.folder, authenticity_token: form_authenticity_token},
|
59
|
+
method: :post, title: t(:add_to_clipboard)
|
60
|
+
%>
|
61
|
+
<% if Boxroom.configuration.show_shared_files %>
|
62
|
+
<%= link_to '<span class="icon is-small"><i class="fa fa-share"></i></span>', new_file_share_link_path(file), title: t(:share) %>
|
63
|
+
<% end %>
|
64
|
+
</td>
|
65
|
+
</tr>
|
66
|
+
<% end -%>
|
67
|
+
<% end -%>
|
68
|
+
</tbody>
|
69
|
+
</table>
|