mix-rails-albums 0.23.1 → 0.24.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.
- checksums.yaml +7 -0
- data/app/assets/javascripts/backbone/templates/photos/thumbnail.hamlc.erb +1 -1
- data/app/assets/javascripts/backbone/templates/photos/upload_index.hamlc.erb +4 -5
- data/app/controllers/albums_controller.rb +2 -1
- data/app/helpers/admix/albums_helper.rb +2 -6
- data/app/models/concerns/album.rb +4 -2
- data/app/models/photo.rb +1 -1
- data/app/views/admix/albums/_form_config.haml +9 -0
- data/app/views/admix/albums/_grid_actions.haml +1 -0
- data/app/views/admix/albums/_grid_columns.haml +9 -0
- data/app/views/admix/albums/_show.html.haml +1 -1
- data/app/views/templates/albums/index.haml +2 -0
- data/app/views/templates/albums/show.haml +2 -0
- data/config/locales/albums.pt-BR.yml +2 -1
- data/db/migrate/20130219111930_remove_polymorphic_association_from_photos.rb +6 -0
- data/lib/mix-rails-albums/engine.rb +6 -9
- data/lib/mix-rails-albums/version.rb +2 -2
- metadata +17 -29
- data/app/models/admix/albums_datagrid.rb +0 -32
- data/app/models/admix/photos_datagrid.rb +0 -15
- data/app/views/admix/albums/_form_fields.html.haml +0 -4
- data/app/views/admix/albums/_table_actions.html.haml +0 -4
    
        checksums.yaml
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            SHA1:
         | 
| 3 | 
            +
              metadata.gz: 13fcbba330215aac7557e9898a7e6b0abd424b74
         | 
| 4 | 
            +
              data.tar.gz: e8237ccc41d9d6074019347b39cabd29791bf2e7
         | 
| 5 | 
            +
            SHA512:
         | 
| 6 | 
            +
              metadata.gz: 9e9210bc3a51149b747feb3bfc1a5762ef1559f05c05b4607d67243085b657db4af9e56bb5b2dbb1d0b8b70d92a597b223b118c52ab7d32687925e80fa5a0ab8
         | 
| 7 | 
            +
              data.tar.gz: e2ba0214e317185e7b8882359fe62a7e3bfff47671e7e1d8ca230bb5c726dd95d067191a1e4d8274139ea682fc2d2c6331a1eaeb29d3661ce2111eeac9156526
         | 
| @@ -2,7 +2,7 @@ | |
| 2 2 | 
             
              %a.link-popover{"data-content" => "<i class=icon-edit></i> Edit"}
         | 
| 3 3 | 
             
                .loading-file
         | 
| 4 4 | 
             
                  - if @get('image').url
         | 
