foreman_packages 1.0.10 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/assets/javascripts/application.js +14 -0
- data/app/assets/javascripts/jquery.fileupload.js +904 -0
- data/app/controllers/foreman_packages/syattachments_controller.rb +93 -0
- data/app/controllers/foreman_packages/sypackagemodels_controller.rb +90 -0
- data/app/controllers/foreman_packages/sypackages_controller.rb +16 -13
- data/app/models/foreman_packages/syattachment.rb +10 -0
- data/app/models/foreman_packages/sypackage.rb +69 -72
- data/app/models/foreman_packages/sypackagemodel.rb +83 -0
- data/app/uploaders/foreman_packages/avatar_uploader.rb +16 -0
- data/app/views/foreman_packages/syattachments/_form.html.erb +19 -0
- data/app/views/foreman_packages/syattachments/_syattachment.html.erb +3 -0
- data/app/views/foreman_packages/syattachments/_syattachment_td.html.erb +9 -0
- data/app/views/foreman_packages/syattachments/edit.html.erb +1 -0
- data/app/views/foreman_packages/syattachments/index.html.erb +22 -0
- data/app/views/foreman_packages/syattachments/new.html.erb +1 -0
- data/app/views/foreman_packages/syattachments/show.html.erb +30 -0
- data/app/views/foreman_packages/sypackagemodels/_form.html.erb +24 -0
- data/app/views/foreman_packages/sypackagemodels/_list.html.erb +41 -0
- data/app/views/foreman_packages/sypackagemodels/edit.html.erb +1 -0
- data/app/views/foreman_packages/sypackagemodels/index.html.erb +5 -0
- data/app/views/foreman_packages/sypackagemodels/new.html.erb +1 -0
- data/app/views/foreman_packages/sypackagemodels/show.html.erb +118 -0
- data/app/views/foreman_packages/sypackages/_form.html.erb +82 -87
- data/app/views/foreman_packages/sypackages/_sypackage.html.erb +3 -0
- data/app/views/foreman_packages/sypackages/_sypackage_td.html.erb +19 -0
- data/app/views/foreman_packages/sypackages/create.js.erb +2 -0
- data/app/views/foreman_packages/sypackages/destroy.js.erb +1 -0
- data/app/views/foreman_packages/sypackages/edit.js.erb +3 -0
- data/app/views/foreman_packages/sypackages/new.js.erb +3 -0
- data/app/views/foreman_packages/sypackages/show.html.erb +1 -1
- data/app/views/foreman_packages/sypackages/update.js.erb +3 -0
- data/config/routes.rb +3 -9
- data/db/migrate/20150921011935_create_sypackages.rb +1 -0
- data/db/migrate/20150921023709_add_filename_to_sypackage.rb +1 -1
- data/db/migrate/20150921050518_add_file_cache_to_sypackage.rb +1 -1
- data/db/migrate/20150921050519_create_sypackagemodels.rb +11 -0
- data/db/migrate/20150921050522_change_filename_to_sypackage.rb +8 -0
- data/db/migrate/20150921050530_create_syattachments.rb +11 -0
- data/lib/foreman_packages/engine.rb +14 -18
- data/lib/foreman_packages/version.rb +1 -1
- metadata +32 -5
- data/app/uploaders/attachment_uploader.rb +0 -15
- data/app/uploaders/avatar_uploader.rb +0 -57
- data/app/views/foreman_packages/sypackages/upload.html.erb +0 -4
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: foreman_packages
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.0 | 
| 4 | 
            +
              version: 1.1.0
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2015-10- | 
| 12 | 
            +
            date: 2015-10-15 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: deface
         | 
| @@ -68,28 +68,55 @@ extra_rdoc_files: [] | |
| 68 68 | 
             
            files:
         | 
| 69 69 | 
             
            - app/views/foreman_packages/layouts/layouts/new_layout.html.erb
         | 
| 70 70 | 
             
            - app/views/foreman_packages/layouts/new_layout.html.erb
         | 
| 71 | 
            +
            - app/views/foreman_packages/syattachments/edit.html.erb
         | 
| 72 | 
            +
            - app/views/foreman_packages/syattachments/new.html.erb
         | 
| 73 | 
            +
            - app/views/foreman_packages/syattachments/_syattachment.html.erb
         | 
| 74 | 
            +
            - app/views/foreman_packages/syattachments/show.html.erb
         | 
| 75 | 
            +
            - app/views/foreman_packages/syattachments/index.html.erb
         | 
| 76 | 
            +
            - app/views/foreman_packages/syattachments/_form.html.erb
         | 
| 77 | 
            +
            - app/views/foreman_packages/syattachments/_syattachment_td.html.erb
         | 
