bhf 0.7.12 → 0.7.13
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
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 58d3c238599cf5b5d56b13769f3fb6ca7bf25485
         | 
| 4 | 
            +
              data.tar.gz: a53e7eb6589687782d07be6e0b53e5bb5add59a5
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: d04a4904b6d237ce6a5edcb09fe10bc89c142137f0ba00f1e2695959f5aadb5fcdf0c3c3ef9dc7d74c67fa41ab4460d6b2b862ecff486987c05b9d093a390b5c
         | 
| 7 | 
            +
              data.tar.gz: e7be85db1268a307a1725d9fa0ee92e9c528d9fa17fedc07355b66ba9ff28d7963e5434ecd90f2b3d82b8151de89bbf219c9a005d2b0b0bafb885acc364db1b9
         | 
| @@ -80,12 +80,10 @@ class Bhf::EntriesController < Bhf::ApplicationController | |
| 80 80 | 
             
              end
         | 
| 81 81 |  | 
| 82 82 | 
             
              def sort
         | 
| 83 | 
            -
                sort_attr = (@platform.sortable_property || @platform.sortable).to_sym
         | 
| 84 | 
            -
                
         | 
| 85 83 | 
             
                params[:order].each do |order|
         | 
| 86 84 | 
             
                  @model.
         | 
| 87 85 | 
             
                    find(order[1].gsub("_#{@platform.name}", '')).
         | 
| 88 | 
            -
                    update_attribute( | 
| 86 | 
            +
                    update_attribute(@platform.sortable_property, order[0].to_i)
         | 
| 89 87 | 
             
                end
         | 
| 90 88 |  | 
| 91 89 | 
             
                head :ok
         | 
| @@ -20,6 +20,16 @@ module Bhf | |
| 20 20 | 
             
                def delete_t(platform)
         | 
| 21 21 | 
             
                  t("bhf.helpers.entry.models.#{platform.model_name}.delete", platform_name: platform.title_singular, default: t('bhf.helpers.entry.delete')).html_safe
         | 
| 22 22 | 
             
                end
         | 
| 23 | 
            +
                
         | 
| 24 | 
            +
                def find_smallest_size_url_for_file(file)
         | 
| 25 | 
            +
                  if file.exists?(:thumb)
         | 
| 26 | 
            +
                    file.url(:thumb)
         | 
| 27 | 
            +
                  elsif file.exists?(:medium)
         | 
| 28 | 
            +
                    file.url(:medium)
         | 
| 29 | 
            +
                  else
         | 
| 30 | 
            +
                    file.url
         | 
| 31 | 
            +
                  end
         | 
| 32 | 
            +
                end
         | 
| 23 33 |  | 
| 24 34 | 
             
              end
         | 
| 25 35 | 
             
            end
         | 
    
        data/app/views/bhf/_footer.haml
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            - if @start_time
         | 
| 2 | 
            -
              %p.state=  | 
| 2 | 
            +
              %p.state= t('bhf.footer.state', time: (Time.now-@start_time).round(2)).html_safe
         | 
| 3 3 |  | 
| 4 | 
            -
            %p.copy=  | 
| 4 | 
            +
            %p.copy= t('bhf.footer.copy').html_safe
         | 
| 5 5 |  | 
| 6 | 
            -
            %p.info=  | 
| 6 | 
            +
            %p.info= t('bhf.footer.info').html_safe
         | 
| @@ -4,7 +4,7 @@ | |
| 4 4 | 
             
                - file = f.object.send(field.name)
         | 
| 5 5 | 
             
                - if file.file?
         | 
| 6 6 | 
             
                  - if ['image/jpeg', 'image/pjpeg', 'image/jpg', 'image/png', 'image/tif', 'image/gif'].include?(f.object.send("#{field.name}_content_type"))
         | 
| 7 | 
            -
                    = image_tag file | 
| 7 | 
            +
                    = image_tag find_smallest_size_url_for_file(file), class: 'uploaded_image'
         | 
| 8 8 | 
             
                  - else
         | 
| 9 9 | 
             
                    = link_to f.object.send("#{field.name}_file_name"), file.url, class: 'uploaded_file'
         | 
| 10 10 |  | 
    
        data/lib/bhf/platform.rb
    CHANGED
    
    | @@ -140,16 +140,16 @@ module Bhf | |
| 140 140 | 
             
                  end
         | 
| 141 141 | 
             
                end
         | 
| 142 142 |  | 
| 143 | 
            -
                def columns_count
         | 
| 144 | 
            -
                  columns.count + (sortable ? 2 : 1)
         | 
| 145 | 
            -
                end
         | 
| 146 | 
            -
             | 
| 147 143 | 
             
                def sortable
         | 
| 148 144 | 
             
                  table_options 'sortable'
         | 
| 149 145 | 
             
                end
         | 
| 150 146 |  | 
| 151 147 | 
             
                def sortable_property
         | 
| 152 | 
            -
                   | 
| 148 | 
            +
                  (@data['sortable_property'] || :position).to_sym
         | 
| 149 | 
            +
                end
         | 
| 150 | 
            +
             | 
| 151 | 
            +
                def columns_count
         | 
| 152 | 
            +
                  columns.count + (sortable ? 2 : 1)
         | 
| 153 153 | 
             
                end
         | 
| 154 154 |  | 
| 155 155 | 
             
                def hide_edit
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: bhf
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.7. | 
| 4 | 
            +
              version: 0.7.13
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Anton Pawlik
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2014-06- | 
| 11 | 
            +
            date: 2014-06-05 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rails
         |