| 5 | 
            -
                    %a.edit{href:  | 
| 5 | 
            +
                    %a.zoom-image.edit{href: ROOT_PATH + @get('image').url, rel: 'admix-albums-image'}
         | 
| 6 6 | 
             
                      %img{src: ROOT_PATH + @get('image').medium.url}
         | 
| 7 7 | 
             
                  - else
         | 
| 8 8 | 
             
                    %img{src: "http://placehold.it/130x90&text=Carregando"}
         | 
| @@ -1,9 +1,8 @@ | |
| 1 | 
            -
            #upload-buttons | 
| 1 | 
            +
            #upload-buttons
         | 
| 2 2 | 
             
              %div{:style => "display:none;"}
         | 
| 3 | 
            -
                %input#uploader{:multiple => "multiple", :name => "files", :style => "display:none;", :type => "file", :value => "Selecionar File(s)"} | 
| 4 | 
            -
                %input#uploaderZip{:name => "files", :style => "display:none;", :type => "file", :value => "Selecionar File(s)"} | 
| 5 | 
            -
              % | 
| 6 | 
            -
              %div
         | 
| 3 | 
            +
                %input#uploader{:multiple => "multiple", :name => "files", :style => "display:none;", :type => "file", :value => "Selecionar File(s)"}
         | 
| 4 | 
            +
                %input#uploaderZip{:name => "files", :style => "display:none;", :type => "file", :value => "Selecionar File(s)"}
         | 
| 5 | 
            +
              %div.well
         | 
| 7 6 | 
             
                %a.btn.btn-primary.btn-upload{:onclick => "jQuery('#uploader').click();"} <%= I18n.t('photos.btn.upload_pictures') %>
         | 
| 8 7 | 
             
              -#
         | 
| 9 8 | 
             
                <%= I18n.t('photos.or') %>
         | 
| @@ -1,11 +1,12 @@ | |
| 1 1 | 
             
            class AlbumsController < ApplicationController
         | 
| 2 2 |  | 
| 3 3 | 
             
              def index
         | 
| 4 | 
            -
                @albums = Album.published.paginate(:page => params[:page], :per_page => 12)
         | 
| 4 | 
            +
                @albums = Album.published.desc.paginate(:page => params[:page], :per_page => 12)
         | 
| 5 5 | 
             
              end
         | 
| 6 6 |  | 
| 7 7 | 
             
              def show
         | 
| 8 8 | 
             
                @album = Album.find(params[:id])
         | 
| 9 | 
            +
                @photos = @album.photos.paginate(:page => params[:page], :per_page => 12)
         | 
| 9 10 | 
             
              end
         | 
| 10 11 |  | 
| 11 12 | 
             
            end
         | 
| @@ -1,11 +1,7 @@ | |
| 1 1 | 
             
            module Admix::AlbumsHelper
         | 
| 2 | 
            -
              def form2_attributes
         | 
| 3 | 
            -
                %w(name description date published)
         | 
| 4 | 
            -
              end
         | 
| 5 2 |  | 
| 6 | 
            -
              def  | 
| 7 | 
            -
                 | 
| 8 | 
            -
                form.input :date
         | 
| 3 | 
            +
              def action_photos(obj)
         | 
| 4 | 
            +
                link_to image_tag('albums/photos.png'), resource_url([obj, :photos]), class: 'btn', title:'Adicionar fotos'
         | 
| 9 5 | 
             
              end
         | 
| 10 6 |  | 
| 11 7 | 
             
            end
         | 
| @@ -10,14 +10,16 @@ module Concerns::Album | |
| 10 10 | 
             
                enumerize :status, in: [:published, :unpublished], default: :published, predicates: true
         | 
| 11 11 | 
             
                friendly_id :title, use: :slugged
         | 
| 12 12 |  | 
| 13 | 
            -
                has_many :photos,  | 
| 13 | 
            +
                has_many :photos, dependent: :destroy
         | 
| 14 14 | 
             
                belongs_to :related, :polymorphic => true
         | 
| 15 15 |  | 
| 16 16 | 
             
                validation_for_title
         | 
| 17 17 | 
             
                validation_for_date
         | 
| 18 18 |  | 
| 19 19 |  | 
| 20 | 
            -
                scope :published, includes(:photos).where(status: :published) | 
| 20 | 
            +
                scope :published, includes(:photos).where(status: :published)
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                scope :desc, order('albums.date DESC')
         | 
| 21 23 |  | 
| 22 24 | 
             
              end
         | 
| 23 25 |  | 
    
        data/app/models/photo.rb
    CHANGED
    
    
| @@ -0,0 +1,9 @@ | |
| 1 | 
            +
            - admix_tab t('albums.album') do |t|
         | 
| 2 | 
            +
              -t.tab_content do
         | 
| 3 | 
            +
                = f.input :title,         as: 'string', input_html: {class: 'span12'}
         | 
| 4 | 
            +
                = f.input :description,   as: 'text', input_html: {class: 'span12'}
         | 
| 5 | 
            +
                = f.input :date,          as: 'datepicker', input_html: {class: 'span12'}
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            - content_for :form_options do
         | 
| 8 | 
            +
              = f.input :status, input_html: {class: 'span12'}  
         | 
| 9 | 
            +
              
         | 
| @@ -0,0 +1 @@ | |
| 1 | 
            +
            = grid_actions_for(obj, [:photos, :show, :edit, :destroy])
         | 
| @@ -0,0 +1,9 @@ | |
| 1 | 
            +
            - grid.column name: input_label(:defaults, :title), attribute: 'title' do |obj|
         | 
| 2 | 
            +
              - obj.title
         | 
| 3 | 
            +
            - grid.column name: input_label(:defaults, :date), attribute: 'date' do |obj|
         | 
| 4 | 
            +
              - obj.date
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            - grid.column name: input_label(:defaults, :status), attribute: 'status', 
         | 
| 7 | 
            +
              custom_filter: {t('enumerize.status.published') => 'published', t('enumerize.status.unpublished') => 'unpublished'} do |obj|
         | 
| 8 | 
            +
              - obj.status.text
         | 
| 9 | 
            +
            - column_actions(grid)
         | 
| @@ -1,3 +1,4 @@ | |
| 1 | 
            +
            # conding: utf-8
         | 
| 1 2 | 
             
            pt-BR:
         | 
| 2 3 | 
             
              resources:
         | 
| 3 4 | 
             
                albums: 'albuns'
         | 
| @@ -23,7 +24,7 @@ pt-BR: | |
| 23 24 | 
             
                legend: 'Legenda'
         | 
| 24 25 | 
             
                or: 'ou'
         | 
| 25 26 | 
             
                upload:
         | 
| 26 | 
            -
                  explanation: ' | 
| 27 | 
            +
                  explanation: 'Adicione as fotos.'
         | 
| 27 28 | 
             
                btn:
         | 
| 28 29 | 
             
                  upload_pictures: 'Enviar arquivos de imagem'
         | 
| 29 30 | 
             
                  upload_zip: 'Enviar arquivo ZIP'
         | 
| @@ -6,15 +6,12 @@ module MixRailsAlbums | |
| 6 6 | 
             
                  g.integration_tool :rspec
         | 
| 7 7 | 
             
                end
         | 
| 8 8 |  | 
| 9 | 
            -
                 | 
| 10 | 
            -
                   | 
| 11 | 
            -
                     | 
| 12 | 
            -
                       | 
| 13 | 
            -
                         | 
| 14 | 
            -
             | 
| 15 | 
            -
                          submenu.title = I18n.t('albums.albums')
         | 
| 16 | 
            -
                          submenu.url   = 'admix_albums_url'
         | 
| 17 | 
            -
                        end
         | 
| 9 | 
            +
                initializer "mix-rails-albums.setup_menu", after: "admix.setup_menu" do
         | 
| 10 | 
            +
                  ActiveMenu::get('admix-nav') do |nav|
         | 
| 11 | 
            +
                    nav.get(:content) do |content|
         | 
| 12 | 
            +
                      content.child :albums do |albums|
         | 
| 13 | 
            +
                        albums.text Proc.new {t('albums.albums')}
         | 
| 14 | 
            +
                        albums.href Proc.new {admix_albums_url}
         | 
| 18 15 | 
             
                      end
         | 
| 19 16 | 
             
                    end
         | 
| 20 17 | 
             
                  end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,20 +1,18 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: mix-rails-albums
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 5 | 
            -
              prerelease: 
         | 
| 4 | 
            +
              version: 0.24.0
         | 
| 6 5 | 
             
            platform: ruby
         | 
| 7 6 | 
             
            authors:
         | 
| 8 7 | 
             
            - Sadjow Leão
         | 
| 9 8 | 
             
            autorequire: 
         | 
| 10 9 | 
             
            bindir: bin
         | 
| 11 10 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2013- | 
| 11 | 
            +
            date: 2013-03-12 00:00:00.000000000 Z
         | 
| 13 12 | 
             
            dependencies:
         | 
| 14 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 14 | 
             
              name: rails
         | 
| 16 15 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 17 | 
            -
                none: false
         | 
| 18 16 | 
             
                requirements:
         | 
| 19 17 | 
             
                - - ~>
         | 
| 20 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| @@ -22,7 +20,6 @@ dependencies: | |
| 22 20 | 
             
              type: :runtime
         | 
| 23 21 | 
             
              prerelease: false
         | 
| 24 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 25 | 
            -
                none: false
         | 
| 26 23 | 
             
                requirements:
         | 
| 27 24 | 
             
                - - ~>
         | 
| 28 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| @@ -30,33 +27,29 @@ dependencies: | |
| 30 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 31 28 | 
             
              name: mini_magick
         | 
| 32 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 33 | 
            -
                none: false
         | 
| 34 30 | 
             
                requirements:
         | 
| 35 | 
            -
                - -  | 
| 31 | 
            +
                - - '>='
         | 
| 36 32 | 
             
                  - !ruby/object:Gem::Version
         | 
| 37 33 | 
             
                    version: '0'
         | 
| 38 34 | 
             
              type: :runtime
         | 
| 39 35 | 
             
              prerelease: false
         | 
| 40 36 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 41 | 
            -
                none: false
         | 
| 42 37 | 
             
                requirements:
         | 
| 43 | 
            -
                - -  | 
| 38 | 
            +
                - - '>='
         | 
| 44 39 | 
             
                  - !ruby/object:Gem::Version
         | 
| 45 40 | 
             
                    version: '0'
         | 
| 46 41 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 47 42 | 
             
              name: haml_coffee_assets
         | 
| 48 43 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 49 | 
            -
                none: false
         | 
| 50 44 | 
             
                requirements:
         | 
| 51 | 
            -
                - -  | 
| 45 | 
            +
                - - '>='
         | 
| 52 46 | 
             
                  - !ruby/object:Gem::Version
         | 
| 53 47 | 
             
                    version: '0'
         | 
| 54 48 | 
             
              type: :runtime
         | 
| 55 49 | 
             
              prerelease: false
         | 
| 56 50 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 57 | 
            -
                none: false
         | 
| 58 51 | 
             
                requirements:
         | 
| 59 | 
            -
                - -  | 
| 52 | 
            +
                - - '>='
         | 
| 60 53 | 
             
                  - !ruby/object:Gem::Version
         | 
| 61 54 | 
             
                    version: '0'
         | 
| 62 55 | 
             
            description: This is a module for albums funcionality of mix-rails.
         | 
| @@ -126,18 +119,19 @@ files: | |
| 126 119 | 
             
            - app/assets/javascripts/views/filezipview.js
         | 
| 127 120 | 
             
            - app/assets/javascripts/views/fileview.js
         | 
| 128 121 | 
             
            - app/helpers/admix/albums_helper.rb
         | 
| 129 | 
            -
            - app/models/admix/photos_datagrid.rb
         | 
| 130 | 
            -
            - app/models/admix/albums_datagrid.rb
         | 
| 131 122 | 
             
            - app/models/album.rb
         | 
| 132 123 | 
             
            - app/models/photo.rb
         | 
| 133 124 | 
             
            - app/models/concerns/album.rb
         | 
| 134 125 | 
             
            - app/views/admix/albums/_show.html.haml
         | 
| 135 | 
            -
            - app/views/admix/albums/ | 
| 136 | 
            -
            - app/views/admix/albums/ | 
| 126 | 
            +
            - app/views/admix/albums/_grid_actions.haml
         | 
| 127 | 
            +
            - app/views/admix/albums/_grid_columns.haml
         | 
| 128 | 
            +
            - app/views/admix/albums/_form_config.haml
         | 
| 137 129 | 
             
            - app/views/admix/photos/index.html.haml
         | 
| 138 130 | 
             
            - app/views/admix/photos/_upload.html.haml
         | 
| 139 131 | 
             
            - app/views/albums/index.html.haml
         | 
| 140 132 | 
             
            - app/views/albums/show.html.haml
         | 
| 133 | 
            +
            - app/views/templates/albums/index.haml
         | 
| 134 | 
            +
            - app/views/templates/albums/show.haml
         | 
| 141 135 | 
             
            - app/views/photos/index.html.haml
         | 
| 142 136 | 
             
            - app/views/photos/show.html.haml
         | 
| 143 137 | 
             
            - config/locales/albums.pt-BR.yml
         | 
| @@ -145,6 +139,7 @@ files: | |
| 145 139 | 
             
            - config/initializers/albums.rb
         | 
| 146 140 | 
             
            - config/routes.rb
         | 
| 147 141 | 
             
            - config/application.rb
         | 
| 142 | 
            +
            - db/migrate/20130219111930_remove_polymorphic_association_from_photos.rb
         | 
| 148 143 | 
             
            - db/migrate/20130208020540_create_albums.rb
         | 
| 149 144 | 
             
            - db/migrate/20130208021030_create_photos.rb
         | 
| 150 145 | 
             
            - lib/tasks/albums_tasks.rake
         | 
| @@ -156,32 +151,25 @@ files: | |
| 156 151 | 
             
            - README.rdoc
         | 
| 157 152 | 
             
            homepage: https://github.com/mixinternet/mix-rails
         | 
| 158 153 | 
             
            licenses: []
         | 
| 154 | 
            +
            metadata: {}
         | 
| 159 155 | 
             
            post_install_message: 
         | 
| 160 156 | 
             
            rdoc_options: []
         | 
| 161 157 | 
             
            require_paths:
         | 
| 162 158 | 
             
            - lib
         | 
| 163 159 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 164 | 
            -
              none: false
         | 
| 165 160 | 
             
              requirements:
         | 
| 166 | 
            -
              - -  | 
| 161 | 
            +
              - - '>='
         | 
| 167 162 | 
             
                - !ruby/object:Gem::Version
         | 
| 168 163 | 
             
                  version: '0'
         | 
| 169 | 
            -
                  segments:
         | 
| 170 | 
            -
                  - 0
         | 
| 171 | 
            -
                  hash: -4085379778431430325
         | 
| 172 164 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 173 | 
            -
              none: false
         | 
| 174 165 | 
             
              requirements:
         | 
| 175 | 
            -
              - -  | 
| 166 | 
            +
              - - '>='
         | 
| 176 167 | 
             
                - !ruby/object:Gem::Version
         | 
| 177 168 | 
             
                  version: '0'
         | 
| 178 | 
            -
                  segments:
         | 
| 179 | 
            -
                  - 0
         | 
| 180 | 
            -
                  hash: -4085379778431430325
         | 
| 181 169 | 
             
            requirements: []
         | 
| 182 170 | 
             
            rubyforge_project: 
         | 
| 183 | 
            -
            rubygems_version:  | 
| 171 | 
            +
            rubygems_version: 2.0.0
         | 
| 184 172 | 
             
            signing_key: 
         | 
| 185 | 
            -
            specification_version:  | 
| 173 | 
            +
            specification_version: 4
         | 
| 186 174 | 
             
            summary: This is a module for albums funcionality of mix-rails.
         | 
| 187 175 | 
             
            test_files: []
         | 
| @@ -1,32 +0,0 @@ | |
| 1 | 
            -
            class Admix::AlbumsDatagrid
         | 
| 2 | 
            -
             | 
| 3 | 
            -
              include Datagrid
         | 
| 4 | 
            -
             | 
| 5 | 
            -
              extend AdmixHelper
         | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 8 | 
            -
              scope do
         | 
| 9 | 
            -
                Album.order("date DESC")
         | 
| 10 | 
            -
              end
         | 
| 11 | 
            -
             | 
| 12 | 
            -
              filter :title, :string
         | 
| 13 | 
            -
              filter :date do |value|
         | 
| 14 | 
            -
                value.to_s(:created_at)
         | 
| 15 | 
            -
              end
         | 
| 16 | 
            -
             | 
| 17 | 
            -
              column :title, header: input_label(:albums, :title)
         | 
| 18 | 
            -
              column :date, header: input_label(:albums, :date) do |album|
         | 
| 19 | 
            -
                album.date.strftime("%d/%m/%Y") #album.date.to_s(:created_at)
         | 
| 20 | 
            -
              end
         | 
| 21 | 
            -
              column :photos_quantity, header: input_label(:albums, :photos_quantity) do |album|
         | 
| 22 | 
            -
                album.photos.count
         | 
| 23 | 
            -
              end
         | 
| 24 | 
            -
             | 
| 25 | 
            -
              column :published, header: input_label(:albums, :status) do |album|
         | 
| 26 | 
            -
                album.status.text
         | 
| 27 | 
            -
              end
         | 
| 28 | 
            -
              
         | 
| 29 | 
            -
             | 
| 30 | 
            -
              include Admix::TableActions
         | 
| 31 | 
            -
             | 
| 32 | 
            -
            end
         | 
| @@ -1,4 +0,0 @@ | |
| 1 | 
            -
            = link_to image_tag('albums/photos.png'), resource_url([resource, :photos]), class: 'btn', title:'Adicionar fotos'
         | 
| 2 | 
            -
            = link_to image_tag('admix/zoom.png'), resource_url(resource), class: 'btn', title:'Visualizar registro'
         | 
| 3 | 
            -
            = link_to image_tag('admix/page_edit.png'), edit_resource_url(resource), class: 'btn', title:'Editar registro'
         | 
| 4 | 
            -
            = link_to image_tag('admix/cancel.png'), resource_url(resource), method: :delete, data: { confirm: t('admix.crud.destroy_confirm') }, class: 'btn', title:'Deletar registro'
         |