| 78 | 
            +
            - app/views/foreman_packages/sypackagemodels/edit.html.erb
         | 
| 79 | 
            +
            - app/views/foreman_packages/sypackagemodels/new.html.erb
         | 
| 80 | 
            +
            - app/views/foreman_packages/sypackagemodels/show.html.erb
         | 
| 81 | 
            +
            - app/views/foreman_packages/sypackagemodels/index.html.erb
         | 
| 82 | 
            +
            - app/views/foreman_packages/sypackagemodels/_list.html.erb
         | 
| 83 | 
            +
            - app/views/foreman_packages/sypackagemodels/_form.html.erb
         | 
| 71 84 | 
             
            - app/views/foreman_packages/sypackages/edit.html.erb
         | 
| 85 | 
            +
            - app/views/foreman_packages/sypackages/destroy.js.erb
         | 
| 86 | 
            +
            - app/views/foreman_packages/sypackages/create.js.erb
         | 
| 87 | 
            +
            - app/views/foreman_packages/sypackages/_sypackage.html.erb
         | 
| 72 88 | 
             
            - app/views/foreman_packages/sypackages/new.html.erb
         | 
| 89 | 
            +
            - app/views/foreman_packages/sypackages/_sypackage_td.html.erb
         | 
| 90 | 
            +
            - app/views/foreman_packages/sypackages/update.js.erb
         | 
| 91 | 
            +
            - app/views/foreman_packages/sypackages/new.js.erb
         | 
| 73 92 | 
             
            - app/views/foreman_packages/sypackages/show.html.erb
         | 
| 74 93 | 
             
            - app/views/foreman_packages/sypackages/index.html.erb
         | 
| 75 94 | 
             
            - app/views/foreman_packages/sypackages/_list.html.erb
         | 
| 76 95 | 
             
            - app/views/foreman_packages/sypackages/_form.html.erb
         | 
| 77 | 
            -
            - app/views/foreman_packages/sypackages/ | 
| 96 | 
            +
            - app/views/foreman_packages/sypackages/edit.js.erb
         | 
| 78 97 | 
             
            - app/views/foreman_packages/hosts/hosts/new_action.html.erb
         | 
| 79 98 | 
             
            - app/views/foreman_packages/hosts/new_action.html.erb
         | 
| 80 99 | 
             
            - app/views/dashboard/_foreman_packages_widget.html.erb
         | 
| 81 | 
            -
            - app/uploaders/avatar_uploader.rb
         | 
| 82 | 
            -
            - app/ | 
| 100 | 
            +
            - app/uploaders/foreman_packages/avatar_uploader.rb
         | 
| 101 | 
            +
            - app/assets/javascripts/application.js
         | 
| 102 | 
            +
            - app/assets/javascripts/jquery.fileupload.js
         | 
| 83 103 | 
             
            - app/overrides/dashboard/index/sample_override.html.erb.deface
         | 
| 104 | 
            +
            - app/controllers/foreman_packages/sypackagemodels_controller.rb
         | 
| 84 105 | 
             
            - app/controllers/foreman_packages/sypackages_controller.rb
         | 
| 85 106 | 
             
            - app/controllers/foreman_packages/hosts_controller.rb
         | 
| 107 | 
            +
            - app/controllers/foreman_packages/syattachments_controller.rb
         | 
| 86 108 | 
             
            - app/helpers/foreman_packages/hosts_helper_extensions.rb
         | 
| 87 109 | 
             
            - app/helpers/foreman_packages/sypackages_helper.rb
         | 
| 110 | 
            +
            - app/models/foreman_packages/syattachment.rb
         | 
| 111 | 
            +
            - app/models/foreman_packages/sypackagemodel.rb
         | 
| 88 112 | 
             
            - app/models/foreman_packages/sypackage.rb
         | 
| 89 113 | 
             
            - config/routes.rb
         | 
| 90 114 | 
             
            - db/migrate/20150921023709_add_filename_to_sypackage.rb
         | 
| 91 115 | 
             
            - db/migrate/20150921050518_add_file_cache_to_sypackage.rb
         | 
| 116 | 
            +
            - db/migrate/20150921050530_create_syattachments.rb
         | 
| 117 | 
            +
            - db/migrate/20150921050519_create_sypackagemodels.rb
         | 
| 92 118 | 
             
            - db/migrate/20150921011935_create_sypackages.rb
         | 
| 119 | 
            +
            - db/migrate/20150921050522_change_filename_to_sypackage.rb
         | 
| 93 120 | 
             
            - lib/tasks/foreman_packages_tasks.rake
         | 
| 94 121 | 
             
            - lib/foreman_packages/version.rb
         | 
| 95 122 | 
             
            - lib/foreman_packages/engine.rb
         | 
