egov_utils 0.5.0 → 0.6.1
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 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 2653c7dcc64559bf44c36d4930c23ab4f29519d03ba07ba11936dc3cb95ca46c
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: bf1b2ceb79ff38c06bc8ecbea70bc04acb2670dfc485ad81b739bfe2510f14e2
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: ab4dcd608ba8773a0374eb36af72a76d61dc65b27af6c05b852639969e1cefdcc3eb4d6a1a54ac42c41c3c4d96deab4a8751803623d8921b8670bc9bc7dcaedb
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: b1c8f4911fec768ab8e6574d8a5d3192824d163cc69d26c262106e4be0b599e6bfe1912a65373bb113d342126da4ca8ef5f1f73d1d4205f21fed3802be3962db
         
     | 
| 
         @@ -19,6 +19,14 @@ $ -> 
     | 
|
| 
       19 
19 
     | 
    
         
             
                item = grid.dataItem(index)
         
     | 
| 
       20 
20 
     | 
    
         
             
                $.ajax('<%= polymorphic_path(schema.model) %>/'+item.id+'/edit.js')
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
      
 22 
     | 
    
         
            +
              prepareDownload = (format) ->
         
     | 
| 
      
 23 
     | 
    
         
            +
                return (index) -> downloadRecord(format, index)
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
              downloadRecord = (format, index) ->
         
     | 
| 
      
 26 
     | 
    
         
            +
                grid = $("#<%= grid_id %>").swidget()
         
     | 
| 
      
 27 
     | 
    
         
            +
                item = grid.dataItem(index)
         
     | 
| 
      
 28 
     | 
    
         
            +
                window.location.href = '<%= polymorphic_path(schema.model) %>/'+item.id+'.'+format
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
       22 
30 
     | 
    
         
             
            <% if local_assigns[:detail_for] %>
         
     | 
| 
       23 
31 
     | 
    
         
             
              <% detail_col = schema.column(detail_for) %>
         
     | 
| 
       24 
32 
     | 
    
         
             
              detailCreated = (evt)->
         
     | 
| 
         @@ -95,6 +103,11 @@ $ -> 
     | 
|
| 
       95 
103 
     | 
    
         
             
                    width: 150
         
     | 
| 
       96 
104 
     | 
    
         
             
                    title: "<%= t('label_actions') %>"
         
     | 
| 
       97 
105 
     | 
    
         
             
                    buttons: [
         
     | 
| 
      
 106 
     | 
    
         
            +
                      <% if can?(:read, schema.model) %>
         
     | 
| 
      
 107 
     | 
    
         
            +
                        <% local_assigns.fetch(:downloads, {}).each do |format, label| %>
         
     | 
| 
      
 108 
     | 
    
         
            +
                          { cls: 'btn btn-sm btn-secondary', caption: '<%= label %>', click: prepareDownload('<%= format %>') },
         
     | 
| 
      
 109 
     | 
    
         
            +
                        <% end %>
         
     | 
| 
      
 110 
     | 
    
         
            +
                      <% end %>
         
     | 
| 
       98 
111 
     | 
    
         
             
                      <% if can?(:update, schema.model) %>
         
     | 
| 
       99 
112 
     | 
    
         
             
                      {cls: 'btn btn-sm btn-primary', caption: '<%= t('label_edit') %>', click: editRecord},
         
     | 
| 
       100 
113 
     | 
    
         
             
                      <% end %>
         
     | 
| 
         @@ -338,7 +338,7 @@ module EgovUtils 
     | 
|
| 
       338 
338 
     | 
    
         
             
                      attr_name.collect{|an| get_attr(entry, an).presence }.compact.first.to_s
         
     | 
| 
       339 
339 
     | 
    
         
             
                    elsif !attr_name.blank?
         
     | 
| 
       340 
340 
     | 
    
         
             
                      value = entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name]
         
     | 
| 
       341 
     | 
    
         
            -
                      value.to_s.force_encoding('UTF-8')
         
     | 
| 
      
 341 
     | 
    
         
            +
                      value.to_s.dup.force_encoding('UTF-8')
         
     | 
| 
       342 
342 
     | 
    
         
             
                    end
         
     | 
| 
       343 
343 
     | 
    
         
             
                  end
         
     | 
| 
       344 
344 
     | 
    
         | 
    
        data/lib/egov_utils/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: egov_utils
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.6.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Ondřej Ezr
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2021-11- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-11-21 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rails
         
     |