| @@ -1,15 +0,0 @@ | |
| 1 | 
            -
            # coding: utf-8
         | 
| 2 | 
            -
             | 
| 3 | 
            -
              class ForemanPackages::AttachmentUploader < CarrierWave::Uploader::Base
         | 
| 4 | 
            -
                storage :file
         | 
| 5 | 
            -
             | 
| 6 | 
            -
                def store_dir
         | 
| 7 | 
            -
                  "/etc/puppet/environments/production/modules/packages/files/"
         | 
| 8 | 
            -
                end
         | 
| 9 | 
            -
             | 
| 10 | 
            -
                # def filename
         | 
| 11 | 
            -
                #     model.uploader_secure_token ||= SecureRandom.uuid.gsub("-","")
         | 
| 12 | 
            -
                #     Rails.logger.debug("(BaseUploader.filename) #{model.uploader_secure_token}")
         | 
| 13 | 
            -
                #     "#{model.uploader_secure_token}.#{file.extension.downcase}"
         | 
| 14 | 
            -
                # end
         | 
| 15 | 
            -
              end
         | 
| @@ -1,57 +0,0 @@ | |
| 1 | 
            -
            # encoding: utf-8
         | 
| 2 | 
            -
            module ForemanPackages
         | 
| 3 | 
            -
              class AvatarUploader < CarrierWave::Uploader::Base
         | 
| 4 | 
            -
             | 
| 5 | 
            -
                # Include RMagick or MiniMagick support:
         | 
| 6 | 
            -
                # include CarrierWave::RMagick
         | 
| 7 | 
            -
                # include CarrierWave::MiniMagick
         | 
| 8 | 
            -
             | 
| 9 | 
            -
                # Choose what kind of storage to use for this uploader:
         | 
| 10 | 
            -
                storage :file
         | 
| 11 | 
            -
                # storage :fog
         | 
| 12 | 
            -
             | 
| 13 | 
            -
                # Override the directory where uploaded files will be stored.
         | 
| 14 | 
            -
                # This is a sensible default for uploaders that are meant to be mounted:
         | 
| 15 | 
            -
                def store_dir
         | 
| 16 | 
            -
                  "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
         | 
| 17 | 
            -
                end
         | 
| 18 | 
            -
                
         | 
| 19 | 
            -
                def filename
         | 
| 20 | 
            -
                    model.uploader_secure_token ||= SecureRandom.uuid.gsub("-","")
         | 
| 21 | 
            -
                    Rails.logger.debug("(BaseUploader.filename) #{model.uploader_secure_token}")
         | 
| 22 | 
            -
                    "#{model.uploader_secure_token}.#{file.extension.downcase}"
         | 
| 23 | 
            -
                end
         | 
| 24 | 
            -
                # Provide a default URL as a default if there hasn't been a file uploaded:
         | 
| 25 | 
            -
                # def default_url
         | 
| 26 | 
            -
                #   # For Rails 3.1+ asset pipeline compatibility:
         | 
| 27 | 
            -
                #   # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
         | 
| 28 | 
            -
                #
         | 
| 29 | 
            -
                #   "/images/fallback/" + [version_name, "default.png"].compact.join('_')
         | 
| 30 | 
            -
                # end
         | 
| 31 | 
            -
             | 
| 32 | 
            -
                # Process files as they are uploaded:
         | 
| 33 | 
            -
                # process :scale => [200, 300]
         | 
| 34 | 
            -
                #
         | 
| 35 | 
            -
                # def scale(width, height)
         | 
| 36 | 
            -
                #   # do something
         | 
| 37 | 
            -
                # end
         | 
| 38 | 
            -
             | 
| 39 | 
            -
                # Create different versions of your uploaded files:
         | 
| 40 | 
            -
                # version :thumb do
         | 
| 41 | 
            -
                #   process :resize_to_fit => [50, 50]
         | 
| 42 | 
            -
                # end
         | 
| 43 | 
            -
             | 
| 44 | 
            -
                # Add a white list of extensions which are allowed to be uploaded.
         | 
| 45 | 
            -
                # For images you might use something like this:
         | 
| 46 | 
            -
                # def extension_white_list
         | 
| 47 | 
            -
                #   %w(jpg jpeg gif png)
         | 
| 48 | 
            -
                # end
         | 
| 49 | 
            -
             | 
| 50 | 
            -
                # Override the filename of the uploaded files:
         | 
| 51 | 
            -
                # Avoid using model.id or version_name here, see uploader/store.rb for details.
         | 
| 52 | 
            -
                # def filename
         | 
| 53 | 
            -
                #   "something.jpg" if original_filename
         | 
| 54 | 
            -
                # end
         | 
| 55 | 
            -
             | 
| 56 | 
            -
              end
         | 
| 57 | 
            -
            end
         |